为什么要组队?——从单智能体到多智能体的故事
为什么要组队?——从单智能体到多智能体的故事
Imagine you have the smartest person in the world sitting at a desk. Could that person, alone, build a skyscraper? Probably not — no matter how brilliant they are. Could they treat every patient in a hospital, write every line of code for Windows, and design every circuit in an iPhone, all on the same day? Definitely not.
But here's the funny thing: when we talk about AI, many people — including some very smart engineers — implicitly believe that we just need "a smarter model," and then it can do everything. Just make GPT-5, GPT-6, GPT-∞ bigger, train it on more data, give it more parameters, and *bam*, we have an artificial general intelligence that solves every problem in the universe.
This is the most expensive misunderstanding in modern AI.
History tells a different story. Human civilization didn't become powerful because we evolved one giant brain with 86 billion neurons packed into a single skull that does everything. We became powerful because we learned to *cooperate*. We form teams, companies, armies, orchestras, research labs. A team of ordinary humans routinely outperforms a single genius working alone.
The same insight applies to AI. As Large Language Models (LLMs) like GPT-4, Claude, and Gemini have shown incredible single-agent capabilities, we've also discovered their hard limits — limits that no amount of scaling seems to fix. And that's why Multi-Agent Systems (MAS) have become one of the hottest research and engineering topics in 2024–2026.
This chapter answers one question: Why don't we just train one super-smart AI, instead of making multiple AIs work together?
By the end of this chapter, you should be able to:
- Explain in plain language what an "Agent" is and what a "Multi-Agent System" is.
- Name the three biggest bottlenecks of a single LLM-based agent.
- Name the four superpowers you get when you put multiple agents together.
- Use one picture to explain to a friend why "letting multiple AIs collaborate" is valuable.
- Decide, for your own task, whether it's worth assembling an AI team.
Let's dive in.
---
一、一个聪明人 vs 一支足球队——重新理解"智能体"
Before we can talk about *teams* of AIs, we need to agree on what an "AI" (or more precisely, an *Agent*) even is. Otherwise, the rest of this book will sound like science fiction.
1.1 一个反直觉的事实:最强的 AI 也会"卡壳"
Let's start with an experiment you can run yourself. Take any modern LLM — ChatGPT, Claude, Gemini, Kimi, DeepSeek, you name it. Give it this prompt:
> "Please write a complete, working, production-ready online bookstore in Python, with a frontend, a backend, a database, 100 unit tests, a Dockerfile, and a deployment guide. Include all edge cases."
What happens?
- A truly powerful model will produce a *partial* result: maybe a half-decent backend, a sketch of the database, and a vague Docker section.
- It will forget parts of your request by the time it reaches the end.
- It will hallucinate functions that don't exist.
- It will run out of focus before finishing the tests.
- The "production-ready" claim will be, let's say, optimistic.
Does this mean the model is stupid? No. It means a single agent, no matter how powerful, has structural limits. Just like Lionel Messi, the greatest football player ever, cannot win the World Cup alone. He needs 10 teammates, a coach, a physio, a tactics analyst, and a federation that pays for stadiums.
> 关键洞察 (Key Insight):智能再强,也受限于"单体结构"。这是物理规律,不是 bug。
1.2 Agent 的最小定义:感知 → 思考 → 行动
So what *is* an Agent? In the LLM era, an Agent is, at minimum, an entity that follows this loop:
``` Perception (感知) → Reasoning (思考) → Action (行动) → Observe (观察) → Reasoning ... ```
Let's unpack each step with a concrete example — imagine an Agent whose job is to order you a coffee.
| 步骤 | 中文 | 英文 | 在咖啡订单里的表现 | |---|---|---|---| | 1 | 感知 | Perception | 听到你说"我要一杯燕麦拿铁,少糖" | | 2 | 思考 | Reasoning | 推断:燕麦拿铁 = 燕麦奶 + 浓缩咖啡;少糖 = 半糖 | | 3 | 行动 | Action | 调用咖啡 App 的下单 API | | 4 | 观察 | Observation | App 返回:"下单成功,预计 8 分钟后送达" | | 5 | 回到 2 | Loop | 思考是否需要再次确认订单,或者继续做下一件事 |
In code, an Agent looks like this (pseudocode):
```python class Agent: def __init__(self, llm, tools, memory): self.llm = llm # 大语言模型:负责"思考" self.tools = tools # 工具集:负责"行动" self.memory = memory # 记忆:负责"感知历史"
def step(self, observation):
1. 感知 (Perception)
context = self.memory.update(observation)
2. 思考 (Reasoning)
plan = self.llm.think(context, available_tools=self.tools)
3. 行动 (Action)
result = self.execute(plan)
4. 返回新的观察结果
return result ```
This is the *minimal* Agent. Real-world Agents add more layers — planning modules, reflection modules, self-critique, multiple memory types — but the core loop is always the same. If your system has perception, reasoning, action, and a loop, you have an Agent.
> 📌 术语对照表 (Glossary) > > | 中文 | English | 一句话解释 | > |---|---|---| > | 智能体 | Agent | 能感知环境、做出决策、执行动作的实体 | > | 单智能体 | Single Agent | 只有一个 Agent 在干活 | > | 多智能体 | Multi-Agent | 两个或以上的 Agent 互相协作 | > | 大语言模型 | Large Language Model, LLM | GPT-4、Claude 这类文本生成模型 | > | 工具 | Tool | Agent 可以调用的外部能力(搜索、代码、API) | > | 记忆 | Memory | Agent 跨步骤保留的信息 |
1.3 一支足球队 vs 一个天才球员
Now the analogy hits. A solo Messi can dribble past 5 defenders, but he cannot play against 11 opponents alone for 90 minutes without help. He needs:
- **A goalkeeper** who specializes in a totally different skill (stopping shots, not scoring).
- **Defenders** who excel at positioning and tackling.
- **Midfielders** who excel at passing and vision.
- **Forwards** who excel at finishing.
- **A coach** who decides tactics, substitutions, and training.
- **A medical team** who prevents injuries.
- **A scouting team** who finds opponents' weaknesses.
Notice that *each of these roles requires different training, different tools, and different mindsets*. You cannot teach a single human to be all of them at once — there simply aren't enough hours in a day, and the human brain cannot deeply specialize in 10 contradictory skills at the same time.
Now apply the same logic to LLM-based agents. Today's frontier models are incredibly *generalist* — they can chat, code, reason, write poetry, and translate. But "generalist" is not the same as "specialist." Just as you wouldn't ask your family doctor to perform brain surgery, you shouldn't ask a single general LLM to do everything in a complex project.
This is the seed of multi-agent systems: specialize, divide, cooperate.
---
二、单智能体的三座大山:上下文、工具、专业
If single agents are so great, why do we need teams at all? Because every single agent, no matter how advanced, eventually runs into three structural mountains. You cannot climb them by scaling the model alone — you have to *change the architecture*. Multi-agent is one such architectural change.
Let's name the three mountains.
2.1 第一座山:上下文窗口的物理上限
2.1.1 什么是上下文窗口
When you chat with an LLM, the model doesn't "remember" anything between conversations. Every time you send a message, the entire conversation history (plus system prompt, plus tools, plus your new message) is concatenated into one giant text blob and fed to the model. This blob has a size limit, called the context window (上下文窗口 / Context Window).
Think of it like a *notebook* that the model holds in its hand. The notebook has a fixed number of pages. As the conversation grows, the model fills more pages. Once the notebook is full, it must either:
- **Forget older pages** (truncation), or
- **Compress old pages into summaries** (summarization), or
- **Throw the whole notebook away and start over** (new session).
It cannot magically grow more pages.
2.1.2 当前模型的窗口有多大
As of early 2026, frontier models have context windows roughly like this:
| 模型 | 上下文窗口 | 大约相当于 | |---|---|---| | GPT-4o (2024) | 128K tokens | 一本中等长度的书 | | Claude 3.5 Sonnet | 200K tokens | 一本长篇小说 | | Gemini 1.5 Pro | 1M–2M to