本文介绍了基于飞书的多 Agent 系统架构设计,通过 OpenClaw Gateway 实现飞书应用与 AI Agent 的对接。系统采用多 Agent 架构,每个飞书机器人对应独立的 AI Agent,拥有专属的工作空间、知识库和模型配置。
隔离性说明:
- 每个 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-xxxx... (已脱敏)
│ ◇ 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 4b6fcbb9743eb0a8611264043008a59e472a4763a3a9a06fc7d5814cbe385ff -> 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:~$

