MULTI_AGENT_ORCHESTRATION
TUTORIALLearn how to build complex systems by coordinating specialized agents working together.
WHY_MULTI_AGENT#
Single agents are powerful, but they struggle with complex, multi-step workflows that require different "mindsets" or tools. By decomposing a task into sub-problems and assigning them to specialized agents, you can achieve higher accuracy and reliability.
THE_SPECIALIST_PRINCIPLE
Just as a software team has Product Managers, Engineers, and QA, a robust AI system should have specialized agents. A "Coder" agent shouldn't be responsible for "Product Strategy".
THE_PATTERN#
Complex tasks often require different "specialists". Instead of one giant prompt, we can use multiple agents:
ROUTER
Decides which specialist to call.
RESEARCHER
Gathers information.
WRITER
Synthesizes the final output.
BUILDING_A_RESEARCH_TEAM#
In this tutorial, we'll build a **Manager-Worker** system where a main agent delegates tasks to a Researcher and a Writer.
DEFINE_THE_SPECIALIST_AGENTS
First, create the specialized agents with narrow system prompts.
CREATE_THE_MANAGER_AGENT
The Manager needs a tool to "call" other agents. We'll wrap the specialists in a `Tool` interface.
RUN_THE_TEAM
Now you just interact with the Manager.