Multi-Agent

Hierarchical Agents

Organise agents in a tree where higher-level agents decompose tasks for lower-level agents, recursively.

Problem

A flat supervisor pattern, where one coordinating agent dispatches to a list of specialists, scales poorly as the list grows. The supervisor's prompt grows with the number of specialists, recall on which specialist to call drops, and any new vertical forces an edit to the root prompt. The supervisor ends up trying to think simultaneously at the level of the whole project and the level of individual specialist tasks, which neither it nor any other agent does well.

Solution

Each non-leaf agent receives a task, decomposes it, and dispatches sub-tasks to its children. Children may be specialists (leaves) or further managers. Results bubble up; each manager synthesises its children's outputs. Bounded depth and breadth prevent runaway hierarchies.

When to use

  • Tasks decompose recursively and a single supervisor cannot cleanly orchestrate the breadth.
  • Sub-tasks are themselves big enough to merit their own decomposition step.
  • Bounded depth and breadth limits can be enforced to prevent runaway hierarchies.

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related