concept
Agent Swarms
Agent Swarms
Multiple focused reactive-agents sharing one AgenticEnvironment, collaborating concurrently without a central controller. A typical shape: a planner, several executors, a reviewer, and one or more observers — all join()-ing the same environment and reacting to each other’s events.
Defining Property: No Orchestrator
The distinction from most “multi-agent” systems is the absence of a supervisor or routing graph. Coordination is emergent: each agent reacts to the events it cares about, and the collective behavior arises from those reactions. The practical payoff:
“Adding a new role to a swarm doesn’t mean editing a central controller. It means writing one more reactive agent and joining it to the environment.”
Swarm vs. Supervisor vs. Graph
| Model | Coordination | Example |
|---|---|---|
| Swarm (this) | Emergent; participants react to a shared event bus | mozaik / baro |
| Supervisor | One agent delegates to subagents as tools | langgraph-multi-agent-patterns §subagents |
| Graph / handoff | Explicit edges + Command routing between nodes | langgraph-multi-agent-patterns §handoffs |
Swarms maximize composability and concurrency; supervisor/graph models maximize predictability and explicit control flow. See ai-agent-architectures for the full spectrum and when each fits.
Why Observers Matter
Because every participant sees the shared stream (see streaming-as-runtime), non-acting roles are first-class: an auditor or safety reviewer just listens to peers’ onExternal* events and can intercept. This makes cross-cutting concerns (logging, policy, hand-off triggers) composable members of the swarm rather than wrapper code.
Production Example: Baro
baro (baro.rs) runs ~10 specialized participants — planner, executors, reviewer, fixer, librarian, auditor, … — in one environment to orchestrate coding work as a collaborating team.
Caveats
Controller-free concurrency is harder to reason about than a graph: termination, ordering, and “who will respond to this event” are emergent rather than declared. Debugging means tracing event cascades. For strictly linear pipelines, an explicit graph is usually clearer; swarms win when roles are many, concurrency is real, and live observation matters.
Related
- reactive-agents — the unit a swarm is made of
- streaming-as-runtime — the shared event substrate
- mozaik — framework · baro — production swarm
- langgraph-multi-agent-patterns — orchestrated multi-agent counterpoint
- multi-agent-finance-workflows — preset multi-agent shapes (orchestrated, finance domain)
- ai-agent-architectures — decision framework across all of these