Glossary

Agent swarm

A group of AI agents that work on a problem as peers, coordinating through shared state rather than a central controller.

An agent swarm is a group of AI agents that work on a problem as peers, without a single agent in charge. Each agent follows its own instructions and reacts to what the others do, usually through a shared space where they post and read findings, and the overall result emerges from those interactions. The idea borrows from swarm intelligence in nature, where ants or bees solve problems collectively that no individual could plan alone.

What “swarm” means in practice

The term is used in three overlapping ways, and it helps to know which one someone means.

The strict meaning is a decentralised multi-agent system. There is no supervisor agent deciding who acts next. Agents choose their own next step based on the shared state, and coordination comes from rules each agent follows, such as “claim a task before working on it” or “check whether an idea is already on the board before adding it”.

A looser meaning is simply many agents running in parallel on the same problem, often with a selection step at the end. Ten agents each try to fix a failing test, and the first patch that passes is kept. There may be a coordinator, but the emphasis is on breadth rather than structure.

The third meaning is a name. OpenAI released an experimental library called Swarm in 2024 for building lightweight agent systems around agent handoffs, and its ideas later shaped the OpenAI Agents SDK. Despite the name, that library is mostly about passing control between agents rather than peer coordination. The LangGraph vs OpenAI Agents SDK comparison covers the SDK in more detail.

How agents in a swarm coordinate

Without a central controller, agents need some other way to avoid duplicating work and to build on each other’s results. Four mechanisms come up most often.

Mechanism

How it works

Example

Shared blackboard

Agents post findings, tasks and status to a common store and read it before acting

Research agents adding sources and claims to one workspace

Message passing

Agents send messages to some or all peers

Agents announcing “I am testing hypothesis B” to avoid overlap

Debate or voting

Agents propose answers, critique each other and converge

Several agents argue a question and a vote picks the answer

Stigmergy

Agents leave traces in the environment that steer others

Tagging a file “reviewed” so other agents skip it

The blackboard is the most common in LLM systems, because it fits how agents already work: read context, act, write results. It also gives you a record of everything the swarm did, which helps a great deal when you need to understand an outcome afterwards. Debate-style setups, where several model instances argue and then agree, are a lighter form of swarm that some research has used to improve reasoning on hard questions, and they overlap with self-correction and LLM as a judge.

Generative agent simulations sit at the far end of the spectrum. In the generative agents work from Stanford and Google researchers, a small town of agents with their own memories and plans produced social behaviour, such as organising a party, that no one scripted. Those agents relied on memory and reflection to stay coherent over time, which is a reminder that swarms depend on persistent state as much as on clever prompts.

When a swarm makes sense

Swarms suit problems where the space of possible answers is large and the best path is not known in advance. Exploration is the clearest case: generating and testing many hypotheses, searching a large corpus from many angles, brainstorming product ideas or red-teaming a system by having many agents look for weaknesses independently. Each agent covers different ground, and the shared board lets the group notice when two lines of inquiry meet.

They also suit tasks where redundancy is the point. Running several agents on the same problem and keeping the best answer, or the one most agents agree on, trades cost for reliability. This is common in coding, where a test suite can pick the winner automatically.

For tasks with a clear sequence and a known division of labour, a swarm is usually the wrong tool. A hierarchical or supervisor design gives you predictable steps, easier guardrails and lower cost. The single-agent vs multi-agent entry covers the earlier question of whether you need several agents at all.

Trade-offs

Swarms are the least predictable multi-agent pattern. With no controller, the same input can produce different paths and different results on each run. That is useful for exploration and awkward for anything that needs repeatable output.

Cost grows quickly. Every agent reads the shared state and calls the model on every step, so a swarm of ten agents can use ten times the tokens of one agent, more if they also read each other’s messages. Keeping the shared state compact and searchable, rather than having every agent read all of it, matters more than in any other pattern.

Duplication and conflict are the common failure modes. Two agents pursue the same lead because neither saw the other’s claim in time, or they write contradictory conclusions to the same document. Claiming rules, deduplication of findings by meaning rather than exact text, and clear ownership of each write all help.

Termination needs deliberate design. A swarm with no stopping rule keeps exploring. Typical rules are a budget of steps or tokens, a deadline, convergence (no new findings for a set number of rounds) or a quorum of agents agreeing on an answer.

Shared state also spreads mistakes and attacks. If one agent reads a document containing hidden instructions and posts a finding shaped by them, every other agent that reads the board inherits the problem. This is indirect prompt injection with a multiplier, and the same risk applies to long-lived stores as memory poisoning. Treating posts from other agents as untrusted input, keeping sources attached to every claim so a person can check them, and limiting which agents can write to shared areas all reduce the blast radius. The agents need an audit trail post makes the case for recording who wrote what.

Finally, swarms are hard to evaluate and debug. Agent observability that records each agent’s reads and writes against the shared state, and agent evaluation that looks at the final board as well as the final answer, are what make a swarm something you can improve.

A worked example

A product team wants to understand why customers cancel. It has two years of support tickets, call transcripts and cancellation survey responses, several thousand documents in all.

Eight agents start with the same goal and a shared workspace. Each picks an angle from a short seed list, such as pricing, onboarding, missing features or reliability, and records its claim on the board so others choose differently. As each agent reads, it posts findings as short notes, each with the source document and a quote. Before posting, it searches the board for similar findings; if one exists, it adds its evidence to that note instead of creating a duplicate.

Partway through, two agents notice that onboarding complaints and missing-feature complaints often come from the same customer segment. One posts a new note linking the two themes, and three other agents shift to that intersection. After a set number of rounds with no new themes, the swarm stops. A final agent reads the board, which by now holds a few dozen well-supported findings rather than thousands of raw documents, and writes a ranked summary with evidence for each point.

The same shape suits research agents and competitive intelligence work, where the useful questions are not known at the start.

Where Exabase fits

Exabase does not run the swarm; your framework or your own loop does that. Exabase works well as the swarm’s shared blackboard and long-term memory, which is the part of the pattern most teams end up building by hand.

A Base gives the swarm one isolated workspace. Agents post findings as notes and save sources as files or bookmarks through Resources (creating resources), and use folders and tags to mark status, such as claimed, in progress or done, which is stigmergy in its simplest form. Because everything is indexed as it is written, an agent can use Deep Search to check whether a similar finding already exists before adding its own, which handles the deduplication problem by meaning rather than exact text, a form of semantic search. Each result comes with a page number or timestamp, so evidence stays attached to claims.

Exabase Memory can hold what should persist beyond one run: which themes were found last quarter, which sources proved unreliable, which questions the team cares about. Memory resolves contradictions as these facts change, so a new swarm starts from current knowledge rather than a stale summary.

Between runs, an Exabase Worker can tidy the board on a schedule, tagging untagged notes, moving finished items into an archive folder and flagging stale findings, using its built-in tools (worker tools). This is the same upkeep described in the knowledge base solution. With many agents writing at once, turning on snapshots lets you see what any run moved, renamed or deleted and recover it, as covered in agent undo.

Frequently asked questions

What is the difference between an agent swarm and a multi-agent system?

A multi-agent system is any system with more than one agent. An agent swarm is a specific kind in which agents coordinate as peers without a central controller, and the result emerges from their interactions.

Is OpenAI Swarm an agent swarm?

Only in name. OpenAI’s experimental Swarm library is a lightweight framework for passing control between agents through handoffs. It does not implement decentralised peer coordination, and its ideas were carried into the OpenAI Agents SDK.

How do agents in a swarm avoid doing the same work?

Through shared state and simple rules. Agents claim tasks on a shared board before starting, check for existing findings before adding new ones and mark items as done. Searching the board by meaning catches duplicates that use different wording.

When should I not use a swarm?

Avoid swarms for tasks with a known sequence, strict requirements for repeatable output or tight cost limits. A single agent or a supervisor design is cheaper, more predictable and easier to debug.

How does a swarm know when to stop?

You give it a rule: a budget of steps or tokens, a deadline, a quorum of agents agreeing, or a set number of rounds without new findings. Without one, a swarm can keep exploring indefinitely.

Do swarms need memory?

They need shared state to coordinate within a run, and they benefit from memory across runs so each new swarm starts from what earlier ones learned. A searchable shared workspace and a memory layer cover both.

Are agent swarms more accurate than single agents?

Sometimes, on exploratory or open-ended tasks where breadth helps, and when several attempts are combined by voting or testing. On straightforward tasks they mostly add cost. Measure on your own task before committing to the pattern.

Related pages: Multi-agent, Hierarchical agents, Supervisor agent, Subagents, Orchestration, Generative agents, Multi-agent coordination use case, Best AI agent frameworks, The agent stack in 2027, Knowledge base solution.

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.