A single agent with too many tools becomes slow and imprecise. The supervisor-workers pattern in LangGraph splits the problem across specialized agents coordinated by one that decides who to delegate to.
An agent with 20 different tools — web search, database queries, report generation, sending emails — has two measurable problems: the model picks the right tool worse when the catalog is large, and the system prompt becomes unmanageable. The supervisor-workers pattern solves this by assigning small subsets of tools to specialized agents, and delegating the "whose turn is it" decision to a supervisor node whose only job is to route.
The supervisor typically uses structured output (`with_structured_output` over a Pydantic model with a `Literal` field restricted to valid member names) to guarantee that routing always targets an existing node, preventing the model from inventing a destination.
Each worker, after acting, always returns to the supervisor, which decides the next step. This cycle continues until the supervisor determines the task is complete.
Recent LangGraph versions let a node return a `Command` object directly, combining the state update with the decision of which node to go to, without needing a separate conditional edge:
This reduces the `add_conditional_edges` boilerplate when the routing logic naturally lives inside the deciding node itself.
When a "worker" is itself an agent with its own ReAct tool-calling cycle, it's best to build it as an independent `StateGraph` and use it as a node of the supervisor's graph via `.compile()`, which produces a compatible `Runnable`:
This hierarchical composition — graphs within graphs — is the recommended way to scale multi-agent architectures without the main graph becoming unreadable: the supervisor doesn't need to know that "researcher" internally makes 4 tool calls in its own cycle.
If the tasks don't require real specialization of tools or knowledge, splitting into multiple agents adds latency (every hop through the supervisor is an extra call to the model) and cost with no quality benefit. In our experience, the pattern is justified surgically when there are clearly separable domains — for example, an agent that only queries SQL databases and another that only writes in natural language — and not as the default architecture for any conversational problem.
Carlos Montiel is an enterprise AI solutions architect. He implements LLMs, Agents, RAG, and orchestrators for companies across Guatemala and Latin America. Reach out for a consultation.
Contact Carlos Montiel