本文介绍如何在 OpenClaw 中为不同智能体配置独立的 QQ 机器人渠道,实现多账户隔离和多智能体并行运行。

参考资料 链接到标题

为新智能体配置单独的 QQ 渠道 链接到标题

添加隔离智能体 链接到标题

使用智能体向导添加一个新的隔离智能体:

1
openclaw agents add work

注意:首次安装时,默认的 accountIddefaultagentIdmain

配置多账户 链接到标题

如果你有多个 QQ 机器人账户,可以创建不同的 accountId 并分别添加:

1
2
3
4
5
# 添加工作机器人账户
openclaw channels add --channel qqbot --account work --token <工作机器人token>

# 添加个人机器人账户
openclaw channels add --channel qqbot --account personal --token <个人机器人token>

绑定智能体 链接到标题

编辑 openclaw.json 文件,添加 bindings 配置:

1
2
3
4
5
6
{
  "bindings": [
    { "agentId": "work", "match": { "channel": "qqbot", "accountId": "work" } },
    { "agentId": "main", "match": { "channel": "qqbot", "accountId": "default" } }
  ]
}

验证配置 链接到标题

使用以下命令查看当前的智能体绑定状态:

1
openclaw agents list --bindings

输出示例 链接到标题

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
🦞 OpenClaw 2026.3.24 (cff6dc9) — Half butler, half debugger, full crustacean.

Agents:
- main (default)
  Identity: 🌅 夜明 (Dawn) (IDENTITY.md)
  Workspace: ~/.openclaw/workspace
  Agent dir: ~/.openclaw/agents/main/agent
  Model: zai/glm-5-turbo
  Routing rules: 1
  Routing: default (no explicit rules)
  Routing rules:
    - qqbot accountId=default
- work
  Workspace: ~/.openclaw/workspace-work
  Agent dir: ~/.openclaw/agents/work/agent
  Model: zai/glm-5-turbo
  Routing rules: 1
  Routing rules:
    - qqbot accountId=work

工作原理 链接到标题

通过 accountId 的隔离机制,不同的 QQ 机器人消息会被路由到对应的智能体:

  • default 账户的消息 → main 智能体
  • work 账户的消息 → work 智能体

这样可以实现多个 QQ 机器人同时运行,每个机器人拥有独立的智能体配置和工作空间。