OpenClaw实现多agent协作-针对飞书插件

本次主要介绍如何基于飞书官网提供的插件(openclaw-lark)进行多agent协作。整体思路如下:

总共有三个agent:项目主负责人(main)、写作负责人(writer)和资料搜集负责人(read)。

main是项目总体负责人,负责用户故事的总体协调;writer是写作角色,负责内容创作,编写;read是信息阅读、信息搜集角色,负责资料阅读、资料搜集总结,供writer参考使用。

用户只需要在groupAllowFrom列出的群聊中,对main机器人发起任务,该机器人就会自动协同上述2个agent实现任务分配、内容检索、内容创作编写,最终反馈给用户,在其他群聊中对任何机器人发起的任务都没有回应,相当于增加了群聊权限设置。同时,由于使用了飞书官方提供的插件,其他配置方式也有所不同,详见第4部分的其他配置 内容。具体如下(主要通过openclaw.json配置)。测试结果与其他多agent方案类似,可参考另一篇文章

一、飞书插件安装
复制代码
# 安装插件,配置和openclaw官方插件有区别,详见第二部分内容的第4部分(其他配置)。
npx -y @larksuite/openclaw-lark-tools install
# 更新该插件
npx -y @larksuite/openclaw-lark-tools update
# 查看详细配置信息
npx @larksuite/openclaw-lark-tools info --all
# 查看版本信息
npx @larksuite/openclaw-lark-tools info
二、多agent配置
1.agent列表配置
复制代码
	  {
        "id": "main",
        "default": true,
        "name": "Mr Tom",
        "workspace": "C:\\Users\\root\\.openclaw\\workspace",
        // 在main agent中加上subagents,实现多agent协作
		"subagents": { "allowAgents":["read","writer"] }, 
        "heartbeat": {
          "every": "60m"
        }
      },
      {
        "id": "writer",
        "name": "writer",
        "workspace": "C:\\Users\\root\\.openclaw\\writer",
        "agentDir": "C:\\Users\\root\\.openclaw\\agents\\writer\\agent",	
        "heartbeat": {
          "every": "60m"
        },
        "identity": {
          "name": "writer"
        }
      },
      {
        "id": "read",
        "name": "read",
        "workspace": "C:\\Users\\root\\.openclaw\\read",
        "agentDir": "C:\\Users\\root\\.openclaw\\agents\\read\\agent",
        "heartbeat": {
          "every": "60m"
        },
        "identity": {
          "name": "read"
        }
      }
2.bingdings配置

在bingdings配置主agent和对应的channels。

复制代码
"bindings": [
    {
      "agentId": "main",
      "match": { "channel": "feishu","accountId": "main" }
    },
    {
      "agentId": "writer",
      "match": { "channel": "feishu","accountId": "blog_writer" }
    },
    {
      "agentId": "read",
      "match": { "channel": "feishu","accountId": "blog_read" }
    }    
  ]
3.channels配置

在channels中配置account账号和允许的群组访问策略。

复制代码
"channels": {
    "feishu": {
      "enabled": true,      
      "connectionMode": "websocket",
      "domain": "feishu",
      "accounts": {
      	"main":{
		  "appId": "cli_a9bbbbbbbbbbbbbb",
	      "appSecret": "68ibbbbbbbbbbbbk",
	      "botName": "项目负责人",
		  "dmPolicy": "open"
		},
        "blog_writer": {
          "appId": "cli_accccccccccccccb",
          "appSecret": "DAWcccccccccccccc7",
          "botName": "写作负责人",
          "dmPolicy": "allowlist",
          "allowFrom":         ["ou_3633f3b1aaaaaaaaaaaaaaa7428c1f6a08655d","ou_839201f2bbbbbbbbbbbbbbbaf1cbe"]
        },
        "blog_read": {
          "appId": "cli_a9ddddddddddddd",
          "appSecret": "tGpfbddddddddddddd4",
          "botName": "信息检索负责人",
          "dmPolicy": "allowlist",
		  "allowFrom": ["ou_3f47dddddddddddddd"]
        }
	  },
      // 设置为allowlist,表示只允许下面群组列出的群组发送接收消息,其他忽略。
	  "groupPolicy": "allowlist", 
      // 允许的群组列表,与上面的groupPolicy结合使用
      "groupAllowFrom": [
        "oc_be91ddddddddddddddd5",
		"oc_d8fceeeeeeeeeeeeeeeeeee"
      ],       
      "streaming": true   
    }
  }
4.其他配置

其他需要配置的地方主要是对tools、session和plugins下面的配置进行调整,具体如下:

复制代码
// 1.tools
"tools": {
    "profile": "full",
    "sessions": {
      "visibility": "all"
    },
    "agentToAgent": {
      "enabled": true
    }
}
// 2.session
"session": {
    "dmScope": "per-account-channel-peer" // 注意这里区别于通用飞书插件的区别。
}
// 3.plugins下面的配置
	"entries": {
      "feishu": {
        "enabled": false
      },
      "openclaw-lark": {
        "enabled": true
      }
    },
    "installs": {
      "openclaw-lark": {
        "source": "npm",
        "spec": "@larksuite/openclaw-lark",
        "installPath": "C:\\Users\\root\\.openclaw\\extensions\\openclaw-lark",
        "version": "2026.3.15",
        "resolvedName": "@larksuite/openclaw-lark",
        "resolvedVersion": "2026.3.15",
        "resolvedSpec": "@larksuite/openclaw-lark@2026.3.15",
        "integrity": "sha512-YGk6aaaaaaaaaaaaaaaaaacc0csBA==",
        "shasum": "997cb8ee9cfddddddddddd57fff",
        "resolvedAt": "2026-03-16T05:53:40.054Z",
        "installedAt": "2026-03-16T05:54:00.632Z"
      }
    }
相关推荐
AC赳赳老秦21 分钟前
OpenClaw 多源采集公开行业数据:从原始信息到研究报告初稿的自动化实践
java·c语言·c++·python·php·deepseek·openclaw
张张123y6 小时前
Hermes Agent 是什么?它能做什么,以及如何部署到飞书
人工智能·python·飞书
AC赳赳老秦2 天前
公开图片 OCR 数据提取:OpenClaw 合规采集公开信息图,识别文字与表格并转化为结构化数据
java·大数据·前端·数据库·python·php·openclaw
AC赳赳老秦2 天前
风控岗应用:OpenClaw 采集公开司法与经营异常数据,自动生成企业风险评估报告
大数据·c语言·数据库·人工智能·python·php·openclaw
海兰2 天前
【应用】ClawPDF 完全指南:安装、部署与使用
人工智能·pdf·openclaw
海兰2 天前
mcporter — 安装部署及使用完全指南(四)
人工智能·agent·openclaw
comedate3 天前
DeepSeek Harness 与 OpenClaw 功能异同对比
openclaw·deepseekharness·差异
lisanmengmeng3 天前
飞书 API使用
飞书·监控·日志·日志监控·监控及日志
浪潮BB机4 天前
2026飞书妙记与通义听悟会议录音转写工具实测横评
飞书·语音识别·效率工具·ai工具·录音转写·会议纪要
AC赳赳老秦4 天前
官方技术文档聚合实践:用 OpenClaw 批量抓取开源项目文档,构建离线可检索技术知识库
java·运维·服务器·python·信息可视化·deepseek·openclaw