Agent Coordination at Scale
Real-time agent-to-agent communication, shared memory, and event-driven coordination powered by NATS JetStream. Build agent teams that collaborate reliably.
What is Forge Mesh?
Forge Mesh is the communication layer that connects agents to each other. When you build multi-agent systems, agents need to send tasks, share results, access common memory, and react to events. Mesh provides all of this as infrastructure you do not have to build or manage.
Under the hood, Mesh runs on NATS JetStream -- a high-performance messaging system with durable streams, exactly-once delivery, and built-in key-value stores. Agents communicate through structured messages on topic hierarchies, with circuit breakers protecting against cascading failures and per-agent permission scopes enforced by SpiceDB.
Core Capabilities
Everything agents need to communicate, coordinate, and collaborate within a shared execution environment.
NATS JetStream Backbone
All agent-to-agent communication runs on NATS JetStream. Messages are durable, ordered, and replay-able. Agents subscribe to topic hierarchies, enabling precise routing of tasks without polling or shared queues.
Delegation Patterns
Agents delegate work to each other through structured task messages. A Prime agent can fan out sub-tasks to specialists, wait for results, and synthesize responses -- all asynchronously via the mesh.
Shared Memory Access
Agents in the same mesh can read and write to shared memory scopes. Vector memory, graph memory, and state CRDTs are all accessible through the mesh API, with conflict resolution handled automatically via last-writer-wins registers and OR-Sets.
Event-Driven Messaging
Agents react to events in real time. When one agent completes a task, updates a record, or detects an anomaly, other agents subscribed to that event topic receive the notification instantly and can act on it.
Circuit Breaker Patterns
If an agent starts failing or exceeding cost budgets, the mesh automatically trips a circuit breaker. The failing agent is isolated, requests are rerouted to fallbacks, and the circuit re-closes once the agent recovers.
Per-Agent Permission Scoping
Every agent in the mesh operates under its own SpiceDB permission scope. An agent can only subscribe to topics, access memory, and invoke tools that its permission set allows. Escalation requires explicit grants.
Messaging Patterns
Mesh supports multiple messaging patterns out of the box. Combine them to model any agent collaboration topology.
Request-Reply
Agent A sends a task to Agent B and waits for a response. The mesh handles timeouts, retries, and dead-letter routing if Agent B is unavailable.
Publish-Subscribe
An agent publishes an event to a topic. All agents subscribed to that topic receive the event. Ideal for broadcasting status updates, alerts, or completed work notifications.
Queue Groups
Multiple instances of the same agent subscribe to a topic as a queue group. The mesh delivers each message to exactly one instance, enabling horizontal scaling of agent workers.
Fan-Out / Fan-In
A coordinator agent fans out sub-tasks to multiple specialists simultaneously, collects their responses, and merges results. The mesh tracks completion and handles partial failures.
Built-In Resilience
Agent systems fail. The mesh is designed to handle failures gracefully, ensuring that no messages are lost and work continues even when individual agents go down.
Automatic Retries
Failed messages are retried with exponential backoff. After max retries, messages move to a dead-letter stream for manual inspection or automated recovery.
Timeout Enforcement
Every request-reply interaction has a configurable timeout. If an agent does not respond within the window, the mesh triggers fallback logic and logs the timeout for observability.
Health Monitoring
The mesh continuously monitors agent heartbeats. Agents that stop sending heartbeats are marked unhealthy, removed from queue groups, and their in-flight tasks are reassigned.
State Recovery
When an agent restarts, it replays its JetStream consumer from the last acknowledged position. No messages are lost, and the agent resumes exactly where it left off.
Connect Your Agents
Learn how to wire agents together with Forge Mesh. The documentation covers messaging patterns, shared memory, circuit breakers, and production best practices.