# Supervisor Multi-Agent Router

> A supervisor agent delegates sub-tasks to specialist agents with narrow tools and merges their outputs.

Category: AI Agent Workflows  
Tags: multi-agent, supervisor, routing  
Setup time (estimate): 3-6 hours  
Estimated cost: Supervisor call plus each worker call per turn; often several times a single agent.  
Last verified: not yet independently verified

## When to use

Only when one agent with many tools gets confused. Each specialist gets a small toolset and a focused prompt; the supervisor sees summaries, not raw tool output.

## Steps

1. Define specialists (e.g. `researcher`, `coder`, `writer`) each with its own system prompt and tools.
2. Expose each specialist to the supervisor as a single tool: `delegate_to_<name>(task: string)`.
3. Specialists return a concise result (not their full transcript).
4. Supervisor decides the next delegation or returns the final answer.
5. Enforce a global step and cost budget across all agents.

## Definition

```yaml
supervisor:
  model: strong-model
  prompt: >
    You coordinate specialists. Delegate one clear sub-task at a time.
    Integrate results and answer the user. Do not do specialist work yourself.
  tools: [delegate_to_researcher, delegate_to_coder, delegate_to_writer]
specialists:
  researcher: {model: fast-model, tools: [web_search, fetch_url]}
  coder:      {model: code-model, tools: [read_file, write_file, run_tests]}
  writer:     {model: fast-model, tools: []}
budget: {max_total_steps: 30, max_cost_usd: 1.00}
```

## Failure modes

- Supervisor ping-pongs between workers without progress; cap handoffs.
- Workers lose context the supervisor had; pass explicit task briefs.
- Multi-agent overhead is unnecessary for simple tasks; start with one agent.
