Rela AIRela AI Docs
Tools

External Connections

External connection tools allow the agent to communicate with systems outside Rela AI: other systems' APIs, IoT devices via MQTT, and industrial machinery via OPC UA.

External Connections

The data the agent needs is not always stored in Rela AI collections. Sometimes it lives in the company's ERP, in a process history server, in the MQTT broker of field sensors, or directly in the compressor's PLC. External connection tools are the channel that allows the agent to query and act on those systems without intermediaries.

What is it for?

In an industrial plant, data is distributed across multiple systems: SCADA holds real-time readings, the ERP holds purchase orders and inventory, the OPC UA server holds PLC states. External connections allow the agent to access all those systems from a single conversation — without the technician having to jump from screen to screen searching for information.

External connections allow the agent to:

  • Query data from external systems in real time during a conversation
  • Read values directly from PLCs and industrial machinery via OPC UA
  • Publish commands to IoT devices via MQTT
  • Integrate with ERP systems, external CMMS platforms, or supplier APIs
  • Receive data from industrial gateways such as HMS Anybus, Siemens IOT2050, Moxa, or Advantech

How does it work?

There are three connection types available depending on the protocol of the external system:

TypeProtocolFor which systems
HTTPREST API (GET, POST, PUT, DELETE)ERPs, external CMMS, supplier APIs, web servers
MQTTIoT messagingSensor brokers, IoT devices, industrial gateways
OPC UAStandard industrial protocolPLCs, SCADA, DCS, machinery with an OPC UA server

The agent calls the tool when needed, the system makes the connection in real time, and returns the result to the agent to incorporate into its response.

How to use it?

Create an HTTP connection (REST API)

To connect to any system that has a web API:

  1. Go to Tools and create a new tool of type External connection.
  2. Select HTTP protocol.
  3. Configure:
FieldDescriptionExample
Endpoint URLThe address of the external servicehttps://erp.company.com/api/inventory
MethodType of operationGET to query, POST to create
HeadersAuthorization headersAuthorization: Bearer your-api-key
TimeoutMaximum wait time30 seconds
  1. Add parameters the agent will collect from the user (part code, equipment name, etc.).
  2. Save and assign to the agent.

Create an MQTT connection

To send commands to or retrieve data from IoT devices:

  1. Create a tool of type External connection, protocol MQTT.
  2. Configure:
FieldDescriptionExample
Broker URLAddress of the MQTT brokermqtt://192.168.1.100:1883
TopicThe topic to publish to or subscribe fromplant/compressors/C-01/control
QoSQuality of service (0=no guarantee, 1=at least once, 2=exactly once)1 for important commands
Username / PasswordBroker credentials (if required)

Create an OPC UA connection

To read or write values directly to PLCs and industrial machinery:

  1. Create a tool of type External connection, protocol OPC UA.
  2. Configure:
FieldDescriptionExample
Server URLAddress of the OPC UA serveropc.tcp://192.168.1.10:4840
Node IDIdentifier of the data to read/writens=2;s=Temperature_Compressor_C01
OperationRead value, Write value, or Call methodRead value

The three available OPC UA operations:

OperationWhen to use it
Read valueCheck the current state of a sensor or PLC variable
Write valueChange an equipment parameter (setpoint, speed, etc.)
Call methodExecute a server function (start, stop, reset)

Write and call method operations in OPC UA modify machinery behavior. Use them only with agents whose prompt includes appropriate safety restrictions and requires explicit operator confirmation before executing.

Compatible industrial gateways

Gateways that convert legacy industrial protocols (Modbus, Profibus, EtherNet/IP) to protocols natively supported by Rela AI:

GatewayExposed protocolHow to connect
HMS Anybus (Modbus→HTTP)HTTP POSTConfigure the gateway URL as the HTTP endpoint
Siemens IOT2050MQTTConnect to the gateway's MQTT broker
Moxa ioLogikHTTP GETUse the device's REST API
Advantech WISEHTTP RESTUse the gateway's REST API endpoints

Test the connection before assigning to the agent

Before assigning the tool to the agent, verify it works:

  1. In the tool configuration screen, click Test connection.
  2. Enter the parameter values for the test.
  3. The system runs the actual connection and shows: whether it succeeded, the response time, and the data received.
  4. If there is an error, it displays the external system's message for diagnosis.

Testing before activating prevents the agent from returning confusing error messages when technicians use it in production.

Key benefits

  • The agent accesses real-time data from any plant system
  • Three protocols that cover virtually all existing industrial infrastructure
  • Direct OPC UA reads from the PLC without manually exporting data
  • Integration with industrial gateways already installed in the plant
  • Built-in connection test in the configuration to validate before going live
  • The agent can combine data from multiple external connections in a single response

Common use cases

Scenario 1: Agent querying the ERP for parts The technician asks the agent: "How many units of the Baldwin B7144 filter are in the warehouse?" The agent calls the HTTP tool pointing to the ERP API with the part code. The ERP responds: 8 units in the central warehouse, 2 in the north plant warehouse. The agent replies directly to the technician with those quantities and locations, without the technician having to log into the ERP.

Scenario 2: Agent reading real-time temperature from the PLC The supervisor asks the agent: "What is the current temperature of compressor C-01?" The agent calls the OPC UA tool configured with the compressor's temperature node. It reads the value directly from the PLC: 68.4°C. It compares against the asset's baseline and responds: "Current temperature of C-01: 68.4°C. It is within the normal range (baseline 65°C ± 5°C)."

Scenario 3: Agent publishing a restart command via MQTT The operator tells the agent: "I need to restart dosing pump B-09." The agent recognizes that this action requires explicit confirmation (per its security prompt) and asks: "Do you confirm you want to restart pump B-09? This action will stop dosing for approximately 30 seconds." The operator confirms. The agent publishes the command to the corresponding MQTT topic. The pump receives the command, executes the restart, and the agent confirms: "Restart command sent to B-09. The equipment should be operational within 30 seconds."

On this page