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

  1. Complex goal arrives
  2. Planner agent splits it into sub-tasks
  3. Worker agents handle their sub-tasks with their own tools
  4. Reviewer agent checks the combined output
  5. Does the output pass review? Yes: Return the final result. No: Send specific feedback back to the worker agents.
  6. 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

Gen AI topics

Foundations of Generative AI

Prompt Engineering

Retrieval & Embeddings

Customizing Model Behavior

AI Agents & Tool Use

Multimodal & Applied AI

Ethics, Cost & Careers

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Generative AI for the Data Stack

LLMs, prompt engineering, RAG, embeddings, agents and the tools shaping modern AI products — explained practically. Click any topic in the sidebar to open it right here.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Section {{ sec.num }}

{{ sec.label }}

Gen AI  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

💡

{{ current.tldr }}

Explained

{{ para }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
See It In Action
{{ current.example }}
Key Takeaways — click to check off
{{ pt.mark }} {{ pt.text }}

Share this topic