Multi-agent system

On this page 7

A multi-agent system is an architecture in which several autonomous agents, each with its own role, instructions, tools and context, interact to accomplish a goal that would be harder for a single agent. In the field of AI agents, the term usually describes systems built on large language models, where each agent is a model instance running its own loop of reasoning, tool calling and observation.

The concept predates modern language models: research on distributed artificial intelligence has studied cooperating and competing agents for decades. What changed is the agent itself. Today an agent can read documents, write code and call APIs, so the central engineering questions become how to divide work, how agents communicate and how to keep the whole system reliable when every component is probabilistic.

How a multi-agent system is organized

Every multi-agent system answers three design questions: who decides what happens next, how information moves between agents and when the work is finished. The answers define the topology, which has a larger effect on cost and reliability than the choice of model.

In the most common pattern, an orchestrator agent breaks a request into subtasks and delegates them to worker agents with narrow scopes, such as a researcher, a coder or a reviewer. Workers return results, and the orchestrator merges them, checks for gaps and either delegates again or produces the final answer. Each worker sees only the context it needs, which is one of the main benefits: a clean context window per subtask reduces distraction and token cost.

The table below summarizes the main topologies and when each is a reasonable choice.

TopologyControl flowGood fitMain risk
Orchestrator and workersCentral agent delegates and mergesResearch, coding, report writingOrchestrator becomes a bottleneck
Sequential pipelineFixed handoff from stage to stageExtraction, then drafting, then reviewErrors propagate downstream
Parallel fan-outMany agents run the same or split taskBroad search, voting, candidate generationHigh token cost
Peer conversationAgents message each other freelyDebate, negotiation, simulationLoops and drift without a stop rule
Hierarchical teamsSupervisors manage sub-orchestratorsLarge tasks with many subdomainsCoordination overhead grows quickly
Common multi-agent topologies

Communication, memory and shared state

Agents coordinate through messages, shared artifacts or a shared state store. Message passing is the simplest: one agent sends a task description and receives a result as text or structured JSON. A structured handoff format, with fields for goal, constraints, inputs and expected output, prevents the vague instructions that cause most delegation failures.

Agent memory works at two levels. Each agent keeps its own working context for the current subtask, while the system may maintain a shared scratchpad, file store or database where intermediate results persist. Shared state must be versioned or locked when several agents can write to it, or two workers may overwrite each other in the same way that concurrent threads corrupt unprotected data.

MechanismHow it worksAdvantageLimitation
Direct messagesAgent sends text or JSON to anotherSimple and traceableContext must be restated each time
Shared artifactsAgents read and write files or documentsLarge results move cheaplyConflicting edits
Blackboard storeCentral state that all agents observeLoose couplingNeeds locking and schema discipline
Tool protocols such as MCPStandard interface to tools and dataAgents share capabilitiesDoes not solve task coordination
Coordination mechanisms and their properties

Multi-agent systems compared with single agents

A single AI agent with good tools solves most tasks more cheaply than a team. Splitting work across agents pays off when the task is naturally parallel, needs very different expertise in separate steps, or exceeds one context window. It does not pay off when steps depend tightly on each other, because every handoff loses nuance.

CriterionSingle agentMulti-agent system
Token costLowerOften several times higher
LatencySequential stepsLower when work runs in parallel
Context per stepOne growing contextFocused context per agent
DebuggingOne trace to readMany interleaved traces
Failure modesTool errors, driftPlus miscommunication and loops
Best fitTightly coupled tasksDecomposable, broad or parallel tasks
Single agent versus multi-agent system

The broader label agentic AI covers both designs. Tool calling is the capability that makes either design useful, and a multi-agent system can even expose sub-agents to the orchestrator as tools, which keeps the control flow familiar while isolating each subtask.

Designing a reliable multi-agent system

Reliability comes from explicit contracts and hard limits, not from asking agents to behave well. The following decisions should be made before any prompt is written.

DecisionRecommended practiceReason
Role definitionOne clear responsibility per agentOverlapping roles cause duplicate work
Handoff formatStructured schema with required fieldsVague tasks produce vague results
TerminationStep, time and budget limitsPrevents endless conversations
VerificationSeparate reviewer or automated testsAgents rarely catch their own errors
PermissionsLeast privilege per agentLimits damage from a faulty step
ObservabilityTrace every message and tool callMakes failures reproducible
Design decisions and recommended practice

A practical rule is to start with one agent and split only where evidence shows a benefit, such as context overflow or a parallelizable search. Teams that begin with an elaborate hierarchy often discover that most of their agents only restate each other’s output.

Failure modes and risks

  • Error amplification. A wrong assumption early in a pipeline is accepted and elaborated by every later agent.
  • Conversation loops. Peer agents politely defer to each other or repeat the same exchange until a budget runs out.
  • Lost context in handoffs. The orchestrator knows a constraint that it never passes to the worker.
  • Cost explosion. Fan-out across many agents multiplies token usage, often by an order of magnitude.
  • Prompt injection spread. Malicious text read by one agent can travel as an instruction to others.

Security deserves special attention because agents trust messages from other agents more than they should. Treating every inter-agent message as untrusted data, and granting write or payment permissions only to tightly scoped agents, contains most of the risk.

The short version

A multi-agent system works like a small project team. One member plans the work and hands out tasks, others research, write or check, and the planner puts the pieces together at the end.

Each member focuses on one job, so the team can handle bigger problems than one person could. The cost is coordination: more members mean more messages, more chances for misunderstanding and a higher bill. Good teams keep roles clear and stop when the job is done.

Where it makes a difference

An analyst team needs a market overview of 30 competitors, covering pricing, features and recent product changes. A single agent working through all 30 fills its context window halfway through and starts confusing companies.

The team builds an orchestrator that assigns one research agent per competitor, each with web search and a fixed output schema of 12 fields. A reviewer agent checks every record for missing fields and contradictions, and the orchestrator compiles the table. The run uses more tokens than a single agent would, but it finishes in about a quarter of the time, and the error rate in the final table drops sharply because each research agent works with a clean, focused context.