concept

Agent Swarms

created 2026-05-28 ai · agents · swarms · multi-agent · reactive · architecture · mozaik

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

ModelCoordinationExample
Swarm (this)Emergent; participants react to a shared event busmozaik / baro
SupervisorOne agent delegates to subagents as toolslanggraph-multi-agent-patterns §subagents
Graph / handoffExplicit edges + Command routing between nodeslanggraph-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.