Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

LangGraph blueprint · Research & Consulting

Multi-agent supervisor

One supervisor agent routes a task between specialist agents and decides when it is done.

Steps
5
Subjective questions
32
Objective questions
32

The problem and the outcome

Problem: One giant prompt cannot research, code and write a report well at once.

Outcome: Specialist agents, each doing one job, coordinated by a supervisor.

Architecture

User task01Supervisoragent02Final answer05Research agentweb search03Coding agentruns codeWriter agentdrafts reportShared statemessages04handoffresultsback to supervisordone

How it works, step by step

  1. A user task arrives at the supervisor.
  2. The supervisor is a model that decides which specialist should act next.
  3. Each worker is its own agent with its own prompt and tools; the supervisor hands off to it.
  4. Workers write results into the shared graph state, and control returns to the supervisor.
  5. When the task is complete, the supervisor writes the final answer.

Tech stack

  • LangGraph
  • Supervisor agent with handoff tools (or the langgraph-supervisor package)
  • Specialist agents with their own tools
  • Shared message state
  • LangSmith for per-agent traces

Key design decisions

  • Each specialist has a narrow job and few tools, which makes it more reliable than one agent with everything.
  • The supervisor only routes and decides when the task is done; it does not do the specialists' work.
  • Pass each specialist only the context it needs, not the full history, to save tokens and reduce confusion.

Common mistakes

  • Agents handing work back and forth in a loop with no stopping rule.
  • Every agent seeing every message, so costs grow quickly.
  • Using multiple agents where one agent with good tools would do.

What to measure

  • Handoffs per task
  • Task success rate per specialist
  • Tokens per task vs. a single-agent baseline

Most-asked interview questions

Subjective questions 32

1When is a multi-agent system better than a single agent?Asked almost every time

When the task splits into distinct skills with different tools and prompts, when one agent's tool list or context gets too large to choose well, or when parts can run in parallel. The costs are more tokens, more latency and harder debugging, so start with one agent and split when you measure a problem.

2Design a multi-agent research assistant with a supervisor.Asked almost every time

A supervisor agent reads the request and decides which specialist to call next: a search agent with web tools, a data agent with SQL, and a writer agent. Each specialist is its own graph or create_agent with focused tools and prompt. The supervisor receives their results, decides whether more work is needed, and ends when the writer produces the final report.

3How do you prevent agents from passing huge contexts to each other?Asked almost every time

Specialists return concise summaries or structured results rather than full transcripts, shared state holds only what others need, large artifacts are stored outside and referenced, and each agent keeps its own private message history.

4How do you evaluate a multi-agent system?Asked almost every time

Evaluate end-to-end task success and cost, plus each agent separately on its own subtasks, check routing decisions (did the supervisor pick the right agent), count handoffs and loops, and compare against a single-agent baseline.

5Compare the supervisor and network (swarm) patterns.Very often asked

In a supervisor pattern a central agent decides who acts next, and specialists report back to it: predictable and easy to trace. In a network or swarm, agents hand off directly to each other: more flexible and fewer hops, but harder to control and debug.

6How do agents share information in LangGraph?Very often asked

Through the graph state: usually a shared list of messages, or a typed state with fields per agent. Handoffs are tool calls or Command objects that update the state and name the next node. Subgraphs can keep private state and return only a result.

7How does a supervisor decide which agent to call?Very often asked

It is an LLM with a routing prompt and either structured output naming the next agent or handoff tools (one per agent); its decision is routed with conditional edges or Command(goto=...).

8What are handoffs in LangGraph?Very often asked

A tool or node returns Command(goto='agent_name', update={...}), moving control to another agent and passing state updates, which is how swarm and supervisor patterns transfer work.

9How do you stop agents from looping between each other?Very often asked

Cap handoffs and the recursion limit, track visited agents in state, require the supervisor to state why another round is needed, and route to a finishing node after a maximum number of steps.

10When does a swarm pattern beat a supervisor?Very often asked

When agents are peers and the right next expert depends on the conversation, such as customer service routing between billing and tech support. The active agent hands off directly, avoiding an extra supervisor call each turn.

11How do you give each agent different models?Very often asked

Each agent is its own node or subgraph with its own model: a strong reasoning model for the supervisor or planner, cheaper fast models for simple specialists, balancing cost and quality.

12How do subgraphs help in multi-agent systems?Very often asked

Each agent can be a compiled subgraph with its own state schema, added as a node in the parent graph; state keys shared with the parent pass through, and private keys stay inside, keeping agents modular and testable.

13How do you run specialists in parallel?Very often asked

The supervisor can fan out with Send to several agents at once when subtasks are independent, then gather results with a reducer before deciding the next step.

14How do you fan out work to a variable number of parallel workers in LangGraph?Very often asked

Return a list of Send objects from a conditional edge, one per item, each naming the worker node and the state to pass it. The workers run in parallel and write into a state key with a reducer, such as list concatenation, and a later node combines the results.

Sourced from Docs by LangChain (MCP)

15How does an agent in a subgraph hand control to a node in the parent graph?Very often asked

It returns a Command with goto set to the target node, an update, and graph set to Command.PARENT, which navigates to the closest parent graph. Any state key updated this way that both graphs share must have a reducer defined in the parent state.

Sourced from Docs by LangChain (MCP)

16How do you trace a multi-agent run?Often asked

LangSmith shows nested runs per agent, with model and tool calls, so you can see which agent made which decision, its tokens and latency, and where errors started.

17What is the hierarchical supervisor pattern?Often asked

Supervisors managing teams of agents, which themselves report to a top-level supervisor, useful for very large systems such as a research team and a writing team coordinated by a project lead.

18How do you share memory across agents?Often asked

Use shared state keys for the current task, a store for long-term facts any agent can read, and avoid letting every agent write everywhere; define which agent owns which data.

19How do you handle a failing specialist?Often asked

Return an error result to the supervisor, which can retry, choose another agent, or report partial results; protect with timeouts and limits per agent.

20What are the costs of multi-agent systems?Often asked

More model calls and tokens, more latency from coordination, harder debugging and evaluation, and possible inconsistency between agents. They pay off only when specialisation or parallelism improves outcomes.

21How do you design specialist prompts?Often asked

Give each agent a narrow role, clear inputs and outputs, only the tools it needs, and instructions on what to return to the supervisor, so its behaviour is predictable and testable.

22How does the langgraph-supervisor library help?Often asked

It provides a prebuilt create_supervisor that wires agents with handoff tools and the supervisor loop, which you can customise or replace with your own graph as needs grow.

23How do you deploy a multi-agent graph?Often asked

Deploy it as one LangGraph application with persistence, or deploy agents as separate services communicating via APIs or protocols such as A2A when teams own them independently.

24What context should a handoff tool pass to the next agent?Often asked

Pass only what the next agent needs, typically the last AI message and a ToolMessage confirming the transfer, rather than the full history. Subgraph handoffs need deliberate context engineering, otherwise agents receive malformed or bloated histories.

Sourced from Docs by LangChain (MCP)

25When should you prefer a single agent with middleware over multiple agent subgraphs?Often asked

For most handoff cases, because it is simpler: one agent changes its prompt and tools based on state. Use multiple agent subgraphs only when an agent needs a bespoke implementation, such as its own graph with reflection or retrieval steps.

Sourced from Docs by LangChain (MCP)

26How do you put a time limit on one slow parallel worker?Often asked

Pass a timeout on the Send for that worker, which overrides the target node's static timeout for that dispatch only. Without one, the node's timeout set at add_node time applies, so you can keep a default and tighten it per call.

Sourced from Docs by LangChain (MCP)

27How can a supervisor call an agent that is deployed separately?Often asked

Wrap the deployment in a RemoteGraph and add it as a subgraph node. RemoteGraph exposes the same interface as a compiled graph, so the parent can invoke and stream it; use UUIDs as thread IDs if the parent has a checkpointer.

Sourced from Docs by LangChain (MCP)

28What is the A2A protocol?Sometimes asked

Agent-to-agent communication standard for agents built by different teams or vendors to discover each other's capabilities and exchange tasks and results over HTTP.

29How do you decide the number of agents?Sometimes asked

Start with one agent, split only where prompts or tools become too large or responsibilities clearly differ, and confirm each split improves evaluation metrics.

30How do you show multi-agent progress to users?Sometimes asked

Stream which agent is working and short status updates, then the final combined answer, so users understand delays and trust the result.

31How do you prevent conflicting outputs between agents?Sometimes asked

Make one agent (often the supervisor or writer) responsible for the final answer, give it all specialist results, and instruct it to reconcile or flag disagreements.

32How do you route one query to several knowledge sources at once and merge the answers?Sometimes asked

A classify node decides which sources apply, a routing function returns one Send per chosen source node so they run in parallel, and each source node writes its findings for a synthesize node that combines them into one answer.

Sourced from Docs by LangChain (MCP)

Objective questions 32

1What is the supervisor's main job?Asked almost every time
  1. ARoute work to the right specialist and decide when it is doneCorrect answer
  2. BStore vectors
  3. CFine-tune the specialists
  4. DRun every tool itself

Why: It plans and delegates; the specialists do the work with their own tools.

2What should specialists return to the supervisor?Asked almost every time
  1. ANothing
  2. BConcise summaries or structured resultsCorrect answer
  3. CFull transcripts
  4. DRaw HTML pages

Why: Keeps shared context small.

3How does an agent hand control to another in LangGraph?Asked almost every time
  1. ARestart the graph
  2. BEdit the system prompt
  3. CReturn Command(goto=...)Correct answer
  4. DCall the other agent's API directly only

Why: It moves control with state updates.

4What should multi-agent systems be compared against?Asked almost every time
  1. ANothing
  2. BA random baseline only
  3. CHuman typing speed
  4. DA single-agent baselineCorrect answer

Why: Multi-agent must earn its cost.

5What is a common downside of multi-agent systems?Very often asked
  1. AHigher token cost and latencyCorrect answer
  2. BThey cannot be traced
  3. CThey require fine-tuning
  4. DThey cannot use tools

Why: Extra coordination messages and model calls add cost and time.

6What stops agents from bouncing work forever?Very often asked
  1. AHandoff caps and recursion limitsCorrect answer
  2. BMore agents
  3. CHigher temperature
  4. DLonger prompts

Why: Route to finish after a limit.

7When does a swarm beat a supervisor?Very often asked
  1. AWhen there is one agent
  2. BWhen peers hand off directly by conversationCorrect answer
  3. CAlways
  4. DNever

Why: Avoids an extra supervisor call.

8How do specialists run in parallel?Very often asked
  1. AThe supervisor fans out with SendCorrect answer
  2. BThey cannot
  3. CBy using one model
  4. DThrough email

Why: Gather results with a reducer.

9How do subgraphs keep agents modular?Very often asked
  1. AThey remove tools
  2. BPrivate state stays inside each subgraphCorrect answer
  3. CThey share every key
  4. DThey disable persistence

Why: Shared keys pass through.

10Which agent typically gets the strongest model?Very often asked
  1. AThe logger
  2. BThe supervisor or plannerCorrect answer
  3. CEvery specialist equally
  4. DNone

Why: Routing decisions matter most.

11What does a failing specialist return?Very often asked
  1. AA random answer
  2. BAn error result the supervisor can handleCorrect answer
  3. CNothing
  4. DA crash for the whole graph

Why: Supervisor retries or reroutes.

12Which LangGraph primitive fans out to a variable number of parallel nodes?Very often asked
  1. ASendCorrect answer
  2. Binterrupt
  3. Cadd_edge
  4. DMemorySaver

Why: Each Send dispatches one node invocation with its own state.

Sourced from Docs by LangChain (MCP)

13graph=Command.PARENT in a Command means…Very often asked
  1. ANavigate to the closest parent graphCorrect answer
  2. BRestart the current graph
  3. CEnd the run
  4. DCall a remote graph

Why: Subgraph agents use it to hand off.

Sourced from Docs by LangChain (MCP)

14In LangGraph, how does one agent hand control to another?Often asked
  1. AThrough the vector store
  2. BBy editing the source code
  3. CWith a handoff tool or a Command naming the next nodeCorrect answer
  4. DBy restarting the graph

Why: A handoff updates the state and routes execution to the target agent's node.

15The hierarchical pattern adds…Often asked
  1. AOne agent only
  2. BNo routing
  3. CA database
  4. DSupervisors of supervisorsCorrect answer

Why: It organises teams within teams.

16Which prebuilt helper wires a supervisor loop?Often asked
  1. Abuild_swarm only
  2. Bcreate_supervisorCorrect answer
  3. Ccreate_router
  4. Dmake_team

Why: From langgraph-supervisor.

17Specialist prompts should be…Often asked
  1. AEmpty
  2. BNarrow with clear inputs and outputsCorrect answer
  3. CAs broad as possible
  4. DIdentical for all

Why: Predictable behaviour.

18A main cost of multi-agent systems is…Often asked
  1. ALess debugging
  2. BNo evaluation needed
  3. CMore calls, tokens and latencyCorrect answer
  4. DFewer model calls

Why: Coordination overhead.

19Long-term facts shared by agents belong in…Often asked
  1. ALogs
  2. BA storeCorrect answer
  3. CEach agent's prompt
  4. DThe UI

Why: Readable across threads.

20Which tool shows nested runs per agent?Often asked
  1. ALangSmithCorrect answer
  2. Bnpm
  3. CJest
  4. DBabel

Why: Find where errors start.

21Which protocol lets agents from different vendors collaborate?Often asked
  1. ASMTP
  2. BFTP
  3. CSSH
  4. DA2ACorrect answer

Why: Agent-to-agent tasks over HTTP.

22Who should own the final answer?Often asked
  1. AThe user
  2. BNobody
  3. COne agent that reconciles resultsCorrect answer
  4. DEvery agent separately

Why: Avoids conflicting outputs.

23A shared key updated from a subgraph into the parent needs…Often asked
  1. AA larger model
  2. BNo special handling
  3. CA reducer in the parent stateCorrect answer
  4. DA new thread

Why: Concurrent updates must be merged.

Sourced from Docs by LangChain (MCP)

24A per-dispatch timeout for one worker is set on…Often asked
  1. AThe thread ID
  2. BThe SendCorrect answer
  3. CThe checkpointer
  4. DThe system prompt

Why: It overrides the node's default timeout for that call.

Sourced from Docs by LangChain (MCP)

25Which lets a deployed graph be used as a subgraph node?Often asked
  1. AStateSchema
  2. BRemoteGraphCorrect answer
  3. CSend
  4. DToolMessage

Why: It exposes the same interface as a compiled graph.

Sourced from Docs by LangChain (MCP)

26For most handoff use cases, the docs recommend…Often asked
  1. ANo state at all
  2. BA single agent with middlewareCorrect answer
  3. COne subgraph per tool
  4. DA new graph per user

Why: It is simpler than multiple agent subgraphs.

Sourced from Docs by LangChain (MCP)

27When should a single agent be split?Sometimes asked
  1. ANever
  2. BWhen it is fast
  3. CWhen prompts or tools grow too largeCorrect answer
  4. DOn day one always

Why: Confirm with evaluations.

28How should progress be shown to users?Sometimes asked
  1. AOnly show errors
  2. BStream which agent is workingCorrect answer
  3. CHide everything
  4. DShow raw logs

Why: Builds trust during delays.

29Routing accuracy measures…Sometimes asked
  1. APrompt length
  2. BWhether the supervisor picked the right agentCorrect answer
  3. CNetwork speed
  4. DToken price

Why: A key multi-agent metric.

30Agents owned by separate teams may be deployed…Sometimes asked
  1. AAs separate services via APIs or A2ACorrect answer
  2. BOnly in one file
  3. COnly locally
  4. DNever

Why: Independent ownership.

31Large artifacts between agents should be…Sometimes asked
  1. AEmailed
  2. BStored outside and referencedCorrect answer
  3. CCopied into every prompt
  4. DDeleted

Why: References save a lot of tokens.

32A handoff tool usually passes the next agent…Sometimes asked
  1. AThe API keys
  2. BThe last AI message and a transfer ToolMessageCorrect answer
  3. CThe entire raw history
  4. DNothing

Why: Lean context avoids malformed or bloated histories.

Sourced from Docs by LangChain (MCP)

Track your progress through every blueprint in your dashboard.

Start learning