Phase 14: Agent Engineering

Orchestration Patterns: Supervisor, Swarm, Hierarchical

Four orchestration patterns recur across 2026 frameworks: supervisor-worker, swarm / peer-to-peer, hierarchical, debate. Anthropic's guidance: "It's about building the right system for your needs." Start simple; add topology only when a single agent plus five workflow patterns is insufficient. Name the four recurring orchestration patterns and when each fits. Describe the 2026 LangChain recommendation: tool-call-based supervision vs supervisor libraries. Explain Anthropic's "build the right system" rule and how it gates topology choice. Implement all four in stdlib against a common scripted LLM. Teams reach for "multi-agent" before they need it. Four patterns recur across frameworks; once you can name them, you can pick the right one — or skip topology entirely. A central routing LLM dispatches to specialist agents. Decides: loop back to self, hand off to specialist, terminate. Specialists do not talk to each other; all routing goes through the supervisor. Frameworks: LangGraph createsupervisor, Anthropic orchestrator-workers, CrewAI Hierarchical Process. 2026 LangChain recommendation: do supervision through direct tool calls rather than createsupervisor. Gives finer context engineering control — you decide exactly what each specialist sees. Agents hand off directly via a shared tool surface. No central router. Lower latency than supervisor (fewer hops). Harder to reason about (no single point of control). Frameworks: LangGraph swarm topology, OpenAI Agents SDK handoffs (when all agents can hand off to all others). Supervisors…

Orchestration Patterns: Supervisor, Swarm, Hierarchical: Four orchestration patterns recur across 2026 frameworks: supervisor-worker, swarm / peer-to-peer,…

This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.

Browse the complete course catalog or open this lesson on GitHub.