Multi-Agent Collaboration Overview
OpenClaw's multi-agent system allows multiple AI agents with different specializations to work together. Through message routing and task delegation, user requests are automatically assigned to the most suitable agent.
Agent Definitions
Define multiple specialized agents:
{
"agents": {
"receptionist": {
"displayName": "Receptionist",
"model": "fast",
"systemPrompt": "You are a receptionist responsible for understanding user intent and forwarding requests to the right specialist. You do not answer technical questions directly.",
"temperature": 0.3
},
"tech-support": {
"displayName": "Tech Support",
"model": "code-expert",
"systemPrompt": "You are a senior technical support engineer, skilled in troubleshooting, code debugging, and system configuration.",
"tools": ["code_exec", "web_search"]
},
"writer": {
"displayName": "Writing Assistant",
"model": "smart",
"systemPrompt": "You are a professional writing assistant, skilled in copywriting, content creation, and text editing.",
"temperature": 0.8
},
"data-analyst": {
"displayName": "Data Analyst",
"model": "smart",
"systemPrompt": "You are a data analyst, skilled in data interpretation, chart recommendations, and statistical analysis.",
"tools": ["code_exec"]
}
}
}
Routing Strategies
Keyword Routing
{
"routing": {
"strategy": "keyword",
"rules": [
{"match": "code|bug|deploy|server|API", "agent": "tech-support"},
{"match": "write|copy|article|translate|edit", "agent": "writer"},
{"match": "data|report|statistics|chart|analysis", "agent": "data-analyst"},
{"match": ".*", "agent": "receptionist"}
]
}
}
Intent Classification Routing
Use AI for intent classification with a lightweight model.
Manual Agent Switching
Users can switch agents mid-conversation:
{
"routing": {
"switchCommands": {
"/tech": "tech-support",
"/write": "writer",
"/data": "data-analyst",
"/help": "receptionist"
}
}
}
Inter-Agent Delegation
Agents can delegate tasks to other agents, and shared context ensures seamless handoffs.
Multi-Agent Collaboration Pipelines
{
"pipelines": {
"content-review": {
"steps": [
{"agent": "writer", "action": "generate", "prompt": "Write an article based on user requirements"},
{"agent": "tech-support", "action": "review", "prompt": "Check the article for technical accuracy"},
{"agent": "writer", "action": "revise", "prompt": "Revise based on review feedback"}
]
}
}
}
Best Practices
- Use fast models for the receptionist agent -- intent classification doesn't need strong reasoning
- Use powerful models for specialist agents -- ensure output quality
- Set reasonable timeouts -- prevent users from waiting too long during agent switches
- Log routing decisions -- helps optimize routing rules
- Regularly review routing statistics -- identify suboptimal routing
Summary
Multi-agent collaboration architecture lets OpenClaw deliver specialized AI services. Through intelligent routing and inter-agent delegation, user requests are always handled by the most qualified "expert" while maintaining a smooth conversational experience.