« All posts

BrAIn: Reactive AI Agent Nodes on a NATS Bus

BrAIn replaces the chat-loop agent model with reactive, long-lived nodes on a NATS pub/sub bus. ROS-like architecture, token-efficient design, and distributed execution for LLM agents.

BrAIn proposes an alternative to the chat-loop-centric agent frameworks: long-lived daemon nodes communicating over a NATS pub/sub bus, architecturally closer to ROS 2 than to conversational AI stacks. Each node subscribes to specific topics and only invokes an LLM when a relevant message arrives, avoiding the token cost of idle polling or scheduled cron calls. Nodes can ship their own UI, run on remote machines joined to the same bus, and be preempted mid-execution when a higher-criticality message arrives, resuming with fresh context.

The project is demonstrated through concrete use cases: an ambient agent that fuses voice, gaze, and intent detection to respond only when someone is speaking directly to the camera; a mobile integration where phone sensors act as bus nodes; external channel bridges like Telegram; and a live dashboard visualizing the node graph and message flow. The author compares BrAIn against LangGraph, AutoGen, ROS 2, Temporal, and n8n, positioning it not as a replacement but as suited to event-driven, many-to-many agent architectures those tools don't directly address.

For engineers, BrAIn offers a concrete, open implementation of the idea that agent systems could be built as observable, distributed, priority-aware node networks rather than a single chat interface. Features like an MCP client, causal trace replay, and criticality-based preemption provide practical technical reference points for anyone designing production-grade autonomous agent infrastructure.

This synthesis was produced from its source by AI; there is no human editor or manual review step. How we work