# OpenClaw Multi-Agent Routing
A single [[OpenClaw Gateway]] can host multiple isolated agents, each with its own workspace, authentication profile, and session store. Routing decides which agent receives a given inbound message ; deterministically, based on a layered set of bindings.
## Routing Priority
The gateway resolves the target agent in this order, top wins:
1. **Peer match** ; explicit peer-to-agent binding
2. **Parent peer** ; the binding of the conversation's parent (replies, threads)
3. **Guild + roles** ; e.g. Discord server + role tuple
4. **Guild** ; the chat group/server itself
5. **Team** ; OpenClaw team grouping
6. **Account** ; channel account (which Telegram bot, which Slack workspace)
7. **Channel** ; channel type as a last filter
8. **Default agent** ; fallback when nothing else matches
Higher specificity always wins; "fall through to default" is the explicit terminal case.
## Per-Agent Isolation
Each agent gets its own directory at `~/.openclaw/agents/<agentId>/`, with:
- independent **session store**
- independent **auth profile** (which Anthropic / OpenAI / OAuth subscription is active)
- independent **persona files**: `SOUL.md` (identity), `AGENTS.md` (registry/process)
- independent **skills** if loaded from the agent workspace
Workspaces never share state implicitly. Cross-agent coordination goes through explicit messages or [[OpenClaw Sub-Agents|sub-agents]].
## Use Cases
- **Personality-by-channel**: fast `claude-haiku` on WhatsApp for quick chats, `claude-opus` on Telegram for deep work
- **Per-person isolation** on a shared family or team server: parent's agent has full tools, kids' agent has restricted ones
- **Group-aware tools**: a family group's agent can access the calendar; a public-channel agent cannot
- **Channel-specific accounts**: different Slack workspaces or Telegram bots routing to different agents on the same gateway
## Setup
```bash
openclaw agents add personal-pro
# edit openclaw.json bindings
openclaw gateway restart
openclaw agents list --bindings # verify resolution
```
`openclaw agents list --bindings` prints the resolution table the gateway will actually use ; the right way to debug "why did message X reach agent Y?"
## References
- Multi-agent routing: https://docs.openclaw.ai/concepts/multi-agent
## Related
- [[OpenClaw]]
- [[OpenClaw Gateway]]
- [[OpenClaw Channels]]
- [[OpenClaw Sub-Agents]]