Topic-Based Routing
Route inter-agent messages through named topics that agents subscribe to, instead of having senders address each other by id.
Problem
Direct agent-to-agent addressing, where a sender names each receiver explicitly, creates a dense web of dependencies in which every sender carries knowledge about every receiver it might want to reach. Adding a new participant then requires editing every sender that should be able to reach it, and removing one leaves dangling references everywhere. The team needs a routing mechanism where senders publish to named topics and interested agents subscribe to those topics, so that sender and receiver are decoupled and the wiring can change without touching either end.
Solution
Define a small set of typed Topics (`telemetry.parsed`, `incident.opened`, `plan.proposed`). Agents publish to topics; agents that care subscribe to topics. The runtime fans messages out to all subscribers of a topic, applies back-pressure on slow consumers, and provides delivery guarantees appropriate to the topic class. Pair with actor-model-agents to keep each subscriber's processing isolated, and with event-driven-agent when the topic carries external events. Topic schemas are first-class artefacts; subscribers depend on the schema, not on the publisher.
When to use
- Sender should not know which agents care about a message.
- Subscribers join and leave over time without sender-side changes.
- Cross-cutting concerns (audit, observability) need to attach by adding a subscriber.
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.