Margrop
Articles271
Tags700
Categories6

Categories

1password 24GB VRAM 2K 3.6 Flash 30B dense 4-bit 量化 6-DoF SLAM AC ACP AI & Economy ATLAS AI Agent AI Coding Assistant AI Tech AI Workflow AI tutor AI 基础设施 AI 安全 AI 工程 AI 应用 AI 日记 AI 生产力 AI编程助手 ALTK-Evolve AMIE AP API API 定价 API 降价 ARC-AGI-3 ASR ATEM chat 模板 AUTOMATIC1111 Agent Agent Harness Agent Memory Agent 入侵 Agent 可靠性 Agent 工程 Agent 架构 Agent 检索 Agent 沙箱 Agent 系统 Agent 训练 Agent 记忆 Agent 路由 Agentic AI Agentic tools Ai2 Alertmanager AllenAI Android 17 Antigravity AppDaemon AppWorld Aqara Astra Async GRPO Attention Baseten Benchmark CC-Switch CI/CD CLI Tools CLI工具 CPU 推理 Cache Hit Rate Caddy ChatGPT Claude Code Claude Sonnet ClawLoader Code Interpreter CodeMender Codex Coding Agent ComfyUI Computer Use Cookie 认证 Cosmos-H-Dreams Cost Optimization Cron Cybersecurity DFIR DSpark Date DeepSeek DeepSeek V4 Flash Diagrams.net Diary Diffusers Diffusion Docker Efficiency Tools Embedding English Evaluation Cards FSDP2 Fable 5 Fireworks AI FlashAttention FlashDreams Function Calling Funes GGUF GLM 5.2 GLM-5.2 GPT-4.1 GPT-5.6 GPT-5.6 Sol GPT-Live GPT-Live-1 GPT-Red GPU 加速 GPU 性能分析 GRPO Gateway Gemini Gemini 3.5 Flash Gemini 3.7 Flash Gemini API Gemini CLI Gemini Omni Flash Gemma 4 12B Gemma Translator Gemma4 GitHub Actions Google Google AI Google Beam Google Data Commons Google DeepMind Google Research Google Sheets Grabette Gradio Gradio Workflow Gripette HA HADashboard HF Security Incident Hailuo Hermes Hexo HomeAssistant Hugging Face IBM Granite IBM Research Inference Providers Isaac Lab JSON Output Java KV cache Kimi K3 Kubernetes LFM2.5 LFM2.5-VL LLM Router LLM 安全 LLM 工程 LLM 评测 LVM‑Thin Late Interaction LeRobot Linux Liquid AI LiquidAI Live Translate LoRA Luna MCP MTP MacOS Magpie TTS Managed Agents Meta Microsoft 365 Copilot MiniMax Mistral Shieldstral Model Routing MuJoCo Warp Multi-Agent Multi-Vector Muse Glimmer MySQL NAS NIM NVIDIA NeMo Automodel Nemotron 3 Embed NeoMME Newton Nginx Node.js Nunchaku OCR OOM OlmoEarth On-device AI Open Source OpenAI OpenAI Codex OpenAI 兼容 OpenClaw OpenCode OpenResty OpenWrt PII 检测 Physical AI Pollen Robotics Portainer PostgreSQL ProcessOn Project Astra Prometheus Prompt Caching Prompt Injection Proxmox VE PyTorch Qwen3 Qwen3-VL Qwen3.6 RAG RPC RTEB Real-Time Inference Red Teaming Responses API SNAP SOCKS5 SPED SVDQuant Schema Scientific Computing Self-Forcing Distillation Sentence Transformers Session Sheets canvas Shell Sol Storage Buckets Strands Agents Subagent Surgical Robotics TRL TTS Terra Think button TimeMachine Tokenizer Transformers TutorMoments UML Uptime Kuma V4-Pro VPS Voice Agent VoiceEQ WARP WebRTC WebSocket Windows World Foundation Model agent agentic aligenie aliyun annotation aop autofs backup bash bitwarden boot brew browser budget control centos cert certbot charles chat chrome classloader client clone closures cloudflare command commit commoditization container crontab cyber capability demo dependency deploy developer devtools dll dns docker domain download drafter draw drawio dsm dump dylib environment hooks exception fail2ban feign firewall-cmd flow free tier frontier hosted model frp frpc frps fuckgfw full-duplex function gfw git github gperftools gridea grub guardrail lockout gvt-g hacs havcs heap hello hexo hibernate hidpi hoisting homeassistant hosts html htmlparser https huggingface_hub iKuai iMessage image img img2kvm immortalwrt import index inference cost install intel io ios ip iptables iso java javascript jni jnilib jpa js json jsonb jupter jupyterlab jvm k8s kernel key kvm lastpass launchctl learning letsencrypt linux llama.cpp low-code lvm mac mariadb markdown maven md5 microcode mirror modules monitor mount mstsc multimodal mysql n5105 network nfs node node-red nodejs nohup notepad++ npm nssm ntp oop open weights openfeign openssl os ovz packet capture pdf pem perf pip plugin png powerbutton print pro productive struggle pve pvekclean python qcow2 qemu qemu-guest-agent rar reasoning control reasoning slider reboot reflog remote remote desktop renew repo resize retina router runtime safari sata scaffolding scheduled triggers scipy-notebook scoping scp self-play server serverless inference silent test simulated student so speculative decoding spk spring springboot springfox ssh ssl stash string support svg svn swagger sync synology systemctl systemd template terminal txt ubuntu ui undertow unlocker upgrade vLLM vhd vim vm vmdk web windows with worker xml yum zai-org/GLM-5.2 zip 一致性评测 上下文压缩 上下文工程 交换机 人才争夺 人机协作 代理 企业 AI 企业自动化 优化 低延迟 供应链 健康检查 光猫 免费层 内存 内存优化 内网渗透 分布式推理 分布式训练 医疗 AI 升级 卫星影像 反向代理 反诉 可复现性 向量检索 启动 告警 告警优化 图像生成 地球观测 地理空间推理 复盘评测 夏令时 多 token 预测 多向量检索 多智能体 多模型编排 多模态 多模态 AI 多模态 API 多模态 Agent 多模态交互 多模态检索 多语言 多语言 AI 大厂人才战 大模型评测 天猫精灵 安全 安全事件 安全对齐 安装 定时任务 实时协作 实时语音 客户端 SDK 容器 导入 小米 屏幕理解 工作流编排 工具审计 工具调用 工具调用拦截 工程团队 工程实践 工程笔记 常用软件 应用市场 延迟优化 开权重 开源权重 开源模型 异常 异步任务 异步委派 微信 心跳 性能优化 性能捕捉 成本优化 成本控制 扩散模型 技术 抓包 拒答校准 按 provider 优先级 排查 推测解码 推理加速 推理成本 推理速度 推理预算 描述文件 提示词敏感性 故障排查 效率工具 教育数据开源 教育评测 数据工作流 数据治理 数据流 数据集偏差 文本编码器 旁路由 日志分析 日记 时区 显卡虚拟化 智能家居 智能音箱 服务管理 本地 agent 本地推理 机器人仿真 机器人学习 机器人数据采集 架构 模块 模型推理 模型评测 模型路由 残存访问 流式推理 流程 流程图 浏览器 混合专家 漫游 火绒 生成式影像 电信 画图 监控 监控系统 监管 知识蒸馏 磁盘 科研自动化 稀疏注意力 立体声 端侧 AI 端侧推理 端口 端口冲突 端口扫描 结构化输出 续期 网关 网络 网络安全 网络风暴 群晖 脚本 脚本优化 腾讯 自动化 自动恢复 自动攻击 自部署 苹果 虚拟机 视觉语言模型 视频生成 视频问诊 认证 证书 评测 评测基准 评测方法学 诉讼 语音 AI 语音 Agent 语音识别 超时 路由 路由器 软件工程 软件管家 软路由 运维 运维监控 连接保活 连接问题 通信机制 通知 邮件漏发 部署 配置 量化 量子计算 钉钉 镜像 镜像源 长上下文 长连接 门窗传感器 问题排查 防火墙 阿里云 阿里源 集客 飞书

Hitokoto

Archive

OpenClaw 多智能体协作方案完全指南:五种架构详解

OpenClaw 多智能体协作方案完全指南:五种架构详解

OpenClaw 多智能体协作方案完全指南:五种架构详解

今天深入研究了 OpenClaw 的多智能体协作体系,发现它的设计比想象中完善得多。本文从实战角度详细介绍五种协作方案,帮助你根据场景选择最适合的架构。

本文内容基于 OpenClaw v2026.3.x 官方文档整理,附完整配置示例。

一、多智能体路由(Multi-Agent Routing)

适用场景:同一 Gateway 下多个隔离智能体,每个服务不同用户或不同渠道。

核心概念:

  • 每个 agentId 有独立的 workspace、auth、session store
  • 通过 bindings 将不同渠道/账号路由到不同智能体
  • 首次匹配生效,支持精确到 peer 级别的路由

最小配置示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
agents: {
list: [
{ id: "main", workspace: "~/.openclaw/workspace-main" },
{ id: "ops", workspace: "~/.openclaw/workspace-ops" },
{ id: "dev", workspace: "~/.openclaw/workspace-dev" }
]
},
bindings: [
{ agentId: "ops", match: { channel: "telegram", accountId: "ops-bot" } },
{ agentId: "dev", match: { channel: "discord", guildId: "123456789" } },
// 默认路由到 main
{ agentId: "main", match: { channel: "telegram", accountId: "default" } }
]
}

路由优先级(最具体优先):

  1. peer 匹配(精确 DM/群组/频道 ID)
  2. parentPeer 匹配(线程继承)
  3. guildId + roles(Discord 角色路由)
  4. accountId 匹配
  5. 通道级别默认

二、子智能体树型编排(Subagent Orchestration)

适用场景:复杂任务分解为多个并行子任务,结果汇总。

关键配置:

1
2
3
4
5
6
7
8
9
10
11
12
{
agents: {
defaults: {
subagents: {
maxSpawnDepth: 2, // 允许两层嵌套(编排者+执行者)
maxChildrenPerAgent: 5, // 每个节点最多5个子节点
maxConcurrent: 8, // 全局并发上限
runTimeoutSeconds: 900 // 默认超时15分钟
}
}
}
}

深度与角色:

深度 Session Key 格式 角色 可派生子任务
0 agent:<id>:main 主智能体 ✅ 始终可以
1 agent:<id>:subagent:<uuid> 编排者/叶子 仅 maxSpawnDepth≥2
2 agent:<id>:subagent:<uuid>:subagent:<uuid> 执行者 ❌ 永远不可以

工具权限:

  • 叶子节点:默认无 session 工具
  • 编排者(depth=1 when maxSpawnDepth≥2):额外获得 sessions_spawn、subagents、sessions_list、sessions_history

结果汇报链:Depth-2 → 汇报给父编排者 → 汇总后 → 汇报给主智能体


三、ACP 对等会话(Agent Client Protocol)

适用场景:连接外部编码引擎(Codex、Claude Code、Cursor、Gemini CLI),实现持久化编码会话。

核心配置:

1
2
3
4
5
6
7
8
9
{
acp: {
enabled: true,
backend: "acpx",
allowedAgents: ["codex", "claude", "cursor", "openclaw"],
maxConcurrentSessions: 8,
runtime: { ttlMinutes: 120 }
}
}

会话类型:

类型 命令 特点
持久会话 /acp spawn codex --mode persistent --thread auto 绑定线程,持续响应
单次会话 /acp spawn codex --mode oneshot 一次任务,自动关闭
绑定当前对话 /acp spawn codex --bind here 不创建新线程,绑定当前 chat

权限配置:

1
2
3
# 无 TTY 交互时的权限策略
openclaw config set plugins.entries.acpx.config.permissionMode approve-all
openclaw config set plugins.entries.acpx.config.nonInteractivePermissions fail

⚠️ 默认 permissionMode=approve-reads + nonInteractivePermissions=fail,写操作会直接崩溃。


四、代理架构(Delegate Architecture)

适用场景:AI 具有独立组织身份,代表组织行动(发邮件、建日程),而非代表某个人。

能力层级:

层级 能力 权限要求
Tier 1 只读+草稿 只读权限
Tier 2 代发消息/建日程 Send-on-Behalf 权限
Tier 3 自主定时执行 Tier 2 + Cron + Standing Orders

安全加固必须项:

  1. 工具限制:tools: { allow: ["read","exec","message","cron"], deny: ["write","browser","canvas"] }
  2. 沙箱隔离:sandbox: { mode: "all", scope: "agent" }
  3. 硬阻断规则(写入 SOUL.md):不修改身份提供商设置、不导出联系人等

五、agentToAgent 对等通信

适用场景:同一 Gateway 下的多个 agent 直接互相发送消息。

1
2
3
4
5
6
7
8
{
tools: {
agentToAgent: {
enabled: true,
allow: ["main", "p1", "p2", "p3", "p14"]
}
}
}

⚠️ 默认关闭。启用前务必确认 allowlist,谨慎开放。


实战建议:如何选择

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
任务复杂度
↑
│ ┌─────────────────┐
│ 简单 │ 多智能体路由 │ 场景:多用户/多渠道隔离
│ └─────────────────┘
│
│ ┌─────────────────┐
│ 中等 │ 子智能体树型编排 │ 场景:任务分解+并行执行
│ └─────────────────┘
│
│ ┌─────────────────┐
│ 复杂 │ ACP + 子智能体 │ 场景:编码任务+外部引擎
│ └─────────────────┘
│
│ ┌─────────────────┐
│ 组织级 │ 代理架构 │ 场景:AI有独立组织身份
│ └─────────────────┘
└──────────────────────────────────────────→
协作紧密度

常见问题排查

问题 原因 解决
ACP runtime not configured acpx 插件未安装 openclaw plugins install acpx
ACP disabled by policy acp.enabled=false 设置 acp.enabled=true
Subagent 超时 默认无超时但耗尽 token 设置 runTimeoutSeconds
消息路由到错误 agent bindings 顺序问题 最具体规则放前面
agentToAgent 不可用 默认关闭 启用 tools.agentToAgent.enabled

总结

OpenClaw 的多智能体协作体系相当完整,从简单的多租户隔离到复杂的树型编排,再到 ACP 外部引擎集成,都有对应的官方支持。选择哪种方案,取决于你的任务复杂度、协作紧密度和安全性要求。

下一篇我会详细介绍如何在自己的环境中落地这套体系。


本文由 AI 辅助整理,参考 OpenClaw 官方文档 v2026.3.x

本文阅读量 --
Author:Margrop
Link:https://blog.margrop.com/post/2026-03-30-openclaw-multi-agent-collaboration-guide/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可