Skip to Content
Docs are being rebuilt — start at Introduction → How it works.

Hierarchical pattern

The hierarchical pattern puts one coordinator agent in charge of a task and lets it delegate parts of the work to specialist agents. The coordinator plans, hands assignments to specialists, reads back their results, and produces the final answer. This is the only multi-agent shape TeamMate supports today — there are no pipeline, parallel, review, or debate patterns.

When to use it

Use a coordinator-and-specialists setup when a single agent’s instructions would otherwise have to cover too many distinct jobs. Typical signs:

  • The work splits cleanly into roles (research, drafting, review) that each need different instructions, tools, or knowledge.
  • One general agent keeps mixing concerns or losing focus across a long task.
  • You want a specialist to be reusable on its own as well as inside a larger task.

If one agent already does the job well, keep it. Delegation adds coordination cost and latency.

How it works

  1. The coordinator agent decides a sub-task should go to a specialist.
  2. It calls the specialist using the agent-to-agent delegation tool. See Agent-to-agent calls.
  3. The specialist runs as its own agent — with its own instructions, model, tools, and knowledge — and streams a reply.
  4. The coordinator receives a distilled version of that reply (a <final_answer> block if the specialist provides one, otherwise a trimmed copy) and continues.
  5. The coordinator combines specialist outputs into the response the user sees.

The user sees the full streamed reply from each specialist as it runs; the coordinator keeps only the distilled result in its own context so it stays lean across a multi-step task.

Designing the hierarchy

RoleWhat to put in its instructions
CoordinatorHow to break the task down, which specialist owns which part, when to delegate vs. answer directly, and how to assemble the final result.
SpecialistA single, well-scoped job, the inputs it expects, and the output format the coordinator needs back.

Tips:

  • Give each specialist one clear job. Narrow specialists are easier to test and reuse.
  • Have specialists end with a short, structured final answer so the coordinator gets exactly what it needs.
  • Document ownership and expected outputs for every role, so a wrong result is easy to trace to the agent that produced it.
  • Keep the depth shallow. A coordinator plus a small set of specialists is far easier to reason about than deep chains of delegation.