Code can fight systemic racism. This Black History Month, let's rewrite the wrong. Get involved

Build a robotic calculations and inference agent

Note: This pattern is part of a composite pattern. These are code patterns that can be stand-alone applications or might be a continuation of another code pattern. This composite pattern consists of:


There is a technological revolution taking place in the service industry with the introduction of robots. The robots are powered by artificial intelligence and are able to perform the roles, such as a waiter, customer relationship executive, or cognitive assistant. The capabilities of the robot can be enhanced exponentially by integrating with cloud capabilities.

This pattern demonstrates a scenario where the robot can answer queries on financial data by integrating with the IBM Watson Assistant service and IBM Watson Studio. We’ll take you through all the steps to build an interactive interface with a NAO robot, Watson Assistant API, and DSX.


This pattern demonstrates how to enhance the capabilities of NAO robot by integrating with IBM Cloud offerings to create a cognitive agent, which can do real time analysis on a financial data and explain the analysis to the user. This developer pattern is intended for developers who want to learn a new method for interacting with a cognitive agent and a NAO robot.

The robot, Watson Assistant, and Watson Studio interact with the robot to query data-driven calculations, which are inferences and intent derived through the conversation API and passed to DSX to perform real time calculation on data. The robotic AI agent provides interactivity, while the Watson Assistant API and DSX provide intent-driven quick access and calculations on data.

In this pattern, we show you how to integrate a NAO robot, Watson Assistant API, and Jupyter Notebook (Watson Studio) by using a Node-RED instance to develop a solution that can help trigger IBM DSX workflows from the robot.

In this pattern, you will learn how to:

  • Establish the communication between the NAO robot and IBM Watson Studio by using the Watson Assistant API.
  • Create the Watson Assistant chatbot application.
  • Perform statistical analysis on a financial data set by using the Jupyter (Python) Notebook on IBM Watson Studio.



  1. The user asks specific questions to the robot.

  2. The robot converts the speech into text and sends the text to the Node-RED flow for further processing on the cloud. The results from the processing on the cloud is returned to the NAO robot through the Node-RED flow.

  3. Node-RED flow sends the text from the NAO robot to the Watson Assistant API.

  4. The Watson Assistant API takes the text input. The text is analyzed to determine the intent based on the training provided.

  5. The context and state of the conversation is saved to the Cloudant DB to track the conversation flow of the user.

  6. The data set for analysis is stored in Object Storage.

  7. The data file is taken as input in CSV format.

  8. The Jupyter notebook receives the Watson Assistant Service API output from Node-RED by using web sockets. The notebook processes the data based on the question and generates insights. The insights are sent back to the Node-RED flow by using the web sockets.

  9. The Jupyter notebook is powered by Spark.


Find the detailed steps for this pattern in the README.