liveBook · Manning

Agent orchestration

As explained in AI Agents and Applications

A supervisor agent is an agent that coordinates a group of more granular agents to accomplish a larger task.

Suppose a traveler asks for a seaside Cornwall town with good weather and the price of a double hotel room there. A travel-information agent can find the town; a booking agent can check rooms. A router that sends the entire request to just one agent cannot readily combine their work. Agent orchestration lets a supervisor coordinate both specialists and use the first agent’s result in the next step. section 12.3

A supervisor is an agent of agents. It treats specialized agents as callable tools, decides which to invoke, and can call an agent again as new information arrives. This differs from one-time routing: a request may move between specialists several times before the supervisor responds. section 12.3.1 section 12.3.2

To assemble a travel assistant:

  • Create named specialist agents with distinct prompts and tools: one for travel information and weather, another for accommodation availability and prices. section 12.3.1
  • Install langgraph-supervisor, pass the specialists to create_supervisor, give the supervisor a coordination prompt and model, then compile and invoke it. section 12.3.1
  • Describe each specialist’s capabilities to the supervisor. Use structured JSON for data passed between agents, and track handoffs in state with current_agent and agent_history. section 12.4
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

The configuration shows the essential wiring: a list of specialist agents, a supervisor model, an explicit coordination prompt, and a compiled assistant. section 12.3.1

Check the handoffs, not just the final answer

A LangSmith trace of the combined travel-and-booking request shows the supervisor transferring to the travel agent for search and weather, then to the accommodation agent for availability and a database query. The recorded path includes a BnB availability call even though the sample request specifies a hotel room. Inspect tool choices and intermediate results rather than assuming that coordination guarantees the requested accommodation type. section 12.3.3 section 12.4

How AI Agents and Applications covers it

How deep it goes
Works through specialist setup, supervisor configuration, invocation, and traced handoffs; does not detail the supervisor’s internal decision algorithm.
Examples
Uses a Cornwall weather-and-hotel request, named travel and booking agents, a supervisor configuration, and an execution trace.
What it assumes
Builds on ReAct agents with assigned names, prompts, tools, and state; adapts a prior agent implementation.
What you can do after
Apply it via LangGraph’s create_supervisor to coordinate named specialists and diagnose their handoffs with LangSmith.
How it connects
Connects ReAct agents, tool calling, router agents, shared state, and LangSmith tracing.

Also explained in

Compare how 11 books explain agent orchestration →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents and Applications. The section links point to the parts of the book it draws on.