Designing a Message Bus for AI Agents — Lightweight Communication for 20+ Autonomous Agents
How do 20+ AI agents talk to each other? A lightweight message bus design and lessons from real-world operation. The Problem: How Do Agents Communicate? When you have a single AI assistant, communi...

Source: DEV Community
How do 20+ AI agents talk to each other? A lightweight message bus design and lessons from real-world operation. The Problem: How Do Agents Communicate? When you have a single AI assistant, communication isn't a problem. But when you scale to 10+ agents distributed across multiple servers, a fundamental challenge emerges: how do agents communicate with each other? Our environment runs 20+ agents spread across 9 nodes, each responsible for different domains. They frequently need to: Delegate tasks: A manager agent assigns sub-tasks to specialist agents Sync state: An agent notifies others after completing a task Request information: Agent A queries knowledge held by Agent B Broadcast: System-wide announcements Why Not Use an Off-the-Shelf Message Queue? RabbitMQ, Redis Pub/Sub, or NATS would be overkill. AI agent communication characteristics: Low message frequency (tens to hundreds per day) Small message bodies (text instructions) Inbox semantics required (messages persist while agent