Multi-Agent Systems
Overview
A multi-agent system is a team of agents where each has its own role and passes the result to the next one.
Why Multiple Agents
A single agent with a huge prompt often gets confused: too many instructions and tools. A multi-agent system divides the task into roles.
Example team:
Researcher → Copywriter → Editor
Each agent does one thing well and passes the result to the next.
How Interaction is Built
There are two main approaches:
1. Pipeline (Sequential)
The result of the first agent goes to the input of the second. This is how CrewAI works in Sequential mode.
2. Forked Graph
Agents are connected like nodes in a graph: after a step, you can return, repeat, or call a human. This is the approach of LangGraph.
Example: Autonomous Developer
flowchart LR
A[Planner] --> B[Coder]
B --> C[Tester]
C --> D{Errors?}
D -->|Yes| B
D -->|No| E[Ready]
What Makes a Multi-Agent System Different from a Single Agent
| Criteria | Single Agent | Multi-Agent System |
|---|---|---|
| Prompt Complexity | Large | Small roles |
| Control | Weaker | Each step is visible |
| Scalability | Limited | Easy to add a role |
Risks
- Agents may contradict each other;
- An early error accumulates;
- Each transition costs tokens.
Therefore, it's important to log each step and add checks.