In Episode 2, we will explain how to input data delivered via MQTT into NVIDIA NemoClaw and utilize it from an AI agent.
The first demo we'll introduce shows how to input data delivered via MQTT, a communication protocol widely used in the IoT field, into NemoClaw. This demo uses a sine wave generated by Python code to simulate sensor data, so no actual sensors are required.
System configuration
- Data delivered via MQTT can be accessed by the AI agent within NemoClaw.
- MQTT publishes sine wave data generated by Python code, so no sensor is required.
• MQTT broker uses Mosquitto
- Receive data using an MQTT subscriber within Node-RED.
Similarly, data is disclosed to NemoClaw via a REST API endpoint set up within Node-RED.
REST API endpoint
In this demo, data delivered via MQTT is first received by an MQTT subscriber within a flow created in Node-RED, and then exposed via a REST API endpoint set up within the same flow.
The reasons for adopting this method are as follows:
• Easy to implement
・ NemoClaw The network policy settings are simple.
Network Policy
NemoClaw's network control is Deny-by-Default Egress In other words, you cannot access external endpoints unless you explicitly grant permission.
For this demo, you will need to configure the following information.
• Make the data public. REST API endpoint IP address
Port
HTTP Request method
HTTP path
REST API To the endpoint AI Commands used by agents when accessing
In this demo, NemoClaw and REST API Although the endpoints are located on the same computer, IP The address contains 127,0.0.1 or localhost Rather, the actual IP You need to specify the address. Like this: YAML Write the network policy in a file of that format, nemoclaw sandbox policy add Command NemoClaw This will be reflected.
preset: name: node-red-api description: "Node-RED API" network_policies: node_red_api: name: node_red_api endpoints: - host: xx.xx.xx.xx # 実際のIPアドレスを記載する port: 1880 protocol: rest enforcement: enforce rules: - allow: { method: GET, path: "/api/data" } binaries: - { path: /usr/bin/curl } - { path: /usr/local/bin/node }
Example conversation with an AI agent
The following example shows how to specify a command to access a REST API endpoint and ask an AI agent to guess what function generated the data. Due to the capabilities of the LLM used, the guess was not 100 percent accurate, but the data was read correctly. In this example, the command is specified via a prompt, but in Part 3, we will introduce how to make accessing the REST API endpoint a skill so that the AI agent can access it correctly without being prompted.
Inquiry
In Episode 2, we explained how to observe sine wave data transmitted via MQTT using NemoClaw.
In Episode 3, we will explain how to periodically acquire temperature, humidity, and pressure sensor data and utilize it with NemoClaw.