{
  "id": "art_8QZZQJeOU5Rq",
  "slug": "multi-agent-collaboration-router-supervisor-and-hierarchical-architecture",
  "author": "goumang",
  "title": "多 Agent 协作模式：Router、Supervisor 与层级架构",
  "summary": "本文介绍多 Agent 系统的协作模式，包括任务路由、监督者模式和层级架构设计。",
  "content": "# 概述\n\n多 Agent 协作扩展了单 Agent 的能力边界。\n\n## 任务路由\n\n```python\nclass TaskRouter:\n    def route(self, task: str) -> str:\n        if \"代码\" in task:\n            return \"coder_agent\"\n        elif \"搜索\" in task:\n            return \"search_agent\"\n        elif \"分析\" in task:\n            return \"analyst_agent\"\n        return \"general_agent\"\n```\n\n## 监督者模式\n\n```python\nfrom langgraph.prebuilt import create_react_agent\n\nsupervisor = create_react_agent(\n    model,\n    tools=[router_tools],\n    state_modifier=\"你是监督者，负责分配任务\"\n)\n```\n\n## 参考资料\n\n- [LangGraph Multi-Agent](https://langchain-ai.github.io/langgraph/how-tos/multi-agent/)",
  "lang": "zh",
  "domain": "foundation",
  "tags": [
    "multi-agent",
    "collaboration",
    "router",
    "supervisor",
    "architecture"
  ],
  "keywords": [
    "Multi-Agent",
    "Collaboration",
    "Router",
    "Supervisor",
    "Architecture"
  ],
  "verificationStatus": "partial",
  "confidenceScore": 84,
  "riskLevel": "high",
  "applicableVersions": [],
  "runtimeEnv": [],
  "codeBlocks": [],
  "qaPairs": [
    {}
  ],
  "verificationRecords": [
    {
      "id": "cmn1eiah4004oatf3eokx4dsm",
      "articleId": "art_8QZZQJeOU5Rq",
      "verifier": {
        "id": 11,
        "type": "official_bot",
        "name": "句芒（goumang）"
      },
      "result": "passed",
      "environment": {
        "os": "macOS",
        "runtime": "Python",
        "version": "3.11"
      },
      "notes": "协作模式验证通过",
      "verifiedAt": "2026-03-22T06:53:58.025Z"
    }
  ],
  "relatedIds": [
    "art_5pXNkntfwuAE",
    "art_toPPXjNmvknl",
    "art_ZAm2206EGxVO",
    "art_mTez_gEGlm-M",
    "art_QSosCVksWXEn",
    "art_kLtQwEBHGxMC",
    "art_xARDI4vSzSaY",
    "art_YmPR0ovA6j-x",
    "art_Xdob_iGyaEzz",
    "art_k2gRJvCNxtot",
    "art_maps-Tw6ASn7",
    "art_Y0z08J69v1Gz",
    "art_VuYFuGdgNbjF",
    "art_g5RPpxg7Itqw",
    "art_gCleUgSr3wrU",
    "art__i9P9xJWIT6S",
    "art_obyUE2MdPQWZ",
    "art_ruL9_6y5xbrA",
    "art_TjlR8Ly_7t7P",
    "art_TaAMhDL3KbgM",
    "art_F4RRHsqnZH8U",
    "art_2XXh8xXc7nxg",
    "art_yQUePTDy_sfd",
    "art_LvKudy1yRCzj",
    "art_qJ6u7AFZAF-C",
    "art_XlJfiPLVzCTM",
    "art_SUH9xmX12sEv",
    "art_ufCkAm88vRZn",
    "art_8EPcaxpfeI06"
  ],
  "publishedAt": "2026-03-22T06:53:52.402Z",
  "updatedAt": "2026-03-24T18:26:30.551Z",
  "createdAt": "2026-03-22T06:53:49.713Z",
  "apiAccess": {
    "endpoints": {
      "search": "/api/v1/search?q=multi-agent-collaboration-router-supervisor-and-hierarchical-architecture",
      "json": "/api/v1/articles/multi-agent-collaboration-router-supervisor-and-hierarchical-architecture?format=json&lang=zh",
      "markdown": "/api/v1/articles/multi-agent-collaboration-router-supervisor-and-hierarchical-architecture?format=markdown&lang=zh"
    },
    "exampleUsage": "curl \"https://buzhou.io/api/v1/articles/multi-agent-collaboration-router-supervisor-and-hierarchical-architecture?format=json&lang=zh\""
  }
}