liveBook · Manning

Chapter 12: Multi-agent systems

What you will learn in chapter 12 of AI Agents and Applications

The chapter introduces the need to coordinate specialized agents in a travel assistant that handles both travel information and accommodation booking.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The chapter introduces the need to coordinate specialized agents in a travel assistant that handles both travel information and accommodation booking.

Key terms: single, specialized agent, multi-agent travel assistant, travel information agent, accommodation booking agent

12.1 Building an accommodation booking agent

The section introduces accommodation booking as a way to make a travel assistant capable of acting, not just retrieving information.

Key terms: information retrieval, ability to act, travel assistant

12.1.1 Hotel booking tool

The section prepares a local hotel database and makes it available to an agent through LangChain’s SQL Database toolkit.

Key terms: SQL Database toolkit, agent tools, SQLite database, tool calls, hotel_db, cornwall_hotels_schema.sql, SQLite shell, LangChain SQL integration libraries

12.1.2 B&B booking tool

This subsection introduces a B&B availability tool backed by a REST service and uses a mock service for development and testing.

Key terms: B&B booking tool, REST service, BnBBookingService, check_bnb_availability

12.1.3 ReAct accommodation booking agent

This section introduces a ReAct accommodation booking agent that uses hotel and B&B tools, then identifies why it is not yet a unified travel assistant.

Key terms: ReAct accommodation booking agent, hotel database, mock B&B service, travel information agent, accommodation booking agent, unified experience

12.2 Building a router-based travel assistant

Introduces a router agent that directs travel information and accommodation booking requests to the appropriate specialized agent within one conversation.

Key terms: router agent, travel information agent, accommodation booking agent, specialized agent

12.2.1 Designing the router agent

This section sets up a router agent to return a structured choice between two agents in a multi-agent travel assistant.

Key terms: router agent, enumeration, Pydantic model, structured format, travel_info_agent, accommodation_booking_agent

12.2.2 Routing logic

This section explains how a LangGraph router classifies a user request and hands it to the selected specialist agent.

Key terms: system prompt, router agent, entry node, AgentTypeOutput, Command, travel information agent

12.2.3 Building the multi-agent graph

This section explains how the router-based travel assistant graph connects to specialist agents and why its architecture combines workflow routing with flexible tool use.

Key terms: router agent, travel information agent, accommodation booking agent, Command, explicit edges, hybrid architecture, workflow-driven routing logic, specialist agent, tool-based decision process

12.2.4 Trying out the router agent

This section shows how the router-based travel assistant sends each question to one specialist agent and then ends the workflow.

Key terms: router agent, travel information agent, accommodation booking agent, one-way ticket

12.3 Handling multi-agent requests with a Supervisor component

The section explains why a router-based travel assistant cannot handle requests that need both specialist agents and introduces the Supervisor as a way to coordinate them.

Key terms: router-based design, travel information agent, accommodation booking agent, Supervisor, intermediate results

12.3.1 The Supervisor pattern: An agent of agents

This section introduces the Supervisor as an agent that coordinates specialized agents and explains the main choices involved in setting one up for the travel assistant.

Key terms: Supervisor, agent of agents, orchestrator, specialized tool, ReAct agent, unique name, list of agents, powerful LLM, complex multi-step requests, task decomposition

12.3.2 From “one-way” to “return ticket” interactions

This section contrasts one-time router dispatch with a Supervisor that can coordinate and revisit specialized agents to handle multipart travel requests.

Key terms: workflow-based router, Supervisor, one-way ticket, return tickets, intermediate results, high-level orchestration, low-level orchestration, tool-based approach

12.3.3 Trying out the Supervisor agent

A LangSmith trace shows how a Supervisor travel assistant coordinates two specialist agents to answer a multi-part request.

Key terms: Supervisor, travel_assistant, travel_info_agent, accommodation_booking_agent, agents as tools, LangSmith trace

12.4 Summary

This summary contrasts router and supervisor agents and recaps practices for making multi-agent handoffs reliable and observable.

Where this is used later

Concepts explained in this chapter

← Chapter 11: Building tool-based agents with LangGraph Chapter 13: Building and consuming MCP servers →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.