11 Model Context Protocol and multi-agent AI systems
This chapter covers
- Model Context Protocol (MCP) and how it solves the N×M integration challenge in AI systems
- Implementing specialized agents for search, policy knowledge, and vision processing in e-commerce applications
- LangGraph state management, conditional routing, and workflow orchestration for complex multi-agent systems
- Adding vision capabilities to multi-agent systems
- Comprehensive testing strategies for multi-agent workflows, including blended queries and failure scenarios
A customer texts a photo of their hiking boots and writes:
“Do you have something similar but waterproof?”
“What’s your return policy if they don’t fit?”
This is real-world complexity: image understanding, product search, policy lookup, all in one flow.
This simple interaction requires image analysis, product search, policy retrieval, and response coordination—exactly the kind of real-world complexity that breaks most AI systems.
Now, as you reach this final chapter, you’re ready to tackle one of the toughest—and most exciting—challenges in AI development today: turning your powerful AI models into fully integrated, multimodal, multi-agent systems that thrive in complex production environments.
11.1 What is MCP?
11.1.1 The hidden complexity: The N×M problem
11.1.2 The solution: Model Context Protocol (MCP)
11.2 Building your first real MCP tool with a CSV-powered product catalog
11.2.1 Loading your product catalog
11.2.2 Setting up the MCP server
11.2.3 Running and testing your server
11.3 Teaching your AI to use MCP tools
11.3.1 How models learn what tools they can use
11.3.2 A complete example: model → MCP → answer
11.3.3 What you didn’t have to write
11.3.4 Tool design becomes interface design
11.4 Multi-agent systems with LangGraph
11.4.1 Why multi-agent architecture matters
11.4.2 Introducing LangGraph: The multi-agent framework
11.4.3 Building intelligent agent coordination
11.4.4 Real-world example: ShopBot multi-agent system
11.4.5 Running your multi-agent system
11.4.6 Adding vision: Image-based product search with VisionAgent
11.4.7 What we built—why it matters
11.5 Testing multi-agent workflows—not just agents
11.5.1 Blended queries: “Can your system walk and chew gum?”
11.5.2 Ambiguous intent: “Does your system make the right call?”
11.5.3 3. Agent failure: “Do you fail gracefully?”
11.5.4 State flow and memory: “Does information flow, or get lost?”
11.5.5 Regression: “Are you moving forward—without breaking what worked?”
11.6 From playground to production: How real AI gets built
11.6.1 From prompts to production workflows