OpenClaw Multi-Agent Setup: Run Multiple AI Assistants
OpenClaw Multi-Agent Setup: Run Multiple AI Assistants
By Elena Rodriguez | February 7, 2026
OpenClaw Multi-Agent Setup: Run Multiple AI Assistants
OpenClaw supports running multiple independent agents, each with its own personality, memory, and configuration. This is powerful for separating work and personal contexts.
---
Why Multiple Agents?
Use Cases
| Scenario | Why Multiple Agents? |
|---|---|
| Work & Personal | Different contexts, tools, and memories |
| Team collaboration | Each team member gets their own agent |
| Specialized tasks | Coding agent, writing agent, research agent |
| Testing | Experiment without affecting main agent |
Key Concepts
| Term | Meaning |
|---|---|
| agentId | Unique identifier for an agent "brain" |
| workspace | Agent's files, memory, and configuration |
| binding | Routes messages to specific agents |
Creating Multiple Agents
Directory Structure
Each agent needs its own workspace:
~/.openclaw/ ├── agents/ │ ├── main/ # Primary agent │ │ ├── AGENTS.md │ │ ├── SOUL.md │ │ ├── memory/ │ │ └── config/ │ ├── work/ # Work agent │ │ ├── AGENTS.md │ │ ├── SOUL.md │ │ └── memory/ │ └── assistant/ # Personal assistant │ ├── AGENTS.md │ ├── SOUL.md │ └── memory/ └── openclaw.json Create a New Agent
# Create agent directory mkdir -p ~/.openclaw/agents/work cd ~/.openclaw/agents/workCreate required files
touch AGENTS.md SOUL.md config/.gitkeepAdd to openclaw.json
openclaw config set agents.list[+].id "work" openclaw config set agents.list[+].workspace "/Users/you/.openclaw/agents/work" Agent Configuration
Edit ~/.openclaw/openclaw.json:
{ "agents": { "list": [ { "id": "main", "name": "Primary Agent", "workspace": "/Users/you/.openclaw/agents/main" }, { "id": "work", "name": "Work Assistant", "workspace": "/Users/you/.openclaw/agents/work", "model": "claude-opus-4-20250514" }, { "id": "personal", "name": "Personal Assistant", "workspace": "/Users/you/.openclaw/agents/personal", "model": "claude-sonnet-4-20250514" } ] } } ---
Agent Personalities
Define Agent Personality
Create SOUL.md in each agent's directory:
Work Agent SOUL.md:
# Work Agent PersonalityYou are a professional work assistant focused on:
Coding and technical tasks Project management Meeting preparation Email and communication Your communication style:
Professional and concise Action-oriented Data-driven decisions You have access to:
GitHub API Calendar integration Project management tools Personal Agent SOUL.md:
# Personal Agent PersonalityYou are a friendly personal assistant focused on:
Daily planning and organization Research and learning Creative projects General conversation Your communication style:
Warm and approachable Helpful and patient Encouraging You have access to:
Weather API Recipe skills Entertainment recommendations ---
Channel-to-Agent Routing
Route by Channel
Configure channels to use different agents:
{ "channels": { "telegram": { "agentId": "personal" }, "discord": { "agentId": "work" }, "whatsapp": { "agentId": "personal" } } } Route by User
{ "channels": { "discord": { "bindings": { "user:123456789": "personal", "user:987654321": "work" } } } } Route by Channel/Team
{ "channels": { "discord": { "bindings": { "guild:11112222333": { "channel:general": "work", "channel:random": "personal" } } } } } ---
Switching Between Agents
CLI Command
# Switch to different agent openclaw agent switch --to workStart new session with specific agent
openclaw agent start --agent workView current agent
openclaw agent status In Conversation
You: @work What's on my calendar today? You: @personal What's the weather like? ---
Isolated Workspaces
File Isolation
Each agent has its own workspace:
# Work agent files ls ~/.openclaw/agents/work/ → AGENTS.md SOUL.md memory/ config/
Personal agent files
ls ~/.openclaw/agents/personal/ → AGENTS.md SOUL.md memory/ config/
Memory Isolation
# Work agent memory cat ~/.openclaw/agents/work/memory/2026-02-07.mdPersonal agent memory
cat ~/.openclaw/agents/personal/memory/2026-02-07.md Authentication Isolation
Each agent can have its own API keys:
# Work agent keys (in agents/work/config/) cat ~/.openclaw/agents/work/config/secrets.jsonPersonal agent keys (in agents/personal/config/)
cat ~/.openclaw/agents/personal/config/secrets.json ---
Multi-Agent Best Practices
Organization Tips
| Practice | Description |
|---|---|
| Clear naming | Use descriptive agent names |
| Document purposes | Document what each agent does |
| Consistent structure | Same folder structure for all agents |
| Regular cleanup | Archive old agent data |
Security Considerations
---
Troubleshooting Multi-Agent
Agent Not Found
# List available agents openclaw agents listVerify configuration
openclaw config get agents.list Messages Going to Wrong Agent
# Check current routing openclaw channels routing-statusVerify bindings
openclaw config get channels.discord.bindings Memory Not Isolated
# Check agent workspace openclaw agent workspaceVerify isolation
ls ~/.openclaw/agents/*/memory/ ---
Further Reading
---
Related Articles:
Tags: OpenClaw, AI, Tutorial
Comments
Post a Comment