Multi-Agent Systems
Gen AI · AI Agents & Tool Use
Theory
A multi-agent system splits a complex task across several specialised agents that each handle one part and pass work between them, instead of one agent doing everything in a single long loop. A common pattern mirrors a team: a planner breaks the goal into sub-tasks, a researcher gathers information, a writer or coder produces the work, and a reviewer checks it before it is final. Each agent can have its own prompt, tools and even its own model.
Specialisation and built-in review can improve quality on genuinely complex tasks and keep each agent's context focused. The costs are real: more model calls, more latency, more places for errors, and agents that misunderstand each other's output. Start with one well-designed agent and add more only when a clear role split measurably helps.
Why we use it
Long, mixed tasks overload a single agent's context and instructions. Separate roles keep each prompt focused, allow different tools per role and add a reviewer step that catches mistakes.
When to use it
Use it for large tasks with clearly separable roles, such as research, then writing, then review. For simpler tasks, one agent with good tools is cheaper, faster and easier to debug.
How it works
- Complex goal arrives
- Planner agent splits it into sub-tasks
- Worker agents handle their sub-tasks with their own tools
- Reviewer agent checks the combined output
- Does the output pass review? Yes: Return the final result. No: Send specific feedback back to the worker agents.
- Deliver the reviewed result
Example
Task: "Write and test a Python function to validate emails."
Planner agent: breaks task into "write function" + "write tests" + "review code"
Coder agent: writes the validate_email() function
Tester agent: writes pytest cases and runs them
Reviewer agent: checks code style and test coverage, requests one fix
→ Final reviewed, tested function returned to the user.Key points
- Roles can mirror a real team: planner, researcher, writer, reviewer
- Each agent can have its own prompt, tools and model
- Adds coordination overhead and cost: not always better than one agent
- Pass structured hand-offs between agents to reduce misunderstandings
- Start with one agent; split roles only when it measurably helps