Lesson 3: Supervisor-Worker Pattern

Lesson 3: Supervisor-Worker Pattern

Master multi-agent routing. Learn how to design systems where a 'Supervisor' agent oversees a team of specialized 'Worker' agents, delegating tasks and verifying outputs for maximum quality.


Module 3: Agentic Architecture and Orchestration

Lesson 3: Supervisor–Worker Pattern

While the Planner-Executor (Lesson 2) focuses on Sequential Steps, the Supervisor-Worker pattern is about Expert Routing. In this model, we move from "One brain doing steps" to "One brain managing a team."

In this lesson, we explore how to build a hierarchical system that can handle diverse domains (e.g., Coding, Writing, and Data) simultaneously.


1. The Roles in the Hierarchy

The Supervisor (The Manager)

The Supervisor is the only agent that speaks to the user. It is the "Traffic Controller."

  • Responsibility: Parses the user request, decides which Worker is best suited for it, and Aggregates the final answer.
  • Tools: The Supervisor typically has no technical tools, only a "Router" tool to talk to Workers.

The Workers (The Specialists)

Each worker is a "Single-Topic Expert."

  • Example Worker A (The Coder): Only has Python tools.
  • Example Worker B (The Researcher): Only has Search tools.
  • Example Worker C (The Designer): Only has Image tools.

2. Visualizing the Pattern

graph TD
    U[User] --> S[Supervisor]
    S -->|Delegate| W1[Worker: Coder]
    S -->|Delegate| W2[Worker: Researcher]
    S -->|Delegate| W3[Worker: Designer]
    W1 -->|Result| S
    W2 -->|Result| S
    W3 -->|Result| S
    S -->|Integrated Answer| U

3. Why this Pattern Works

Mental Isolation (SNR)

Each worker has a Strictly Scoped Prompt. The Coder doesn't need to know how to write marketing copy. This prevents the "Jack of all trades, master of none" problem in LLMs.

Parallel Execution (In some variants)

If a user asks to "Find 10 companies AND write a script to scrape them," the Supervisor can trigger the Researcher and the Coder Simultaneously (if your orchestrator supports it), significantly reducing total latency.

Quality Control (Verification)

The Supervisor acts as a "Gatekeeper." If a worker returns garbage, the Supervisor recognizes it and sends it back for a revision.


4. Selection Criteria: When to use Supervisor vs. Planner

  • Use Planner-Executor if: The task is a long series of steps in a single domain (e.g., "Write a 5-file Python application").
  • Use Supervisor-Worker if: The task requires cross-domain intelligence (e.g., "Research the market, write a summary, and design a logo").

5. Architectural Trap: "The Lazy Supervisor"

A common failure is when the Supervisor just "Passes through" the user's message without adding context.

  • The Fix: The Supervisor must be prompted to Synthesize worker outputs. It shouldn't just say "Here is what the researcher found. Here is what the coder wrote." It should say "Based on the researcher's findings about market X, the coder has developed script Y to address problem Z."

6. Summary

  • Supervisor handles the User and the Team.
  • Workers handle the technical execution.
  • This pattern is the gold standard for "Platform" apps that offer multiple features through one chat bar.

In the next lesson, we will look at the mechanics of Task Decomposition and Delegation.


Interactive Quiz

  1. What is the "Router" tool in a Supervisor agent?
  2. How does the Supervisor-Worker pattern improve "SNR" (Signal-to-Noise Ratio)?
  3. Why is "Synthesis" a critical skill for a Supervisor agent?
  4. Scenario: A user wants to translate a document from English to French and then format it as a PDF. Is this a Supervisor-Worker or a Planner-Executor problem? Why?

Reference Video:

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn