Skip to main content

What are Devices?

Devices let your AI agent reach beyond the cloud and into the physical world. A device is any hardware — a barcode scanner, a temperature sensor, a kiosk display — that connects to your agent over the internet and exchanges commands and triggers in real time.

Think of it as:

A remote control for your agent to reach into the physical world — send commands to hardware, receive sensor data back, no middleware required
No compile or push needed. Devices are self-describing. When a device connects, it tells the agent what commands it supports. Those commands instantly become tools the agent can use. Disconnect the device and the tools disappear.

Why Devices?

Real-Time Bidirectional

Agent sends commands to devices. Devices fire triggers back to the agent. Both directions are instant over persistent connections.

No Middleware

Devices connect directly to the agent gateway. No cron jobs, no polling APIs, no message queues to maintain.

Self-Describing Commands

Devices declare their capabilities at connect time. The agent automatically gets tools for every command the device supports.

Runs on a Pico W

The MicroPython client fits on a Raspberry Pi Pico W with 264KB of RAM. Full MQTT support, command handling, and triggers.

Before and After

Device  -->  MQTT Broker  -->  Middleware API  -->  Cron Job  -->  Agent
                                    |
                               Database (polling)
                                    |
                               Dashboard (manual)
  • Multiple systems to maintain
  • Polling delays (seconds to minutes)
  • Custom glue code for every device type
  • Agent has no direct control

Supported Transports

TransportBest ForProtocolLibrary
Socket.IONode.js devices, desktops, serversWebSocket over HTTPS@lua-ai/device-client
MQTTMicrocontrollers, constrained devices, battery-powered sensorsMQTT 3.1.1 over TLS@lua-ai/device-client (Node) or lua_device.py (MicroPython)
Both transports support the full feature set: commands, triggers, heartbeats, reconnection, and CDN uploads.

What Can You Build?

Warehouse Monitoring

Barcode scanners, weight sensors, gate controllers. Agent manages inventory in real time.

Smart Office

Meeting room sensors, thermostats, desk occupancy. Agent acts as a facilities concierge.

Industrial IoT

Vibration sensors, temperature probes, emergency stop buttons. Agent monitors factory health on a Pico W.

Retail Kiosks

Receipt printers, NFC readers, display screens. Agent powers customer-facing interactions.

Agriculture

Soil moisture sensors, irrigation valves, weather stations. Agent optimizes crop management.

Your Hardware

Any device that runs Node.js or MicroPython. If it can open a socket, it can talk to your agent.

How It Works (30 Seconds)

1

Device connects

Your device opens a Socket.IO or MQTT connection to the Lua gateway and sends a list of commands it supports.
2

Agent gets tools

Each command becomes a tool the agent can call. The agent sees them just like any other skill tool.
3

Users talk to the agent

A user says “scan the next barcode”. The agent picks the right device tool and sends the command.
4

Device responds

The device executes the command and returns the result. The agent uses the result in its response to the user.
5

Device fires triggers

The device can also push events to the agent — “temperature exceeded 40C” — which run server-side logic.

Next Steps

5-Minute Quickstart

Connect your first device in under 5 minutes

Architecture

Understand the full command and trigger flow

Node.js Client

Complete reference for the Node.js device client

MicroPython Client

Run on a Raspberry Pi Pico W