Agent Architecture/Multi-Agent Patterns
Advanced11 min

Supervisor Pattern

A central supervisor agent that routes tasks to specialized worker agents, aggregates results, and manages the overall workflow.

Quick Reference

  • The supervisor is an LLM node that reads the task and decides which worker agent to invoke next
  • Workers are complete sub-graphs with their own state, tools, and system prompts
  • Use structured output for the supervisor's routing decision: {next: 'worker_name', instructions: string}
  • The supervisor sees worker outputs and decides whether to route to another worker or return the final answer
  • LangGraph's create_supervisor() helper wires up the routing loop automatically

How the Supervisor Works

Supervisor = LLM-powered router

The supervisor is an LLM node that reads the current state, decides which worker to invoke next, and optionally passes task-specific instructions. It never calls tools itself.

The supervisor operates in a loop: read state, pick a worker (or finish), wait for the worker's output, then decide again. Each iteration is one 'round.' The supervisor sees the full conversation history plus each worker's output, giving it enough context to route intelligently.

Supervisorroutes tasks, evaluates resultsevaluateResearch Agentsearch, retrieve docsCode Agentwrite, test, debugAnalysis Agentsummarize, critiquedelegatedelegatedelegateSupervisorWorker agentsresult

Supervisor routes tasks to workers and loops until the goal is met

  • Supervisor reads the task and all prior worker outputs from shared state
  • It emits a structured routing decision: which worker next, plus instructions for that worker
  • The chosen worker runs its subgraph to completion and writes results back to state
  • Supervisor re-evaluates: route to another worker, loop back to the same one, or return FINISH
  • A max_rounds limit prevents indefinite looping