Multi-agent systems in OpenClaw go beyond simple routing. While the binding system directs messages to the right agent based on channel, role, or account, multi-agent architectures enable agents to collaborate: a triage agent classifies and delegates, a coordinator orchestrates workflows across specialists, and agents share context through explicit handoff mechanisms. This page covers the patterns for building production multi-agent systems -- from basic routing to triage classification, agent-to-agent delegation, shared knowledge bases, and the security considerations that come with agents spawning and communicating with other agents.
Master openclaw multi-agent systems
Take the OpenClaw for Production & Advanced Use course with hands-on lessons and challenges.
The triage agent receives all messages (default binding) and only has the agent-router tool -- it cannot take any actions itself. It classifies intent and delegates to the right specialist. The triage agent uses strict sandbox with tree scope, ensuring any delegation inherits restrictions. Specialists have focused tool sets matching their domain.
The agent-router tool provides structured delegation with context passing. The delegating agent includes the original user message and any relevant metadata. The returnResponse flag means the specialist's answer comes back to the triage agent, which can then relay it to the user. Delegation is logged for auditing.
The coordinator breaks incident response into subtasks and delegates to specialists: diagnostics for root cause analysis, comms for status updates, and fix for implementing the solution. The coordinator synthesizes results into a final report. This pattern is powerful for complex workflows that require different expertise at each step.
Both support agents share access to the same knowledge base directory. L1 handles common questions using the knowledge base and escalates to L2 via agent-router when the issue requires deeper investigation. The shared knowledge base is a read-only file search tool -- agents cannot modify each other's data, maintaining isolation while sharing reference material.
Monitoring reveals delegation patterns, response times, and routing failures. Chain tracking shows the full delegation path for complex workflows. Per-agent stats help you identify bottlenecks and optimize model selection. Routing misses indicate messages that fell through without matching any agent binding.
Using scope: agent instead of scope: tree for orchestrator agents, allowing delegated sub-agents to bypass the orchestrator's sandbox restrictions
Always use scope: tree for any agent that delegates to other agents. Without tree scope, a sub-agent inherits the default sandbox mode, which may be less restrictive than intended. This is a common security gap in multi-agent setups.
Giving the triage agent access to action tools (bash, file_write, deploy) in addition to agent-router, allowing it to take actions directly instead of delegating
The triage agent should only have the agent-router tool. Its sole job is classification and delegation. If it has action tools, it may attempt to handle requests itself instead of routing to specialists, producing lower-quality results.
Assuming agents automatically share conversation context or memory when one delegates to another
Agent workspaces are fully isolated. Context must be explicitly passed in the delegation payload. If agents need shared knowledge, configure a shared knowledge base tool or shared file path. Implicit sharing would be a security vulnerability.
Creating circular delegation chains where Agent A delegates to Agent B, which delegates back to Agent A, causing infinite loops
Design delegation as a directed acyclic graph (DAG). The triage agent delegates to specialists, but specialists should never delegate back to the triage agent. Use clear hierarchies: triage -> specialist, coordinator -> workers.
Using an expensive model (Claude Sonnet, GPT-4o) for the triage agent when it only performs simple message classification
The triage agent does basic intent classification -- it does not need deep reasoning. Use GPT-4o-mini or a similar lightweight model. Reserve expensive models for specialist agents that generate detailed responses.
Multi-agent systems in OpenClaw enable sophisticated collaboration patterns beyond basic routing. The triage pattern uses a cheap classifier to route messages to expensive specialists. Agent-to-agent delegation via the agent-router tool passes context explicitly. The coordinator pattern orchestrates multi-step workflows across specialist agents. Shared knowledge bases enable read-only data sharing without breaking workspace isolation. Always use scope: tree for orchestrators, restrict triage agents to agent-router only, pass context in delegation payloads, and design delegation as a DAG to prevent circular loops.
Interactive lessons and challenges on Stanza, practice in VS Code, Cursor, or the web.
Interactive lessons and challenges, right in your code editor.
Check the free courses. No credit card.