网站首页 全球最实用的IT互联网站!

人工智能P2P分享Wind搜索发布信息网站地图标签大全

当前位置:诺佳网 > 人工智能 > 人形机器人 >

本文介绍了基于飞书的多Agent系统架构设计,通过

时间:2026-03-16 19:09

人气:

作者:admin

标签:

导读:本文介绍了基于飞书的多Agent系统架构设计,通过OpenClaw Gateway实现飞书应用与AI Agent的对接。系统采用多Agent架构,每个飞书机器人对应独立的AI Agent,拥有专属的工作空间、知识库和模...

        本文介绍了基于飞书的多Agent系统架构设计,通过OpenClaw Gateway实现飞书应用与AI Agent的对接。系统采用多Agent架构,每个飞书机器人对应独立的AI Agent,拥有专属的工作空间、知识库和模型配置。

        本文可以参考的内容:

  • 多agent对接单个飞书账号
  • openclaw多agent群聊
  • 飞书机器人群聊
  • 多agent数据隔离
  • 多agent单独安装skills

        隔离性说明:

  • 每个 Agent 的模型状态完全独立
  • 每个 agent 对应一个飞书机器人
  • 每个 agent 的技能单独安装维护
  • 模型切换仅对当前会话生效(持久化到 Agent 配置)
  • 严格隔离:每个 Agent 独立 workspace 和 data

添加新的 agent

# 添加agent
openclaw agents add finance_agent
#openclaw agents add code_agent

# 设置身份
openclaw agents set-identity --agent code_agent --name "全栈开发专家"
#openclaw agents set-identity --agent main --name "OpenClaw" --emoji "????" --avatar avatars/openclaw.png

# 查看agents 列表
openclaw agents list

安装过程

cobrew@DESKTOP-9449JCG:~$ openclaw agents add finance_agent

?? OpenClaw 2026.3.13 (61d171a) ? Your AI assistant, now without the $3,499 headset.

┌  Add OpenClaw agent
│
◇  Workspace directory
│  /home/cobrew/.openclaw/workspace-finance_agent
│
◇  Copy auth profiles from "main"?
│  Yes
│
◇  Auth profiles ─────────────────────?
│                                     │
│  Copied auth profiles from "main".  │
│                                     │
├─────────────────────────────────────?
│
◇  Configure model/auth for this agent now?
│  Yes
│
◇  Model/auth provider
│  Xiaomi
│
◇  How do you want to provide this API key?
│  Paste API key now
│
◇  Enter Xiaomi API key
│  sk-cidvhi74xqwlq388the6i9ds0mfru4qn0llzpux1hx54idq8
│
◇  Model configured ─────────────────────────────────────────────────────?
│                                                                        │
│  Default model set to xiaomi/mimo-v2-flash for agent "finance_agent".  │
│                                                                        │
├────────────────────────────────────────────────────────────────────────?
│
◇  Model check ──────────────────────────────────────────────────────────────────────────────?
│                                                                                            │
│  Model not found: xiaomi/mimo-v2-flash. Update agents.defaults.model or run /models list.  │
│                                                                                            │
├────────────────────────────────────────────────────────────────────────────────────────────?
│
◇  Channel status ────────────────────────────?
│                                             │
│  Telegram: needs token                      │
│  WhatsApp (default): not linked             │
│  Discord: needs token                       │
│  Slack: needs tokens                        │
│  Signal: needs setup                        │
│  signal-cli: missing (signal-cli)           │
│  iMessage: needs setup                      │
│  imsg: missing (imsg)                       │
│  IRC: not configured                        │
│  Google Chat: not configured                │
│  LINE: not configured                       │
│  Feishu: install plugin to enable           │
│  Google Chat: install plugin to enable      │
│  Nostr: install plugin to enable            │
│  Microsoft Teams: install plugin to enable  │
│  Mattermost: install plugin to enable       │
│  Nextcloud Talk: install plugin to enable   │
│  Matrix: install plugin to enable           │
│  BlueBubbles: install plugin to enable      │
│  LINE: install plugin to enable             │
│  Zalo: install plugin to enable             │
│  Zalo Personal: install plugin to enable    │
│  Synology Chat: install plugin to enable    │
│  Tlon: install plugin to enable             │
│                                             │
├─────────────────────────────────────────────?
│
◇  Configure chat channels now?
│  No
Config overwrite: /home/cobrew/.openclaw/openclaw.json (sha256 4b6fcbb9743eb0a8611264043008a59e472a4763a3a9a0a6fc7d5814cbe385ff -> 96c54ca4424a3515bc743203fa8e6ef23580613b630be1f06dad8cdf09c6137b, backup=/home/cobrew/.openclaw/openclaw.json.bak)
Updated ~/.openclaw/openclaw.json
Workspace OK: ~/.openclaw/workspace-finance_agent
Sessions OK: ~/.openclaw/agents/finance_agent/sessions
│
└  Agent "finance_agent" ready.

cobrew@DESKTOP-9449JCG:~$ 

配置过程

cobrew@DESKTOP-9449JCG:~$ openclaw agents add code_agent

???? OpenClaw 2026.3.13 (61d171a) — WhatsApp automation without the "please accept our new privacy policy".

11:32:30 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: feishu (/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.
11:32:57 [plugins] feishu_doc: Registered feishu_doc, feishu_app_scopes
11:32:57 [plugins] feishu_chat: Registered feishu_chat tool
11:32:57 [plugins] feishu_wiki: Registered feishu_wiki tool
11:32:57 [plugins] feishu_drive: Registered feishu_drive tool
11:32:57 [plugins] feishu_bitable: Registered bitable tools
┌  Add OpenClaw agent
│
◆  Workspace directory
│  /home/cobrew/.openclaw/workspace-code_agent█
└
11:32:58 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: feishu (/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.
11:32:58 [plugins] feishu_doc: Registered feishu_doc, feishu_app_scopes
11:32:58 [plugins] feishu_chat: Registered feishu_chat tool
◇  Workspace directory
│  /home/cobrew/.openclaw/workspace-code_agent
│
◇  Copy auth profiles from "main"?
│  No
│
◇  Configure model/auth for this agent now?
│  Yes
12:00:47 [agents/auth-profiles] inherited auth-profiles from main agent
│
◇  Model/auth provider
│  Qwen
12:01:29 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: feishu (/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.
12:01:29 [plugins] feishu_doc: Registered feishu_doc, feishu_app_scopes
12:01:29 [plugins] feishu_chat: Registered feishu_chat tool
12:01:29 [plugins] feishu_wiki: Registered feishu_wiki tool
12:01:29 [plugins] feishu_drive: Registered feishu_drive tool
12:01:29 [plugins] feishu_bitable: Registered bitable tools
12:01:29 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: feishu (/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.
12:01:29 [plugins] feishu_doc: Registered feishu_doc, feishu_app_scopes
12:01:29 [plugins] feishu_chat: Registered feishu_chat tool
12:01:29 [plugins] feishu_wiki: Registered feishu_wiki tool
12:01:29 [plugins] feishu_drive: Registered feishu_drive tool
12:01:29 [plugins] feishu_bitable: Registered bitable tools
│
◓  Starting Qwen OAuth…│
◇  Qwen OAuth ─────────────────────────────────────────────────────────────────────────╮
│                                                                                      │
│  Open https://chat.qwen.ai/authorize?user_code=EFVW6ZPM&client=qwen-code to approve  │
│  access.                                                                             │
│  If prompted, enter the code EFVW6ZPM.                                               │
│                                                                                      │
├──────────────────────────────────────────────────────────────────────────────────────╯
◇  Qwen OAuth failed
│
◇  Qwen OAuth ────────────────────────────────────────────────────────────────╮
│                                                                             │
│  If OAuth fails, verify your Qwen account has portal access and try again.  │
│                                                                             │
├─────────────────────────────────────────────────────────────────────────────╯
Error: Qwen OAuth timed out waiting for authorization.
cobrew@DESKTOP-9449JCG:~$ openclaw agents add code_agent

???? OpenClaw 2026.3.13 (61d171a) — Less clicking, more shipping, fewer "where did that file go" moments.

12:17:40 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: feishu (/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.
^[[B^[[B^[[B^H^H12:18:08 [plugins] feishu_doc: Registered feishu_doc, feishu_app_scopes
12:18:08 [plugins] feishu_chat: Registered feishu_chat tool
12:18:08 [plugins] feishu_wiki: Registered feishu_wiki tool
12:18:08 [plugins] feishu_drive: Registered feishu_drive tool
12:18:08 [plugins] feishu_bitable: Registered bitable tools
┌  Add OpenClaw agent
│
◆  Workspace directory
│  /home/cobrew/.openclaw/workspace-code_age█
└
                                             12:18:08 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: feishu (/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.
12:18:08 [plugins] feishu_doc: Registered feishu_doc, feishu_app_scopes
12:18:08 [plugins] feishu_chat: Registered feishu_chat tool
◇  Workspace directory
│  /home/cobrew/.openclaw/workspace-code_age
│
◇  Configure model/auth for this agent now?
│  Yes
│
◇  Model/auth provider
│  Z.AI
│
◇  Z.AI auth method
│  Coding-Plan-CN
12:19:36 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: feishu (/home/cobrew/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids.
12:19:36 [plugins] feishu_doc: Registered feishu_doc, feishu_app_scopes
12:19:36 [plugins] feishu_chat: Registered feishu_chat tool
12:19:36 [plugins] feishu_wiki: Registered feishu_wiki tool
12:19:36 [plugins] feishu_drive: Registered feishu_drive tool
12:19:36 [plugins] feishu_bitable: Registered bitable tools
│
◇  How do you want to provide this API key?
│  Paste API key now
│
◇  Enter Z.AI API key
│  f01d03bbba004f51b1156ce8e6e0b1e7.IuFYrilgMWF3EfuO
│
◇  Model configured ───────────────────────────────────────╮
│                                                          │
│  Default model set to zai/glm-5 for agent "code_agent".  │
│                                                          │
├──────────────────────────────────────────────────────────╯
[info]: [ 'client ready' ]
│
◇  Channel status ───────────────────────────────────────────╮
│                                                            │
│  Telegram: needs token                                     │
│  WhatsApp (default): not linked                            │
│  Discord: needs token                                      │
│  Slack: needs tokens                                       │
│  Signal: needs setup                                       │
│  signal-cli: missing (signal-cli)                          │
│  iMessage: needs setup                                     │
│  imsg: missing (imsg)                                      │
│  Feishu: connected as ou_9ee6b7fc6c91266a64a638548c91a4b1  │
│  IRC: not configured                                       │
│  Google Chat: not configured                               │
│  LINE: not configured                                      │
│  Google Chat: install plugin to enable                     │
│  Nostr: install plugin to enable                           │
│  Microsoft Teams: install plugin to enable                 │
│  Mattermost: install plugin to enable                      │
│  Nextcloud Talk: install plugin to enable                  │
│  Matrix: install plugin to enable                          │
│  BlueBubbles: install plugin to enable                     │
│  LINE: install plugin to enable                            │
│  Zalo: install plugin to enable                            │
│  Zalo Personal: install plugin to enable                   │
│  Synology Chat: install plugin to enable                   │
│  Tlon: install plugin to enable                            │
│                                                            │
├────────────────────────────────────────────────────────────╯
│
◇  Configure chat channels now?
│  Yes
│
◇  How channels work ───────────────────────────────────────────────────────────────────────╮
│                                                                                           │
│  DM security: default is pairing; unknown DMs get a pairing code.                         │
│  Approve with: openclaw pairing approve <channel> <code>                                  │
│  Public DMs require dmPolicy="open" + allowFrom=["*"].                                    │
│  Multi-user DMs: run: openclaw config set session.dmScope "per-channel-peer" (or          │
│  "per-account-channel-peer" for multi-account channels) to isolate sessions.              │
│  Docs: channels/pairing              │
│                                                                                           │
│  Telegram: simplest way to get started — register a bot with @BotFather and get going.    │
│  WhatsApp: works with your own number; recommend a separate phone + eSIM.                 │
│  Discord: very well supported right now.                                                  │
│  IRC: classic IRC networks with DM/channel routing and pairing controls.                  │
│  Google Chat: Google Workspace Chat app with HTTP webhook.                                │
│  Slack: supported (Socket Mode).                                                          │
│  Signal: signal-cli linked device; more setup (David Reagans: "Hop on Discord.").         │
│  iMessage: this is still a work in progress.                                              │
│  LINE: LINE Messaging API webhook bot.                                                    │
│  Feishu: 飞书/Lark enterprise messaging.                                                  │
│  Nostr: Decentralized protocol; encrypted DMs via NIP-04.                                 │
│  Microsoft Teams: Bot Framework; enterprise support.                                      │
│  Mattermost: self-hosted Slack-style chat; install the plugin to enable.                  │
│  Nextcloud Talk: Self-hosted chat via Nextcloud Talk webhook bots.                        │
│  Matrix: open protocol; install the plugin to enable.                                     │
│  BlueBubbles: iMessage via the BlueBubbles mac app + REST API.                            │
│  Zalo: Vietnam-focused messaging platform with Bot API.                                   │
│  Zalo Personal: Zalo personal account via QR code login.                                  │
│  Synology Chat: Connect your Synology NAS Chat to OpenClaw with full agent capabilities.  │
│  Tlon: decentralized messaging on Urbit; install the plugin to enable.                    │
│                                                                                           │
├───────────────────────────────────────────────────────────────────────────────────────────╯
│
◇  Select a channel
│  Feishu/Lark (飞书)
│
◇  Feishu already configured. What do you want to do?
│  Skip (leave as-is)
│
◇  Select a channel
│  Finished
Config overwrite: /home/cobrew/.openclaw/openclaw.json (sha256 3cc26d0b17d542823fedb8662b250743f82ce326e4de4b9db560b1c8dc384214 -> 41694ced5740b6ed5d8fe59f820a8468e1a2e9f266cbbfbc014407f89a82a53c, backup=/home/cobrew/.openclaw/openclaw.json.bak)
Updated ~/.openclaw/openclaw.json
Workspace OK: ~/.openclaw/workspace-code_age
Sessions OK: ~/.openclaw/agents/code_agent/sessions
│
└  Agent "code_agent" ready.

cobrew@DESKTOP-9449JCG:~$ 

手动修改 agents 信息

给每个 agent 单独配置

这边和一个 agent 的配置大不相同,参照下方修改配置

每个模型设置单独的 id、名称、 模型、工作目录,anget 目录

{
	"agents": {
		"list": [{
				"id": "main",
				"name": "main",
				"model": "moonshot/kimi-k2.5",
				"workspace": "/home/cobrew/.openclaw/workspace",
				"agentDir": "/home/cobrew/.openclaw/agents/main/agent"
			},
			{
				"id": "finance_agent",
				"name": "finance_agent",
				"workspace": "/home/cobrew/.openclaw/workspace-finance_agent",
				"agentDir": "/home/cobrew/.openclaw/agents/finance_agent/agent",
				"model": "xiaomi/mimo-v2-flash"
			},
			{
				"id": "code_agent",
				"name": "code_agent",
				"workspace": "/home/cobrew/.openclaw/workspace-code_age",
				"agentDir": "/home/cobrew/.openclaw/agents/code_agent/agent",
				"model": "zai/glm-4.7-flashx",
				"identity": {
					"name": "全栈开发专家"
				}
			}
		]
	}
}
为每个 Agent 配置不同的飞书机器人

这边要在同一个飞书后台创建 3 个单独的应用,将每个应用的appId、appSecret 单独配置。这个目前手动修改配置文件 openclaw.json 比较快,保存后会自动重新加载配置。配置如下:

{
  "channels": {
    "feishu": {
      "enabled": true,
      "connectionMode": "websocket",
      "domain": "feishu",
      "accounts": {
	      "main":{
	        "appId": "cli_a93d167a33b95cb3",
          "appSecret": "w73FL9tgnOTwmuGShmDdDeGG55tKm7WC",
          "requireMention": true,
          "groupPolicy": "open"
	      },
        "code_agent": {
          "appId": "cli_a924314b79f8dcb6",
          "appSecret": "rjsPr5p8FSrLEEv1HAirrd80x3JEXA4g",
          "requireMention": false,
          "groupPolicy": "open"
        },
        "finance_agent": {
          "appSecret": "XlZu4FlK1KwfIokiWeeRhdWvSoQ8EAc8",
          "appId": "cli_a93de95e8a7a9ccd",
          "requireMention": true,
          "groupPolicy": "open"
        }
      }
    }
  }
}

参数名称

说明

requireMention

true: 机器人只响应被 @ 的消息,群里普通发言不会触发

false: 机器人无需被 @,群里所有消息都会尝试响应

accounts.agentId

agentId 要和agents 中配置的 ID 对应

绑定 Agent 到 Channel

        方式一:使用命令绑定

# 绑定 agent 到指定飞书账号
openclaw agents bind --agent <agentId> --bind feishu:<accountId>

# 示例
openclaw agents bind --agent main --bind feishu:main
openclaw agents bind --agent code_agent --bind feishu:code_agent
openclaw agents bind --agent finance_agent --bind feishu:finance_agent

# 查看绑定结果
openclaw agents bindings

        方式二:直接改配置文件

{
	"bindings": [{
			"type": "route",
			"agentId": "main",
			"match": {
				"channel": "feishu",
				"accountId": "main"
			}
		},
		{
			"type": "route",
			"agentId": "finance_agent",
			"match": {
				"channel": "feishu",
				"accountId": "finance_agent"
			}
		},
		{
			"type": "route",
			"agentId": "code_agent",
			"match": {
				"channel": "feishu",
				"accountId": "code_agent"
			}
		}
	]
}

        配对授权:

# 重启openclaw,新版openclaw会自己重启,重新加载配置文件
openclaw gateway restart

# 测试
# 为每个机器人配对授权
openclaw pairing approve feishu XXXX

机器人群聊配置

创建群聊的步骤:

1、在飞书客户端,创建群组

2、 将机器人添加入群

3、群聊测试(有的是要@机器人才能对话,有的不需要)

群聊测试:

为agent安装 skills

        既然是多 agents,那么每个 agents 需要的 skills 也是不同的,

        方式一:通过clawhub 安装,核心是添加--dir 参数指向 agent 自己的 skills 安装目录

# code_agent
clawhub install Self-Improving --dir /home/cobrew/.openclaw/workspace-code_age/skills
clawhub install skill-scanner --dir /home/cobrew/.openclaw/workspace-code_age/skills
clawhub install skill-vetter --dir /home/cobrew/.openclaw/workspace-code_age/skills
clawhub install tavily-search-1-0-0 --dir /home/cobrew/.openclaw/workspace-code_age/skills
clawhub install brave-api-search --dir /home/cobrew/.openclaw/workspace-code_age/skills
clawhub install qmd --dir /home/cobrew/.openclaw/workspace-code_age/skills
clawhub install  --dir /home/cobrew/.openclaw/workspace-code_age/skills
clawhub install  --dir /home/cobrew/.openclaw/workspace-code_age/skills

# finance_agent
clawhub install Self-Improving --dir /home/cobrew/.openclaw/workspace-finance_agent/skills
clawhub install skill-scanner --dir /home/cobrew/.openclaw/workspace-finance_agent/skills
clawhub install tavily-search-1-0-0 --dir /home/cobrew/.openclaw/workspace-finance_agent/skills
clawhub install stock-screener-cn --dir /home/cobrew/.openclaw/workspace-finance_agent/skills
clawhub install fundamental-stock-analysis --dir /home/cobrew/.openclaw/workspace-finance_agent/skills
clawhub install china-stock-analysis --dir /home/cobrew/.openclaw/workspace-finance_agent/skills
clawhub install skill-vetter --dir /home/cobrew/.openclaw/workspace-finance_agent/skills
clawhub install brave-api-search --dir /home/cobrew/.openclaw/workspace-finance_agent/skills
clawhub install qmd --dir /home/cobrew/.openclaw/workspace-finance_agent/skills
clawhub install --dir /home/cobrew/.openclaw/workspace-finance_agent/skills


#clawhub install stock-analysis --dir /home/cobrew/.openclaw/workspace-finance_agent/skills

        方式二:让 agent 自己安装

疑难杂症

问题 1:新配置的飞书机器人无法对话

现象:新配置的 agent 机器人和飞书能建立长链接,配置没有报错,但是和机器人对话,机器人没有反应

原因:没有配置机器人事件。添加事件:接受消息,然后发布版本再测试

问题 2:agent 使用模型和配置的不匹配

我明明使用的是zai/glm-4.7-flashx,但是却调用了 kimi-k2.5

解决办法:直接让小龙虾代劳

常用命令

# 查看所有可用模型
openclaw models list

# 查看特定提供商模型
openclaw models list --provider deepseek
openclaw models list --provider zai
openclaw models list --provider openai

# 查看 Agent 详情(含当前模型)
openclaw agents describe main
openclaw agents describe coding

# 查看实时日志
openclaw logs --follow

# 查看配对列表(用于私聊授权)
openclaw pairing list feishu
openclaw pairing approve feishu <CODE>

温馨提示:以上内容整理于网络,仅供参考,如果对您有帮助,留下您的阅读感言吧!
相关阅读
本类排行
相关标签
本类推荐

CPU | 内存 | 硬盘 | 显卡 | 显示器 | 主板 | 电源 | 键鼠 | 网站地图

Copyright © 2025-2035 诺佳网 版权所有 备案号:赣ICP备2025066733号
本站资料均来源互联网收集整理,作品版权归作者所有,如果侵犯了您的版权,请跟我们联系。

关注微信