-
react_agent: 单 Agent + 工具;
-
supervisor_agent: 多 Agent 协作
3.planning_agent: 任务拆解;
LangGraph 主要有这 3 种核心模式,其他都是变体:
|----------------|-----------------|---------------------------------|
| 模式 | 来源 | 说明 |
| planning_agent | StateGraph 自定义 | 任务拆解,逐步执行 |
| swarm | langgraph-swarm | 去中心化,Agent 之间直接交接,没有 Supervisor |
其中 swarm 是 langgraph-supervisor 的姊妹包,也值得考虑:
supervisor: 用户 → Supervisor → Agent A → Supervisor → Agent B → Supervisor → 回复
swarm: 用户 → Agent A → Agent B → Agent C → 回复(谁合适谁接)