Module 10

Multi-agent systems and orchestration


It is the most advanced level: several specialised agents working together instead of a single one doing everything.

Reading time: 2 min

Orchestrator and supervisor

In a multi-agent system, several specialised agents work together on a task. In the orchestrator (or supervisor) pattern, a central agent receives the request, distributes it among specialist agents (one for triage, one for drafting, one for notifications), gathers their results and decides the next step.

The advantage is separation of concerns: each agent has a short prompt, few tools and a clear goal, and it can be tested and improved on its own. The cost is more calls, more latency and more points where information can get lost as it passes from one agent to another. When the order of steps is always the same, a simpler alternative is a fixed sequence of agents, like an assembly line.

A2A (Agent-to-Agent)

A2A (Agent-to-Agent) is an open protocol that lets agents from different systems, built with different tools and owned by different parties, discover each other and delegate tasks. Each agent publishes a description of what it can do, and the others can send it tasks and receive the results.

It complements MCP: MCP connects an agent to tools and data, and A2A connects agents to other agents. It makes sense when collaboration crosses organisational or platform boundaries; within a single application, agents can be coordinated directly in code, with no protocol at all.

Frameworks: LangGraph, CrewAI and n8n

Orchestration frameworks handle the plumbing of multi-agent systems: shared state, message passing, retries, persistence and visualising the flow. LangGraph models the system as a state graph with fine-grained control over each transition; CrewAI is organised around roles and tasks, with a more declarative approach; and n8n is a visual automation tool with AI nodes, useful for connecting agents to external services with little code.

A framework speeds up prototyping but adds a layer of abstraction you need to understand when something breaks. For small systems, a hand-written orchestrator using your provider's SDK is often clearer and easier to debug. Choose a framework when the complexity of coordination justifies it, not as a starting point.

Test yourself on this module

Copy this prompt and paste it into your AI (ChatGPT, Claude, Gemini…). It will give you a 20-question multiple-choice test on the module's concepts and then suggest a hands-on exercise.

Act as the examiner for Dani Pérez's "AI Engineering Guide". Examine me on the module "Multi-agent systems and orchestration" (https://daniperez.pro/en/resources/ai-engineering-guide/multi-agent-orchestration).

Concepts covered by the exam:
- Orchestrator and supervisor
- A2A (Agent-to-Agent)
- Frameworks: LangGraph, CrewAI and n8n

Exam:
1. 20 multiple-choice questions, each with 4 options (a, b, c, d) and a single correct answer.
2. Ask about understanding and judgement (what each thing is for and when NOT to use it), not about memorising definitions.
3. Spread the position of the correct answer evenly across a, b, c and d.
4. Ask me the questions in 4 rounds of 5. Don't give any example answer (like "1a 2b 3c 4d 5a"): I already know to answer with the letters. Don't tell me whether I got them right until I have answered all 20.
5. At the end, mark them all: for each question, my answer, the correct one and a short explanation. Give me my score out of 20 and tell me which concepts I should review.

Hands-on exercise (after marking):
6. Ask me what application I have or want to build, and which language and framework I work with. If I don't have one, use this: a customer support application for an online shop, with tickets, customers, orders and a knowledge base (FAQ and return policies). In that case, focus the exercise on: splitting the follow-up agent into a triage agent and a notification agent, coordinated by an orchestrator.
7. Suggest an exercise that applies this module's concepts to that application: goal, requirements, criteria to consider it done and common mistakes to avoid.
8. Don't solve it for me. When I bring you my solution, review it against those criteria.