Swarm
also known as Society of Mind, Peer Agents, Decentralised Multi-Agent
Run many peer agents that interact directly without a central supervisor, achieving emergent coordination.
This pattern helps complete certain larger patterns —
- specialisesDebate·— Have multiple agents argue different positions on a question and converge through structured exchange.
Context
A team is working on a task where many independent attempts or interactions matter more than a single coordinated plan — a negotiation simulation with many parties, a market simulation, an exploration of a large state space, a generative-agents experiment populating a small world. Centralised coordination would either bottleneck the system or impose a single policy on agents that need to behave differently from each other.
Problem
A central supervisor scales poorly to dozens or hundreds of agents: it becomes the bottleneck, and forcing every interaction through it removes the agent-to-agent dynamics that the task actually depends on. A negotiation in which every party speaks only through the chair is not a negotiation. At the same time, dropping the supervisor entirely raises new problems: how do agents find each other, how does the system terminate, and how does anyone debug emergent behaviour when nobody is in charge.
Forces
- Emergent behaviour can surprise designers; debugging is hard.
- Communication topology (broadcast? gossip? pub/sub?) is a design choice.
- Termination is non-trivial without a supervisor.
Example
A team simulates negotiation strategies among many parties; a centralised supervisor would bottleneck and would also impose a single policy on all parties. They run many peer agents on a shared message bus, each with its own goals and policies, no central coordinator, and environment-level termination conditions. Coordination emerges from interaction rather than instruction; the simulation produces patterns the team did not pre-script.
Diagram
Solution
Therefore:
Agents interact via a shared message bus, chat, or environment. Each agent has its own goals and policies. No central coordinator; convergence is emergent. Termination conditions are environment-level (time budget, consensus threshold, external trigger).
What this pattern forbids. Agents communicate only via the shared channel; out-of-band coordination is forbidden.
The smaller patterns that complete this one —
- generalisesDecentralized Swarm Handoff★— Agents in a swarm decide handoffs to peers based on a shared protocol with no central coordinator; specifically about agent-initiated handoff protocols, not topology.
- generalisesCellular-Automata Agents·— A swarm where each agent applies simple local rules to its immediate neighborhood; macro behavior emerges without a central orchestrator and without global information access.
And the patterns that stand alongside it, or against it —
- alternative-toSupervisor★★— Place a coordinating agent above a set of specialised agents and route work to them.
- complementsBlackboard·— Give multiple agents a shared, queryable workspace they can read from and write to as they collaborate.
- complementsGroup-Chat Manager★★— Place a dedicated manager between the participants of a multi-agent group chat that decides which participant speaks next on each turn.
Neighbourhood
Click any neighbour to follow the language. Scroll to zoom, drag to pan.