मल्टी-एजेंट रूटिंग
- लक्ष्य: कई isolated एजेंट्स (अलग वर्कस्पेस +
agentDir+ सेशंस), साथ ही एक चल रहे Gateway में कई चैनल अकाउंट्स (जैसे दो WhatsApps)। 46. इनबाउंड को बाइंडिंग्स के माध्यम से किसी एजेंट तक रूट किया जाता है।
“एक एजेंट” क्या है?
एक एजेंट एक पूर्ण-स्कोप “ब्रेन” है, जिसके पास अपना:- वर्कस्पेस (फ़ाइलें, AGENTS.md/SOUL.md/USER.md, स्थानीय नोट्स, पर्सोना नियम)।
- स्टेट डायरेक्टरी (
agentDir) जिसमें auth प्रोफ़ाइल, मॉडल रजिस्ट्री, और प्रति-एजेंट विन्यास होता है। - सत्र स्टोर (चैट इतिहास + रूटिंग स्टेट) जो
~/.openclaw/agents/<agentId>/sessionsके अंतर्गत होता है।
- Auth प्रोफ़ाइल्स प्रति‑एजेंट होती हैं। 48. प्रत्येक एजेंट अपनी स्वयं की चीज़ों से पढ़ता है:
- मुख्य एजेंट क्रेडेंशियल्स अपने‑आप साझा नहीं किए जाते। 50. कभी भी
agentDirको एजेंट्स के बीच पुन: उपयोग न करें (यह auth/सेशन टकराव पैदा करता है)। If you want to share creds, copyauth-profiles.jsoninto the other agent’sagentDir.
skills/ folder, with shared skills
available from ~/.openclaw/skills. See Skills: per-agent vs shared.
Gateway एक एजेंट (डिफ़ॉल्ट) या कई एजेंट साइड‑बाय‑साइड होस्ट कर सकता है।
Workspace note: each agent’s workspace is the default cwd, not a hard
sandbox. Relative paths resolve inside the workspace, but absolute paths can
reach other host locations unless sandboxing is enabled. See
Sandboxing.
पाथ्स (त्वरित मानचित्र)
- विन्यास:
~/.openclaw/openclaw.json(याOPENCLAW_CONFIG_PATH) - स्टेट डायरेक्टरी:
~/.openclaw(याOPENCLAW_STATE_DIR) - वर्कस्पेस:
~/.openclaw/workspace(या~/.openclaw/workspace-<agentId>) - एजेंट डायरेक्टरी:
~/.openclaw/agents/<agentId>/agent(याagents.list[].agentDir) - सत्र:
~/.openclaw/agents/<agentId>/sessions
सिंगल-एजेंट मोड (डिफ़ॉल्ट)
यदि आप कुछ नहीं करते, तो OpenClaw एक ही एजेंट चलाता है:agentIdका डिफ़ॉल्टmainहोता है।- सत्रों की कुंजी
agent:main:<mainKey>के रूप में होती है। - वर्कस्पेस का डिफ़ॉल्ट
~/.openclaw/workspaceहोता है (या~/.openclaw/workspace-<profile>जबOPENCLAW_PROFILEसेट हो)। - स्टेट का डिफ़ॉल्ट
~/.openclaw/agents/main/agentहोता है।
एजेंट हेल्पर
नया अलग-थलग एजेंट जोड़ने के लिए एजेंट विज़ार्ड का उपयोग करें:bindings जोड़ें (या विज़ार्ड को करने दें)।
सत्यापित करें:
कई एजेंट = कई लोग, कई व्यक्तित्व
कई एजेंटों के साथ, प्रत्येकagentId एक पूरी तरह अलग-थलग पर्सोना बन जाता है:
- अलग फ़ोन नंबर/खाते (प्रति चैनल
accountId)। - अलग व्यक्तित्व (प्रति-एजेंट वर्कस्पेस फ़ाइलें जैसे
AGENTS.mdऔरSOUL.md)। - अलग auth + सत्र (स्पष्ट रूप से सक्षम किए बिना कोई क्रॉस‑टॉक नहीं)।
एक WhatsApp नंबर, कई लोग (DM विभाजन)
You can route different WhatsApp DMs to different agents while staying on one WhatsApp account. Match on sender E.164 (like+15551234567) with peer.kind: "direct". Replies still come from the same WhatsApp number (no per‑agent sender identity).
महत्वपूर्ण विवरण: डायरेक्ट चैट एजेंट की मुख्य सत्र कुंजी में सिमट जाती हैं,
इसलिए वास्तविक अलगाव के लिए प्रति व्यक्ति एक एजेंट आवश्यक है।
उदाहरण:
- DM प्रवेश नियंत्रण प्रति WhatsApp खाता वैश्विक होता है (पेयरिंग/अलाउलिस्ट), प्रति एजेंट नहीं।
- साझा समूहों के लिए, समूह को एक एजेंट से बाँधें या Broadcast groups का उपयोग करें।
रूटिंग नियम (संदेश किसी एजेंट को कैसे चुनते हैं)
बाइंडिंग्स निर्धारित होती हैं और सबसे विशिष्ट नियम जीतता है:peerमिलान (सटीक DM/समूह/चैनल आईडी)parentPeerमिलान (थ्रेड इनहेरिटेंस)guildId + roles(Discord रोल रूटिंग)guildId(Discord)teamId(Slack)- डिफ़ॉल्ट एजेंट पर फ़ॉलबैक (
agents.list[].default, अन्यथा सूची की पहली प्रविष्टि, डिफ़ॉल्ट:main) - चैनल-स्तरीय मिलान (
accountId: "*") - डिफ़ॉल्ट एजेंट पर फ़ॉलबैक (
agents.list[].default, अन्यथा सूची की पहली प्रविष्टि, डिफ़ॉल्ट:main)
peer + guildId), तो सभी निर्दिष्ट फ़ील्ड आवश्यक हैं (AND सेमांटिक्स)।
कई खाते / फ़ोन नंबर
Channels that support multiple accounts (e.g. WhatsApp) useaccountId to identify
each login. Each accountId can be routed to a different agent, so one server can host
multiple phone numbers without mixing sessions.
अवधारणाएँ
agentId: एक “ब्रेन” (वर्कस्पेस, प्रति-एजेंट auth, प्रति-एजेंट सत्र स्टोर)।accountId: एक चैनल खाता इंस्टेंस (जैसे WhatsApp खाता"personal"बनाम"biz")।binding:(channel, accountId, peer)और वैकल्पिक रूप से guild/team IDs के आधार पर इनबाउंड संदेशों को किसीagentIdतक रूट करता है।- डायरेक्ट चैट
agent:<agentId>:<mainKey>में सिमट जाती हैं (प्रति‑एजेंट “मुख्य”;session.mainKey)।
उदाहरण: दो WhatsApp → दो एजेंट
~/.openclaw/openclaw.json (JSON5):
उदाहरण: WhatsApp दैनिक चैट + Telegram गहन कार्य
चैनल के आधार पर विभाजन: WhatsApp को तेज़ दैनिक एजेंट पर और Telegram को Opus एजेंट पर रूट करें।- यदि किसी चैनल के लिए आपके पास कई खाते हैं, तो बाइंडिंग में
accountIdजोड़ें (उदाहरण के लिए{ channel: "whatsapp", accountId: "personal" })। - बाकी को चैट पर रखते हुए किसी एक DM/समूह को Opus पर रूट करने के लिए, उस पीयर के लिए
match.peerबाइंडिंग जोड़ें; पीयर मिलान हमेशा चैनल‑व्यापी नियमों से जीतता है।
उदाहरण: वही चैनल, एक पीयर Opus पर
WhatsApp को तेज़ एजेंट पर रखें, लेकिन एक DM को Opus पर रूट करें:WhatsApp समूह से बँधा पारिवारिक एजेंट
एक समर्पित पारिवारिक एजेंट को एक ही WhatsApp समूह से बाँधें, मेंशन गेटिंग और कड़े टूल नीति के साथ:- Tool allow/deny lists are tools, not skills. If a skill needs to run a
binary, ensure
execis allowed and the binary exists in the sandbox. - अधिक कड़े गेटिंग के लिए,
agents.list[].groupChat.mentionPatternsसेट करें और चैनल के लिए समूह अलाउलिस्ट सक्षम रखें।
प्रति‑एजेंट Sandbox और टूल विन्यास
v2026.1.6 से शुरू होकर, प्रत्येक एजेंट का अपना sandbox और टूल प्रतिबंध हो सकता है:setupCommand lives under sandbox.docker and runs once on container creation.
Per-agent sandbox.docker.* overrides are ignored when the resolved scope is "shared".
लाभ:
- सुरक्षा अलगाव: अविश्वसनीय एजेंटों के लिए टूल्स सीमित करें
- संसाधन नियंत्रण: कुछ एजेंटों को sandbox करें जबकि अन्य को होस्ट पर रखें
- लचीली नीतियाँ: प्रति एजेंट अलग अनुमतियाँ
tools.elevated is global and sender-based; it is not configurable per agent.
If you need per-agent boundaries, use agents.list[].tools to deny exec.
For group targeting, use agents.list[].groupChat.mentionPatterns so @mentions map cleanly to the intended agent.
विस्तृत उदाहरणों के लिए Multi-Agent Sandbox & Tools देखें।