skip to content

In a supervisor system, how does agent-as-tool differ from agent-as-graph-node?

level: middleimportance: should knowfreq 44%

answer

  1. who owns control after the specialist runs
  2. where the run's state actually lives
  3. the input schema is the isolation boundary
  4. externalized state enables checkpoint and resume
  5. graphs declare which transitions are legal

basics

~20 s

Agent-as-tool exposes each specialist as a callable the supervisor's model invokes, so control always returns and the reply lands in the supervisor's context as a tool result. Agent-as-graph-node makes each specialist a node in an explicit state machine, with edges deciding where control goes and shared state carrying the work.

solid answer

~50 s

Both wire a supervisor to specialists, but they differ in who owns control and where state lives. With **agent-as-tool**, the specialist is described like any other tool - a name, a description, an input schema - and the supervisor's model calls it. The specialist runs its own loop on just the arguments it was given, returns a value, and that value appears as a tool result inside the supervisor's context. Control return is automatic, and the argument schema doubles as a context-isolation boundary. With **agent-as-graph-node**, the supervisor is a node in a graph; routing means picking the next node, agents read and write a shared state object, and edges define what may follow what. That shape is what you want when you need durable checkpointing, resume after a crash or a human pause, streaming of intermediate steps, and explicit legal transitions. Agent-as-tool is the cheaper default; the graph earns its wiring when runs are long or must survive interruption.

code

json · 12 lines
json
{
  "name": "permits_agent",
  "description": "Handles building, zoning and occupancy permit questions. Not for rent disputes.",
  "input_schema": {
    "type": "object",
    "properties": {
      "task": { "type": "string", "description": "Self-contained sub-task for this specialist" },
      "address": { "type": "string" }
    },
    "required": ["task"]
  }
}

go deeper

for a junior

Know that a specialist agent can be exposed to a supervisor like a tool it calls, and that the specialist's answer comes back to the supervisor rather than going straight to the user.

for a middle

Explain both wirings and what each implies: automatic control return and schema-bounded context for the tool shape, shared external state and declared transitions for the node shape.

for a senior

Justify the choice from operational needs - crash resume, human approval pauses, step-level streaming - and call out the single-writer discipline that keeps shared graph state from becoming a merge problem.

for a principal

Own the platform decision: whether teams get a durable orchestration substrate by default or build tool-shaped supervisors, and what that implies for observability standards, replayability, and the cost of migrating a system that outgrows the simpler shape.

## Two ways to wire the same topology Supervision is a topology - one router, many specialists, control returning to the router. It says nothing about the implementation. In practice two implementations dominate, and interviewers ask you to compare them because the choice changes what your system can do under failure. ## Agent-as-tool Here each specialist is presented to the supervisor's model as a tool: a name, a description of when to use it, and an input schema describing what the supervisor must pass. The supervisor's model emits a tool call; the runtime starts the specialist agent with those arguments; the specialist runs its own internal loop with its own tools; it returns a value; the runtime feeds that value back as a tool result in the supervisor's conversation. Three consequences follow. **Control return is structural.** A tool call cannot fail to come back - the supervisor is always the next actor. You cannot accidentally build a system where a specialist wanders off with the conversation, which is exactly the failure mode of peer transfer designs. **The schema is a contract.** Because the supervisor must fill in the specialist's input schema, it is forced to state the sub-task explicitly rather than dumping the whole conversation. The specialist sees only those arguments, so its context is naturally isolated. Making the return value a short structured summary rather than a full transcript is the matching half of the contract. **It composes with everything the model already does.** Routing becomes ordinary tool selection, so parallel tool calls, tool-choice controls, and existing tracing all apply unchanged. This is why the pattern is so common: there is almost no new machinery. The limits are real, though. The whole run lives inside one long-running model conversation, so a crash loses it unless you persist the conversation yourself. Intermediate progress inside a specialist is invisible to the caller until it returns. And the tool-call framing nudges the supervisor toward treating specialists as one-shot functions rather than collaborators you revisit. ## Agent-as-graph-node Here the system is an explicit state machine. Each agent is a node; the supervisor is a node whose job is to compute the next node; edges declare which transitions are legal; and a shared state object - typically a message list plus task fields - is threaded through every node, with each node returning an update to it. What this buys you: - **Durability.** A checkpointer persists state after each node, so a run can resume after a process crash, a rate-limit backoff, or an overnight wait for a human approval. - **Interruption and resumption.** Because state is external and addressable, you can pause before a node, let a human edit the state, and resume - which is awkward when the run only exists as an in-flight tool call. - **Explicit legality.** Edges document what may follow what. That is auditable in a way a model's free tool choice is not, and it lets you forbid transitions outright rather than hoping the prompt discourages them. - **Observability.** Node boundaries are natural spans, so you get step-level traces and streaming of intermediate updates for free. The costs are wiring effort and a shared-state footgun: if several nodes write the same state keys, you have introduced concurrent writers and the reconciliation problem that comes with them. Keeping writes single-threaded - one node owns each field - is the discipline that keeps graphs sane. Both shapes are available in mainstream tooling; LangGraph, for instance, ships a prebuilt supervisor constructor as well as the raw graph primitives, so the choice is a design decision rather than a framework constraint. ## Choosing between them Reach for **agent-as-tool** when the run is short, synchronous, and user-facing: a 311 triage supervisor that consults two specialists and answers within a minute. Reach for **agent-as-graph-node** when the run is long, must survive restarts, involves a human approval gate, or needs step-level streaming into a UI. A common hybrid is a graph at the top level for durability, with individual nodes internally calling small specialists as tools. The answer that lands in an interview is not "tools are simpler" but the causal chain: tool-shaped invocation guarantees control return and isolates context via the argument schema, while node-shaped invocation externalizes state and therefore makes checkpointing, human interruption, and explicit transition rules possible.

  • Why does the agent-as-tool shape give you context isolation almost for free?
    Because the supervisor must fill in the specialist's input schema to call it. That forces an explicit statement of the sub-task instead of forwarding the whole conversation, so the specialist starts from a clean, minimal context. Pairing it with a short structured return value closes the loop, keeping the specialist's internal reasoning out of the supervisor's window.
  • What breaks first when you scale an agent-as-tool supervisor to a run that lasts an hour with a human approval in the middle?
    Durability. The run exists only as an in-flight conversation, so a crash, deploy, or timeout loses it, and there is no natural place to pause and resume around the human. That is the point where an externalized state graph with a checkpointer stops being over-engineering.

saying these in an interview costs you the question

  • Thinks agent-as-tool and graph nodes are different topologies rather than implementations
  • Says the specialist keeps control after a tool-style invocation
  • Believes a tool-invoked specialist automatically sees the full conversation
  • Adds a durable graph purely for a short synchronous request-response run
  • Lets several graph nodes write the same state field concurrently

context