One Gateway, Multiple Assistants: Use Bindings to Route the Right Message to the Right Agent
If your work group and your personal chat both talk to the exact same assistant, things can get messy fast.
Multiple agents plus Bindings solve that problem: each scenario gets the assistant that actually belongs there.
What You'll Learn
- Know when multiple agents make sense
- Define several agents in config
- Route messages with Bindings rules
- Find your Telegram group ID
Why Use Multiple Agents?
| Scenario | Need |
|---|---|
| Work group vs personal chat | Separate workspaces, separate data |
| Fast replies vs deep analysis | Different models |
| Multiple independent projects | One workspace per project |
How Do You Configure It?
Step 1: Define Your Assistants in agents.list
{
"agents": {
"list": [
{ "id": "main", "name": "Main Assistant", "workspace": "~/.openclaw/workspace-main", "default": true },
{ "id": "project-a", "name": "Project A", "workspace": "~/.openclaw/workspace-project-a" },
{ "id": "project-b", "name": "Project B", "workspace": "~/.openclaw/workspace-project-b" }
]
}
}Step 2: Add Routing Rules in bindings
Think of it like a receptionist:
"Messages from group A go to assistant A. Messages from group B go to assistant B. Everything else goes to the default one."
{
"bindings": [
{ "agentId": "project-a", "match": { "channel": "telegram", "peer": { "kind": "group", "id": "-1001234567890" } } },
{ "agentId": "project-b", "match": { "channel": "telegram", "peer": { "kind": "group", "id": "-1009876543210" } } },
{ "agentId": "main", "match": { "channel": "telegram" } }
]
}⚠️ Binding order matters a lot. More specific rules must come first. Matching is "first hit wins."
How Do You Find the Group ID?
Method 1: send any message in the group, then run:
openclaw logs --follow
# Look for chat.id in the logs, usually a negative number like -1001234567890Method 2: forward any message from that group to @userinfobot.
Advanced: Different Bot Accounts for Different Assistants
If you have multiple bot tokens:
{
"channels": {
"telegram": {
"accounts": {
"default": { "botToken": "Token for Bot A" },
"alerts": { "botToken": "Token for Bot B" }
}
}
},
"bindings": [
{ "agentId": "main", "match": { "channel": "telegram", "accountId": "default" } },
{ "agentId": "alerts", "match": { "channel": "telegram", "accountId": "alerts" } }
]
}Save After Editing
After updating Config, click Save / Apply. If you see a baseHash conflict, the config was changed elsewhere. Reload the config and apply your edit again.
Next Up
Now you have multiple assistants. Next, we move one of them onto a VPS so it can stay online 24/7.
← Previous: Memory and workspace | 👉 Move your assistant to a VPS for remote access