# Designs and orchestrates multi-agent systems

> Competency building-agents/orchestrates-agents

Page: https://schubergphilis.github.io/ai-training/competencies/building-agents/orchestrates-agents/
License: CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/

*Building agents* · competency `building-agents/orchestrates-agents`

**Taught in:** the [Building agents](https://schubergphilis.github.io/ai-training/building-agents/) course

**Draws on:** [Design patterns](https://schubergphilis.github.io/ai-training/topics/building-agents/patterns/), [Orchestration and multi-agent](https://schubergphilis.github.io/ai-training/topics/building-agents/orchestration/)

## Learning objectives

### Picks a design pattern for a task and says why (base)

| Claim | Why | Example |
| ----- | --- | ------- |
| The learner names the pattern (single loop, reflection, plan-then-execute, and so on) and the property of the task that calls for it. | A pattern picked because it is interesting adds calls and failure modes without a reason to point to. | "The task has ten dependent steps and a wrong early step wastes the rest, so plan first, then execute the plan step by step." |
| The learner starts with the simplest pattern that could work and adds structure when the evaluation shows a need. | Each added pattern multiplies calls and cost, and the simple version is the baseline the complex one must beat. | A single tool-using loop handles 80 percent of the evaluation set, and the learner adds reflection only after measuring where it fails. |
| The learner can say what each pattern costs in calls, latency and money for their task. | Reflection doubles calls, planning adds a call per plan revision, and the budget decides whether that is affordable. | "Reflection adds one call per step; at twelve steps that is twice the latency, which the user-facing flow cannot take." |

Served by: [Plan everything first or react step by step](https://schubergphilis.github.io/ai-training/building-agents/plan-or-react/), [Writing the plan before taking the steps](https://schubergphilis.github.io/ai-training/building-agents/planning/), [Reasoning before each action](https://schubergphilis.github.io/ai-training/building-agents/react/), [A second pass that critiques the first](https://schubergphilis.github.io/ai-training/building-agents/reflection/), [Workflows before agents](https://schubergphilis.github.io/ai-training/building-agents/workflows-before-agents/)

### Justifies the coordination cost of more than one agent (base)

| Claim | Why | Example |
| ----- | --- | ------- |
| Before adding a second agent, the learner names what the single agent cannot do: a context that does not fit, a tool set too large, a skill that needs a different prompt. | Most multi-agent designs are a single agent with more coordination cost and no new ability. | "One agent's context fills with the codebase before it reaches the task, so a scout agent summarizes the relevant files first." |
| The learner counts the coordination cost: extra calls, handoff messages, lost context at each boundary, and the failure modes of agents disagreeing. | Every boundary between agents is a place where information is dropped and a decision is made twice. | A three-agent design spends 40 percent of its tokens on handoffs, and the learner shows this before deciding. |
| The learner compares the multi-agent design against the single-agent baseline on the same evaluation set. | A design that feels better must be shown to be better on the tasks that matter. | The orchestrated version scores three points higher at twice the cost, so the learner keeps the single agent and notes where the three points came from. |

Served by: [Orchestration in code or by a model](https://schubergphilis.github.io/ai-training/building-agents/orchestrating-agents/), [What every extra agent costs](https://schubergphilis.github.io/ai-training/building-agents/orchestration-tax/)

### Composes patterns and names the failure modes of the composition (expert)

| Claim | Why | Example |
| ----- | --- | ------- |
| The learner draws the composition and names, at each junction, what passes across and what is lost. | Composition failures happen at the seams: a planner that does not see what the executor learned, a reflector without the original goal. | The plan-then-execute loop passes the plan to the executor but not the constraints, so the executor breaks a limit the planner knew about, and the learner fixes the handoff. |
| The learner names the failure modes the composition adds: loops between components, disagreement without a tiebreaker, cost multiplying. | Each pattern has known failures alone, and combining them adds new ones that are in neither. | A reflector that keeps asking for revisions and an executor that keeps complying produce an unbounded loop, so the learner adds a revision cap. |
| The learner tests the composition with faults injected at each boundary. | A composed system that has only seen happy paths has untested error handling at every seam. | The test returns an empty plan from the planner and a tool error from the executor and checks that the orchestrator stops and reports. |

Served by: [Orchestration in code or by a model](https://schubergphilis.github.io/ai-training/building-agents/orchestrating-agents/), [Plan everything first or react step by step](https://schubergphilis.github.io/ai-training/building-agents/plan-or-react/)

## Alignment

| Framework | Code | Asks | Objectives here |
| --------- | ---- | ---- | --------------- |
| Ng, AI engineering skills map | Building and deploying AI applications | Build, evaluate, ship | picks-a-pattern, justifies-orchestration-cost, composes-patterns |
| Brilliant Coding with AI | BLD-4, BLD-5 | Organize and oversee a workflow | picks-a-pattern |
