Pattern 1: supervisor — the most common production pattern
**The supervisor pattern** has a central controller LLM that receives the task, decides which worker agent to invoke, receives the worker's result, and decides whether to invoke another worker, loop back to a prior worker, or terminate. All coordination flows through the supervisor — workers never communicate directly. This is the most common production multi-agent pattern in 2026 because it's easy to reason about, easy to debug (the supervisor's routing decisions are explicit in the logs), and easy to extend (add a new worker by registering it with the supervisor). Source: LangGraph supervisor pattern.
**LangGraph supervisor implementation.** `from langgraph.graph import StateGraph, END; from langchain_core.messages import HumanMessage, AIMessage; supervisor_prompt = SystemMessage(content='You are a supervisor coordinating a research team. Available workers: researcher (web search), writer (drafts), editor (reviews). Route to the appropriate worker based on what needs to be done next. Say FINISH when the task is complete.'); def supervisor(state): messages = state['messages'] + [supervisor_prompt]; response = llm.invoke(messages); return {'next_worker': parse_next_worker(response), 'messages': state['messages'] + [response]}`. The supervisor reads the full conversation state and decides which worker to invoke next.
**Parallel worker invocation via LangGraph's Send API.** For supervisors that can dispatch multiple workers simultaneously: `from langgraph.types import Send; def supervisor_parallel(state): tasks = analyze_and_split(state['task']); return [Send('worker', {'task': t, 'context': state['context']}) for t in tasks]`. The `Send` API creates independent worker invocations that run in parallel. Results are collected into the supervisor's state when all workers complete. This is the key LangGraph feature that separates it from sequential frameworks — genuine parallel execution, not just async simulation. Source: LangGraph Send API docs.
**Supervisor cost analysis.** The supervisor's cost is: (1) supervisor LLM call per routing decision (typically 300-800 input + 50-200 output tokens), (2) all worker LLM calls (the dominant cost component), (3) supervisor LLM call for synthesis (if the supervisor assembles the final output). For a 3-worker supervisor on Sonnet 4.6 with 4 routing decisions: supervisor overhead = 4 × (600 input × $3/1M + 150 output × $15/1M) = 4 × ($0.0018 + $0.00225) = $0.016. Workers = 3 × $0.063 (3-turn loop) = $0.189. Synthesis = $0.025. **Total: $0.230/task** — vs $0.149 for CrewAI on same task. The overhead is the price of explicit routing control and debuggability.
**When to use the supervisor pattern.** Supervisor is optimal when: (1) workers have distinct capabilities that the supervisor needs to choose between (not just a fixed sequence), (2) the task requires adaptive routing (the right next step depends on prior results), (3) some tasks complete with just 1-2 workers while others need 5-6 (dynamic crew size), (4) quality control requires a supervisor to check worker output before passing it downstream. It's NOT optimal for fixed pipelines (use CrewAI sequential), for peer-to-peer workflows where any agent should be able to hand off to any other (use swarm), or for massive teams >10 workers (overhead grows with routing decisions).
**Supervisor as quality gate.** A common production extension: add a supervisor routing decision after each worker that explicitly checks output quality. `def should_continue(state): supervisor_check = llm.invoke(state['messages'] + [quality_check_prompt]); if 'RETRY' in supervisor_check.content: return {'next': 'researcher'}; elif 'DONE' in supervisor_check.content: return {'next': END}; else: return {'next': 'writer'}`. This adds 1 supervisor LLM call per worker completion (cost: ~$0.007/check on Sonnet 4.6) but catches low-quality worker outputs before they flow downstream. At 10K tasks/month: $700/month in quality gate overhead — justified if it prevents 5% of low-quality outputs reaching users.