Tutorials Logic, IN info@tutorialslogic.com

LangGraph Multi-Agent Graphs: Supervisor, Specialist, and Handoff Architectures

LangGraph Multi-Agent Graphs

Multi-agent systems sound impressive, but they are only worthwhile when specialization creates real value. A graph with several agents is still just a workflow, which means state, routing, review, and observability remain the hard parts.

LangGraph is a strong fit for multi-agent design because it makes ownership transitions explicit. A supervisor can delegate to specialists, gather outputs, and route to the next responsible actor without hiding handoffs inside prompt text.

This lesson focuses on architectures that stay understandable under production pressure rather than building teams of agents just for novelty.

When Multi-Agent Architecture Is Justified

Use multiple agents when tasks truly benefit from different skills, tools, prompts, or review standards. Common examples include research plus synthesis, planner plus executor, or domain specialists such as billing, compliance, and product-support roles.

Do not choose multi-agent designs merely because a single-agent prompt feels messy. Often the right fix is better state and routing, not more personas.

  • Specialized tools or prompts
  • Distinct review or risk boundaries
  • Clear handoff semantics between responsibilities

Supervisor Pattern

In a supervisor graph, a central coordinator examines the current state and delegates to the most appropriate specialist. The specialist writes its result back into shared or structured state, and control returns to the supervisor for the next decision.

This pattern works well when one actor should maintain the big-picture plan while several other actors provide bounded expertise.

  • Supervisor decides ownership.
  • Specialist handles one domain well.
  • Supervisor integrates results and chooses the next step.

Planner-Executor Pattern

Another useful architecture splits planning from action. A planner creates a task list or execution outline. An executor or set of executors performs the steps. Optionally, a reviewer or critic validates the result before final completion.

This is powerful for coding assistants, research workflows, and document processing because the system can separate high-level strategy from low-level work.

  • Planner creates sequence or goals.
  • Executor performs concrete actions.
  • Reviewer or supervisor checks quality and completion.

Shared State Versus Agent-Scoped State

The hardest design choice in multi-agent graphs is usually state ownership. If everything is shared, specialists step on each other. If everything is isolated, coordination becomes painful.

A good compromise is to keep a shared run state for top-level goals and audit information, then reserve agent-scoped sections for specialist outputs and temporary reasoning artifacts.

  • Shared: user goal, thread identifiers, final decision, audit log
  • Scoped: specialist notes, domain-specific findings, temporary tool outputs

Handoffs and Escalations Need Strong Contracts

A handoff is a route with semantics. It should record why control changed, what work is complete, what evidence the next agent needs, and what success looks like after the handoff.

Without that contract, multi-agent systems degrade into agents repeating work because nobody knows what the previous specialist actually established.

  • Record current owner and previous owner.
  • Store a handoff reason and summary.
  • Define the output contract for each specialist.

Multi-Agent Graphs Need State Ownership

Multi-agent LangGraph systems work best when each specialist owns a clear part of the workflow. A research agent may own evidence gathering. A policy agent may own compliance review. A writer agent may own final wording. The supervisor owns routing, budgets, approvals, and final response quality.

State ownership prevents agents from overwriting each other. Shared fields should be limited and typed. Specialist outputs should be structured: recommendation, evidence, confidence, risk flags, and next requested action. Avoid letting every agent append free-form notes into one ambiguous field.

Handoffs should be explicit graph transitions. The supervisor should know why a specialist is being invoked, what input it receives, and what output it must return. If one specialist can call another specialist freely, the graph can become a hidden conversation instead of an inspectable workflow.

Multi-agent design is justified when specialization changes tools, policy, context, or evaluation. If agents only have different names but the same model, tools, and goals, the graph is probably adding complexity without improving reliability.

  • Assign ownership for each important state field.
  • Use structured specialist outputs.
  • Keep supervisor responsibility explicit.
  • Limit handoff depth and specialist recursion.
  • Evaluate the whole graph, not only individual specialists.

Supervisor Patterns and Failure Modes

A supervisor can route tasks, validate specialist results, merge evidence, and decide whether to continue, ask a human, or finish. The supervisor should not become an all-powerful hidden prompt. It needs deterministic constraints: maximum handoffs, allowed specialists, risk policies, and stop conditions.

Common failures include ping-pong handoffs, specialists working from stale state, duplicated tool calls, contradictory conclusions, and final answers that ignore risk flags. These failures are easier to diagnose when every handoff is a named edge with a compact handoff packet.

Use reducers carefully in multi-agent graphs. Message accumulation may be useful, but important business fields should not be merged casually. If two specialists produce conflicting risk assessments, the graph should preserve both and route to resolution rather than overwrite one.

Human review is often the best boundary for high-stakes multi-agent disagreement. If compliance and sales agents disagree, the supervisor should not pretend certainty; it should surface the conflict and ask for a decision.

  • Use bounded supervisor routing.
  • Preserve specialist conflicts instead of hiding them.
  • Track handoff count, latency, and stop reason.
  • Route unresolved high-risk disagreement to human review.
  • Keep specialist traces connected to the final answer.

Multi-Agent Review Exercise

Take one multi-agent workflow and write the contract for each agent: responsibility, input state, output schema, tools, risk flags, and stop condition. If two agents have the same contract, they may not need to be separate agents.

Trace a handoff from supervisor to specialist and back. The handoff packet should explain why the specialist is needed, what evidence it receives, and what result it must return. Avoid raw conversation dumps unless the specialist truly needs them.

Then test disagreement. If two specialists produce conflicting recommendations, the graph should preserve the conflict and route to resolution. Silently overwriting one result hides risk.

Finally, measure whether specialization improves the workflow. If the multi-agent version costs more, takes longer, and produces no better trace quality, simplify back to a single-agent graph.

The best multi-agent designs make collaboration observable: every specialist contribution should be attributable, reviewable, and connected to the final decision.

  • Define specialist contracts explicitly.
  • Keep handoff packets compact and cited.
  • Test disagreement and stale-state behavior.
  • Limit recursive or ping-pong handoffs.

Beginner Example: Supervisor Chooses a Specialist

This is the simplest multi-agent shape: one coordinator, multiple domain branches.

Beginner Example: Supervisor Chooses a Specialist
from typing_extensions import TypedDict, Literal

class TeamState(TypedDict):
    request: str
    owner: str

def supervisor(state: TeamState) -> dict:
    text = state["request"].lower()
    if "invoice" in text:
        return {"owner": "billing_agent"}
    return {"owner": "support_agent"}

def route_owner(state: TeamState) -> Literal["billing_agent", "support_agent"]:
    return state["owner"]
  • The supervisor writes the ownership decision into state.
  • The router simply follows that ownership field.
  • This is a clean alternative to embedding delegation only in prompts.

Intermediate Example: Planner and Executor

Separate planning from action when the task has several substeps that should be inspectable.

Intermediate Example: Planner and Executor
from typing_extensions import TypedDict

class PlanState(TypedDict):
    goal: str
    plan: list[str]
    completed_steps: list[str]

def planner(state: PlanState) -> dict:
    return {"plan": ["search docs", "draft summary", "review answer"]}

def executor(state: PlanState) -> dict:
    first_step = state["plan"][0]
    return {"completed_steps": [first_step]}
  • Planning and execution can be reviewed independently.
  • The state contract makes the workflow legible to humans.
  • This shape is useful for research, coding, and analytics assistants.

Advanced Example: Track Handoff Metadata

Production multi-agent systems should preserve why control shifted and what evidence came with the handoff.

Advanced Example: Track Handoff Metadata
from typing_extensions import TypedDict

class HandoffState(TypedDict):
    current_owner: str
    handoff_reason: str
    specialist_outputs: dict

def escalate_to_compliance(state: HandoffState) -> dict:
    return {
        "current_owner": "compliance_agent",
        "handoff_reason": "refund exceeds auto-approval threshold",
    }
  • Handoffs become auditable events instead of hidden internal behavior.
  • This is especially valuable in enterprise or regulated environments.
  • Specialist outputs can be preserved separately from global state.
Key Takeaways
  • Adopt multi-agent architecture only when specialization is real.
  • Use supervisors, planners, and handoffs as explicit graph concepts.
  • Protect shared state from becoming a free-for-all.
  • Record ownership and handoff reasons in state.
Common Mistakes to Avoid
Using multiple agents to compensate for poor single-agent state design.
Letting specialists overwrite each other’s context in one shared blob.
Handing work off without recording what changed or why.

Practice Tasks

  • Design a supervisor graph for billing, support, and compliance specialists.
  • Create a planner-executor flow for a research assistant.
  • Add handoff metadata fields to a multi-agent state schema.

Frequently Asked Questions

No. They are often more expensive and harder to debug. Use them only when specialization clearly improves the workflow.

Usually you want a mix: shared top-level state plus specialist-owned sections or outputs.

Agents repeating work or contradicting one another because ownership and handoff context were never made explicit.

Ready to Level Up Your Skills?

Explore 500+ free tutorials across 20+ languages and frameworks.