# Hierarchical Agents

> Organise agents in a tree — higher-level agents decompose tasks for lower-level ones recursively, with results bubbling back up for synthesis.

- **Category**: Agentic AI
- **Subcategory**: Multi-Agent
- **Canonical URL**: https://designpattern.fyi/patterns/hierarchical_agents/

---

## Description
**Intent**: Organise agents in a tree where higher-level agents decompose tasks for lower-level agents, recursively.
**Context**: Tasks decompose recursively across several levels — a market research project breaks into vertical-specific research, each vertical into specific information-gathering steps; a software project breaks into epics, tickets, and individual edits. At each level the right next step differs in kind, not just in detail. A single supervisor can't meaningfully reason about every leaf at once.
**Solution**: Each non-leaf agent receives a task, decomposes it, and dispatches subtasks to its children. Children may be specialists (leaves) or further managers. Results bubble up; each manager synthesizes its children's outputs. Bounded depth and breadth prevent runaway hierarchies.



## Use Cases
- Tasks decompose recursively and a single supervisor can't cleanly orchestrate the full breadth.
- Sub-tasks are themselves large enough to merit their own decomposition step.
- Bounded depth and breadth limits can be enforced to prevent runaway cost.






## Trade-offs


### Advantages

- Scales to deep decomposition that a flat orchestrator can't handle.

- Each level has clear, isolated responsibility.




### Considerations & Drawbacks

- Latency multiplies with depth — every additional tree level adds a round-trip.

- Coordination bugs deep in the tree are hard to localise without good tracing.







---
**Reference**: [Original Source](https://www.agentpatternscatalog.org/patterns/hierarchical-agents/)

