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
- Before: Traditional IoT
- After: Lua Device Gateway
- Multiple systems to maintain
- Polling delays (seconds to minutes)
- Custom glue code for every device type
- Agent has no direct control
Supported Transports
| Transport | Best For | Protocol | Library |
|---|---|---|---|
| Socket.IO | Node.js devices, desktops, servers | WebSocket over HTTPS | @lua-ai/device-client |
| MQTT | Microcontrollers, constrained devices, battery-powered sensors | MQTT 3.1.1 over TLS | @lua-ai/device-client (Node) or lua_device.py (MicroPython) |
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)
Device connects
Your device opens a Socket.IO or MQTT connection to the Lua gateway and sends a list of commands it supports.
Agent gets tools
Each command becomes a tool the agent can call. The agent sees them just like any other skill tool.
Users talk to the agent
A user says “scan the next barcode”. The agent picks the right device tool and sends the command.
Device responds
The device executes the command and returns the result. The agent uses the result in its response to the user.
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

