Multi-Agent Systems: AI Teams That Work Together
One AI agent has limits; a team of specialists can tackle far more. Learn how multi-agent systems work — specialized roles, orchestration patterns and a critique loop — with a diagram and a runnable researcher-writer-critic demo.
In Lesson 23 you met a single AI agent — one LLM with tools and a loop. It's powerful, but for big, messy tasks a lone agent gets overwhelmed, loses track, or tries to be a jack-of-all-trades. The fix mirrors how humans handle complex work: build a team. Multi-agent systems use several specialized agents that collaborate — each expert at one job — to accomplish far more than any single agent could alone. This is one of the most active frontiers in applied AI right now.
Why one agent isn't enough
Ask a single agent to "research this topic, write a detailed report, and fact-check it," and it juggles three very different jobs in one context — quality slips and it forgets earlier steps. Splitting the work lets each agent stay focused, keep a cleaner context, and do its one job well. Same reason companies have separate researchers, writers and editors.
Specialized agents: division of labour
Each agent gets a narrow role, its own instructions, and sometimes its own tools. A classic content-writing team might be:
- Researcher — gathers facts (has a search/RAG tool).
- Writer — turns research into a draft.
- Critic/Reviewer — checks quality and sends it back for fixes.
Because each has a single, clear job, each performs better than one agent wearing all three hats.
Orchestration patterns
How do the agents coordinate? A few common patterns:
- Manager / orchestrator: a lead agent breaks the goal into subtasks and delegates to specialists.
- Sequential pipeline: output flows from one agent to the next (research → write → review).
- Debate / critique loop: agents review and improve each other's work over rounds.
How agents communicate
Agents coordinate by passing messages — one agent's output becomes the next's input (a handoff) — and often through a shared memory or scratchpad they can all read and write, so the team keeps a common picture of progress. Clear handoffs and shared state are what keep a team from descending into chaos.
See a multi-agent workflow in code (runnable)
Here's the researcher → writer → critic pipeline with a revision loop. The "agents" are simple functions here (a real system swaps each for an LLM call), but the orchestration is exactly the real pattern.
# Each agent = a role. Real version: each calls an LLM.
def researcher(topic):
return [f"fact about {topic}", f"another point on {topic}"]
def writer(facts, feedback=""):
draft = "Draft: " + "; ".join(facts)
if feedback:
draft += f" (revised for: {feedback})"
return draft
def critic(draft):
# Approve only once the draft has been revised
if "revised" in draft:
return {"ok": True, "feedback": ""}
return {"ok": False, "feedback": "add more detail"}
# Orchestrator: run the team with a critique loop
def run_team(topic, max_rounds=3):
facts = researcher(topic) # 1. research
draft, feedback = writer(facts), ""
for round in range(max_rounds):
review = critic(draft) # 2. review
print(f"Round {round+1}: approved={review['ok']}")
if review["ok"]:
return draft
draft = writer(facts, review["feedback"]) # 3. revise
return draft
print(run_team("neural networks"))
Run it: the critic rejects the first draft, the writer revises, and the second passes — a tiny but complete multi-agent loop.
Frameworks that do the plumbing
You rarely wire all this by hand. Libraries handle roles, messaging and orchestration for you — you'll hear names like LangGraph, CrewAI and AutoGen. They let you define agents and how they connect, and manage the loop, memory and handoffs.
Where multi-agent systems shine
- Coding teams: a planner, a coder and a tester agent building software together.
- Research pipelines: search, read, synthesise and write a report across agents.
- Complex workflows: customer requests routed through specialist agents (billing, tech, escalation).
The challenges
- Cost & latency: many agents = many LLM calls = more money and time (next lesson's topic).
- Error compounding: one agent's mistake can cascade through the team.
- Coordination & loops: poorly designed teams argue in circles or get stuck — cap the rounds.
- Harder to evaluate & secure: more moving parts (recall Lesson 32 and Lesson 33).
The honest takeaway: multi-agent systems are powerful but add real complexity. Reach for them when a task genuinely needs distinct skills — not just because they're exciting.
The core idea: break a hard problem into roles, give each role its own focused agent, and orchestrate the hand-offs — an AI team, working like a human one.
The first time I split a stubborn task into a "writer" and a separate "critic" agent, the jump in quality genuinely surprised me — the same model that produced mediocre one-shot output became sharp once one agent's only job was to critique the other's. That's when division of labour stopped being theory for me. My tip: start with just two roles (a doer and a reviewer) before building elaborate teams — you get most of the benefit with far less complexity.
Key takeaways
- Multi-agent systems use several specialized agents collaborating on a task.
- Splitting work into focused roles (e.g. researcher, writer, critic) beats one do-everything agent.
- Common patterns: orchestrator/manager, sequential pipeline, and critique loops.
- Agents coordinate via handoffs and shared memory; frameworks (LangGraph, CrewAI, AutoGen) handle the plumbing.
- Watch the trade-offs: cost, latency, error compounding and coordination — use a team only when the task needs it.
Continue the series: ← Lesson 34: Multimodal AI · Next: Lesson 36 — Making AI Faster and Cheaper: Cost & Latency Optimization →
Frequently Asked Questions
What is a multi-agent system in AI?
A multi-agent system uses several specialized AI agents that collaborate to complete a task, instead of relying on one agent to do everything. Each agent has a focused role — for example a researcher, a writer and a critic — and they coordinate to achieve more than a single agent could alone.
Why use multiple agents instead of one?
Complex tasks that mix very different jobs overwhelm a single agent, which loses focus and quality. Giving each agent one clear role keeps its context clean and its performance high, much like a company using separate researchers, writers and editors.
What are common multi-agent orchestration patterns?
Three common patterns are a manager or orchestrator agent that delegates subtasks to specialists, a sequential pipeline where each agent's output feeds the next, and a debate or critique loop where agents review and improve each other's work over several rounds.
What frameworks are used to build multi-agent systems?
Popular frameworks include LangGraph, CrewAI and AutoGen. They handle the plumbing of defining agent roles, passing messages, managing shared memory and running the orchestration loop, so you can focus on the design rather than the low-level coordination.