Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
Run multiple isolated agents — each with its own workspace, state directory (
agentDirAn agent here is the full per-persona scope: workspace files, auth profiles, model registry, and session store.
agentDir~/.openclaw/agents/<agentId>/An agent is a fully scoped brain with its own:
agentDir~/.openclaw/agents/<agentId>/sessionsAuth profiles are per-agent. Each agent reads from its own:
text~/.openclaw/agents/<agentId>/agent/auth-profiles.json
Skills are loaded from each agent workspace plus shared roots such as
~/.openclaw/skillsagents.defaults.skillsagents.list[].skillsThe Gateway can host one agent (default) or many agents side-by-side.
~/.openclaw/openclaw.jsonOPENCLAW_CONFIG_PATH~/.openclawOPENCLAW_STATE_DIR~/.openclaw/workspace~/.openclaw/workspace-<agentId>~/.openclaw/agents/<agentId>/agentagents.list[].agentDir~/.openclaw/agents/<agentId>/sessionsIf you do nothing, OpenClaw runs a single agent:
agentIdmainagent:main:<mainKey>~/.openclaw/workspace~/.openclaw/workspace-<profile>OPENCLAW_PROFILE~/.openclaw/agents/main/agentUse the agent wizard to add a new isolated agent:
bashopenclaw agents add work
Then add
bindingsVerify with:
bashopenclaw agents list --bindings
text```bash} openclaw agents add coding openclaw agents add social ``` Each agent gets its own workspace with `SOUL.md`, `AGENTS.md`, and optional `USER.md`, plus a dedicated `agentDir` and session store under `~/.openclaw/agents/<agentId>`.
text* Discord: one bot per agent, enable Message Content Intent, copy each token. * Telegram: one bot per agent via BotFather, copy each token. * WhatsApp: link each phone number per account. ```bash} openclaw channels login --channel whatsapp --account work ``` See channel guides: [Discord](/channels/discord), [Telegram](/channels/telegram), [WhatsApp](/channels/whatsapp).
With multiple agents, each
agentIdaccountIdAGENTS.mdSOUL.mdThis lets multiple people share one Gateway server while keeping their AI "brains" and data isolated.
If one agent should search another agent's QMD session transcripts, add extra collections under
agents.list[].memorySearch.qmd.extraCollectionsagents.defaults.memorySearch.qmd.extraCollectionsjson5{ agents: { defaults: { workspace: "~/workspaces/main", memorySearch: { qmd: { extraCollections: [{ path: "~/agents/family/sessions", name: "family-sessions" }], }, }, }, list: [ { id: "main", workspace: "~/workspaces/main", memorySearch: { qmd: { extraCollections: [{ path: "notes" }], // resolves inside workspace -> collection named "notes-main" }, }, }, { id: "family", workspace: "~/workspaces/family" }, ], }, memory: { backend: "qmd", qmd: { includeDefaultMemory: false }, }, }
The extra collection path can be shared across agents, but the collection name stays explicit when the path is outside the agent workspace. Paths inside the workspace remain agent-scoped so each agent keeps its own transcript search set.
You can route different WhatsApp DMs to different agents while staying on one WhatsApp account. Match on sender E.164 (like
+15551234567peer.kind: "direct"Example:
json5{ agents: { list: [ { id: "alex", workspace: "~/.openclaw/workspace-alex" }, { id: "mia", workspace: "~/.openclaw/workspace-mia" }, ], }, bindings: [ { agentId: "alex", match: { channel: "whatsapp", peer: { kind: "direct", id: "+15551230001" } }, }, { agentId: "mia", match: { channel: "whatsapp", peer: { kind: "direct", id: "+15551230002" } }, }, ], channels: { whatsapp: { dmPolicy: "allowlist", allowFrom: ["+15551230001", "+15551230002"], }, }, }
Notes:
Bindings are deterministic and most-specific wins:
Channels that support multiple accounts (e.g. WhatsApp) use
accountIdaccountIdIf you want a channel-wide default account when
accountIdchannels.<channel>.defaultAccountdefaultCommon channels supporting this pattern include:
whatsapptelegramdiscordslacksignalimessageirclinegooglechatmattermostmatrixnextcloud-talkbluebubbleszalozalousernostrfeishuagentIdaccountId"personal""biz"bindingagentId(channel, accountId, peer)agent:<agentId>:<mainKey>session.mainKeytext```json5} { agents: { list: [ { id: "chat", name: "Everyday", workspace: "~/.openclaw/workspace-chat", model: "anthropic/claude-sonnet-4-6", }, { id: "opus", name: "Deep Work", workspace: "~/.openclaw/workspace-opus", model: "anthropic/claude-opus-4-6", }, ], }, bindings: [ { agentId: "chat", match: { channel: "whatsapp" } }, { agentId: "opus", match: { channel: "telegram" } }, ], } ``` Notes: * If you have multiple accounts for a channel, add `accountId` to the binding (for example `{ channel: "whatsapp", accountId: "personal" }`). * To route a single DM/group to Opus while keeping the rest on chat, add a `match.peer` binding for that peer; peer matches always win over channel-wide rules.
text```json5} { agents: { list: [ { id: "chat", name: "Everyday", workspace: "~/.openclaw/workspace-chat", model: "anthropic/claude-sonnet-4-6", }, { id: "opus", name: "Deep Work", workspace: "~/.openclaw/workspace-opus", model: "anthropic/claude-opus-4-6", }, ], }, bindings: [ { agentId: "opus", match: { channel: "whatsapp", peer: { kind: "direct", id: "+15551234567" } }, }, { agentId: "chat", match: { channel: "whatsapp" } }, ], } ``` Peer bindings always win, so keep them above the channel-wide rule.
text```json5} { agents: { list: [ { id: "family", name: "Family", workspace: "~/.openclaw/workspace-family", identity: { name: "Family Bot" }, groupChat: { mentionPatterns: ["@family", "@familybot", "@Family Bot"], }, sandbox: { mode: "all", scope: "agent", }, tools: { allow: [ "exec", "read", "sessions_list", "sessions_history", "sessions_send", "sessions_spawn", "session_status", ], deny: ["write", "edit", "apply_patch", "browser", "canvas", "nodes", "cron"], }, }, ], }, bindings: [ { agentId: "family", match: { channel: "whatsapp", peer: { kind: "group", id: "120363999999999999@g.us" }, }, }, ], } ``` Notes: * Tool allow/deny lists are **tools**, not skills. If a skill needs to run a binary, ensure `exec` is allowed and the binary exists in the sandbox. * For stricter gating, set `agents.list[].groupChat.mentionPatterns` and keep group allowlists enabled for the channel.
Each agent can have its own sandbox and tool restrictions:
js{ agents: { list: [ { id: "personal", workspace: "~/.openclaw/workspace-personal", sandbox: { mode: "off", // No sandbox for personal agent }, // No tool restrictions - all tools available }, { id: "family", workspace: "~/.openclaw/workspace-family", sandbox: { mode: "all", // Always sandboxed scope: "agent", // One container per agent docker: { // Optional one-time setup after container creation setupCommand: "apt-get update && apt-get install -y git curl", }, }, tools: { allow: ["read"], // Only read tool deny: ["exec", "write", "edit", "apply_patch"], // Deny others }, }, ], }, }
Benefits:
See Multi-agent sandbox and tools for detailed examples.
© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine