A request for a seaside town with good weather and an available hotel room spans travel information and accommodation booking. Agent orchestration coordinates specialized agents to handle such a request together, passing intermediate results between them rather than routing the request to only one specialist. section 12.3 section 12.4
A supervisor is an agent of agents: it decides which specialists to invoke, combines their results, and can revisit an agent during the same workflow. Each specialist acts as a tool for the supervisor and may have tools of its own. Unlike a one-time router, the supervisor can coordinate several calls for a multipart request. section 12.3.1 section 12.3.2
Listing 12.5 Setting up the leaf agents
travel_info_agent = create_react_agent(
model=llm_model,
tools=TOOLS,
state_schema=AgentState,
name="travel_info_agent",
prompt="""You are a helpful assistant that can search
travel information and get the weather forecast.
Only use the tools to find the information you
need (including town names).""",
)
accommodation_booking_agent = create_react_agent(
model=llm_model,
tools=BOOKING_TOOLS,
state_schema=AgentState,
name="accommodation_booking_agent",
prompt="""You are a helpful assistant that can check
hotel and BnB room availability and price for a
destination in Cornwall. You can use the tools
to get the information you need. If the user
does not specify the accommodation type, you
should check both hotels and BnBs.""",
)
Define uniquely named specialists with distinct prompts and tool sets: one finds travel information and weather, while the other checks accommodation. section 12.3.1
Listing 12.6 Setting up the Supervisor agent
travel_assistant = create_supervisor( #1
agents=[travel_info_agent,
accommodation_booking_agent], #2
model= ChatOpenAI(model="gpt-5",
use_responses_api=True), #3
supervisor_name="travel_assistant",
prompt=( #4
"""You are a supervisor that manages two agents:
a travel information agent and an accommodation booking agent. """
"""You can answer user questions that might require
calling both agents when needed. """
"""Decide which agent(s) to use for each user request
and coordinate their responses."""
)
).compile() #5
Pass the specialists to LangGraph’s create_supervisor, supply a model and a coordination prompt, and compile the result. The supervisor then decides which agents to call. section 12.3.1
Trace a combined travel request
For a Cornwall weather and accommodation question, a LangSmith trace shows the supervisor transferring to the travel information agent, which calls search and weather tools, then to the accommodation agent, which checks BnB availability and queries SQL. The request asks for a hotel, so the trace is also a reason to inspect whether the selected accommodation tool matches the request. section 12.3.3
Make coordination easier to inspect and maintain:
- Give each specialist a clear scope and tool list, and include its capabilities in the supervisor’s planning prompt. section 12.4
- Use structured formats such as JSON for data passed between agents; parsing unstructured communication increases error rates. section 12.4
- Track handoffs with current_agent and agent_history state fields, and inspect traces for incorrect tool choices or slow calls. section 12.4
- Compare supervisor models on complex requests; model choice can affect task decomposition and accuracy. section 12.3.1











