9 Orchestrating multi-agent systems
This chapter covers
- Three collaboration patterns: Workflow, Agent as Tool, and Transfer
- Implementing composable workflows with Sequential, Parallel, and Loop
- Wrapping agents as tools with context isolation
- Transferring control between agents using a dynamically created transfer tool
- Connecting agents across networks with the A2A protocol
Throughout this book, we've explored how a single agent can perform diverse tasks. By assigning roles through system prompts and providing tools, we enabled capabilities like web search, calculation, and code execution. A single agent alone could solve many problems in the GAIA benchmark. But real-world problems are more complex. As an agent's responsibilities grow, system prompts become longer, and the number of required tools increases. It's like expecting one person to be a developer, product manager, designer, and operations specialist all at once. No matter how capable someone is, performance suffers when roles multiply. We’ll address this challenge by implementing a multi-agent system where multiple agents collaborate. We'll assign each agent a specialized role and dedicated tools, then orchestrate them to work together.