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"
      }
    }
相关推荐
虾壳云官方4 小时前
openclaw 一键安装教程(2026年6月15最新)
运维·人工智能·windows·自动化·openclaw
AC赳赳老秦5 小时前
OpenClaw + 飞书多维表格:自动同步数据、生成统计图表、触发自动化任务
java·大数据·python·缓存·自动化·deepseek·openclaw
AC赳赳老秦1 天前
OpenClaw+Power Apps 实战:自动生成 Power Apps 应用、连接 Excel 数据源
大数据·开发语言·python·serverless·excel·deepseek·openclaw
Markland_l1 天前
从dify、coze、飞书、obsidian看rag架构
架构·飞书
七夜zippoe1 天前
OpenClaw 节点方法调用:跨设备能力调用实战
ai·调用·跨设备·openclaw·nodes
虾壳云官方2 天前
OpenClaw 2.7.9 Windows 一键部署教程:零基础也能搭建 AI 自动化助手
运维·人工智能·windows·自动化·openclaw·openclaw一键部署
zyplayer-doc2 天前
继飞书之后,又一款知识库推出了开源 Agent-Native CLI 工具
人工智能·pdf·编辑器·飞书·开源软件
七夜zippoe2 天前
OpenClaw 节点命令执行:远程Shell与系统操作实战
github·shell·openclaw·nodes·系统操作
旺财矿工2 天前
OpenClaw 飞书机器人配置教程|一键对接飞书,实现聊天下达 AI 指令
人工智能·机器人·飞书·openclaw·龙虾
程序猿小白菜2 天前
OpenClaw 飞书机器人搭建流程
ai·机器人·飞书·openclaw