chapter eight

8 Multi-Agent Systems

 

This chapter covers

  • Why multi-agent architecture outperforms monolithic AI systems
  • Implementing specialized agents for search, policy knowledge, and vision processing
  • Orchestrating complex workflows with LangGraph's state management and conditional routing
  • Testing multi-agent systems for production reliability

A customer texts a photo of their hiking boots and writes: "Do you have something similar but waterproof?" Seconds later, they add: "What's your return policy if they don't fit?" This single interaction requires image analysis, product search, policy retrieval, and response coordination—exactly the kind of real-world complexity that breaks most AI systems.

In Chapter 7, you built individual MCP tools that AI models can discover and use for searching products, checking inventory, and handling errors gracefully. These tools are powerful, but they're also isolated. Each one does its job well, but none of them knows about the others. None of them can decide when to hand off to another tool, or how to combine results into a coherent response.

Real-world applications demand more. When a customer uploads a photo and asks about return policies in the same breath, your system needs to:

  • Recognize that this is a multi-part request
  • Route the image to a vision model for understanding
  • Send the product query to your search tool
  • Fetch return policy information from your knowledge base
  • Combine all of this into a single, helpful response

8.1 Multi-agent systems

8.1.1 Why multi-agent architecture matters

8.1.2 Introducing LangGraph: The multi-agent framework

8.1.3 Building intelligent agent coordination

8.1.4 Real-world example: ShopBot multi-agent system

8.1.5 Running your multi-agent system

8.1.6 Adding vision: Image-based product search with VisionAgent

8.1.7 What we built—why it matters

8.2 Testing multi-agent workflows—not just agents

8.2.1 Category 1: Blended queries and multi-model interactions

8.2.2 Category 2: Ambiguous intent and robust routing decisions

8.2.3 Category 3: Agent failure and resilience verification

8.2.4 Category 4: State flow and information preservation across workflow

8.2.5 Regression: “Are you moving forward—without breaking what worked?”

8.3 Alternative frameworks: CrewAI

8.3.1 LangGraph vs CrewAI: Different philosophies

8.3.2 ShopBot with CrewAI

8.3.3 When to use which multi-agent framework

8.3.4 The framework landscape

8.4 Summary

8.5 References