Hierarchical Pattern (the "Supervisor" Pattern): One Orchestrator, Many Workers
~12 min read
A top-level planner agent delegates subtasks to workers, tracks their progress, and makes the final calls — exactly like a manager and their team. The book calls this 'Hierarchical'; it's commonly also called the Supervisor pattern.
This pattern has a top-level planner agent delegate subtasks to worker agents, track their progress, and make the final calls — this course describes it plainly: 'this is exactly like a manager and their team.' This course names this pattern 'Hierarchical'; it's worth knowing this is the same pattern commonly called the 'Supervisor' pattern elsewhere in agent-engineering literature — same underlying architecture, different name depending on the source.
The structure: one manager/planner/supervisor agent sits at the top, with visibility into the overall goal and the ability to decide what work needs to happen and in what order. Below it sit specialized worker agents, each handling a narrower slice of the overall task. The manager delegates specific subtasks to the appropriate workers, monitors what comes back, and decides the next step based on that progress — this is functionally identical to Level 4 of the 5 levels of agentic AI ('Multi-agent pattern': 'a manager agent coordinates multiple sub-agents and decides the next steps iteratively'), just described from the pattern-taxonomy angle rather than the autonomy-progression angle.
What distinguishes Hierarchical from both Sequential and Parallel: the manager's delegation decisions aren't fixed in advance the way Sequential's stage order is, or Parallel's up-front task split is — the manager can adapt what it delegates next based on what earlier workers actually returned, closer to genuine orchestration than a predetermined flow. This makes Hierarchical well suited to complex tasks that need real decomposition and progress tracking (a research-report task delegating to research, analysis, and writing workers, deciding based on results whether another research pass is needed before writing can proceed) rather than tasks with either a fixed sequence or a fully independent split.
The trade-off: the manager agent itself becomes a bottleneck and a single point of failure — if the manager makes a poor delegation decision, the whole task's quality suffers, and every delegation decision costs an extra LLM call the manager has to make, on top of the worker agents' own calls.
💻 Code example
from openai import OpenAI
client = OpenAI()
def research_worker(topic: str) -> str:
return f"[Research on {topic}: ...]"
def analysis_worker(research: str) -> str:
return f"[Analysis of: {research}]"
def writing_worker(analysis: str) -> str:
return f"[Report based on: {analysis}]"
WORKERS = {"research": research_worker, "analysis": analysis_worker, "writing": writing_worker}
def hierarchical_manager(task: str, max_steps: int = 5) -> str:
"""The manager agent decides delegation ADAPTIVELY based on
progress so far — not a fixed sequence or a fixed split."""
progress = f"Task: {task}\nDone so far: (nothing yet)"
for _ in range(max_steps):
decision = client.chat.completions.create(model="gpt-4.1", messages=[
{"role": "user", "content":
f"{progress}\n\nWhich worker should run next: research, analysis, "
f"writing, or DONE? One word."}
]).choices[0].message.content.strip().lower()
if decision == "done":
return progress
result = WORKERS[decision](progress)
progress += f"\n[{decision}] -> {result}"
return progress
💬 Deep Dive with AI
Key points
- •A top-level planner/manager agent delegates subtasks to workers, tracks progress, and makes final calls — 'exactly like a manager and their team'
- •The book calls this 'Hierarchical'; it's also commonly known as the 'Supervisor' pattern — same architecture, different name
- •Functionally the same as Level 4 (Multi-agent pattern) in the 5 levels of agentic AI, described from the pattern-taxonomy angle
- •Unlike Sequential's fixed order or Parallel's fixed split, the manager adapts delegation based on what earlier workers actually returned
- •Trade-off: the manager becomes a bottleneck and single point of failure, and every delegation decision costs an extra LLM call