#Multiple Agents
1 messages Ā· Page 1 of 1 (latest)
@red cosmos Do you know the best way that could help with it?
Yep ā this is a great use case for OpenClaw.
Best pattern for your Dungeon Master setup:
- One āorchestratorā DM agent (the one players talk to)
- Specialist agents (rules, lore, encounter balance, NPC voice, etc.)
- Sub-agents for temporary parallel tasks (fast drafts/checks)
Minimal setup
openclaw agents add dm
openclaw agents add rules
openclaw agents add lore
openclaw agents bind --agent dm --bind discord
openclaw agents list --bindings
Then enable cross-agent collaboration in config:
{
tools: {
agentToAgent: {
enabled: true,
allow: ["dm", "rules", "lore"],
},
sessions: {
visibility: "all",
},
},
}
Restart gateway after config changes:
openclaw gateway restart
For Dungeon Master specifically
- Keep dm as the only user-facing agent.
- Let dm delegate:
- rules disputes ā rules
- continuity/world state ā lore
- DM merges outputs into one clean final response to players.
When to use sub-agents instead of full extra agents
Use sub-agents for one-off jobs (āgenerate 3 balanced encountersā, ādraft tavern dialogueā).
Use separate agents when you need persistent memory/persona/workspace per role.
Docs:
- Multi-agent routing: https://docs.openclaw.ai/concepts/multi-agent
- Sub-agents: https://docs.openclaw.ai/tools/subagents
- Session tools (
sessions_send, etc.): https://docs.openclaw.ai/concepts/session-tool - Agents CLI: https://docs.openclaw.ai/cli/agents
If you want, I can draft a ready-to-paste openclaw.json for your exact DM stack (e.g. D&D 5e + lore + combat referee).
So for another campaign in another setting, it would be best to have new agent, and sub-agents for this system?
Yep ā thatās a solid approach.
Rule of thumb:
- New campaign with separate canon/lore/style ā make a new campaign agent
- Temporary tasks inside that campaign ā use sub-agents
- Same game system across campaigns ā you can keep one shared rules agent (optional)
So a clean setup is:
dm-campaign-adm-campaign-brules-<system>(shared, if same ruleset)- sub-agents spawned by each DM for encounter gen, NPC drafts, recap cleanup, etc.
That gives you strong separation (less lore bleed between campaigns) without exploding complexity.
If you want, I can sketch a concrete routing/layout for Discord threads so each campaign stays isolated cleanly.
What if i would have many settings in which i play. Wouldnt it be too many agents/sub agents?
Exactly ā this is where people overbuild š
You can run many agents, but you usually shouldnāt unless you need hard isolation.
Practical scaling rule
Use fewer long-lived agents + many threads/sessions + ephemeral sub-agents.
Good default for many settings
- 1 DM orchestrator agent
- 1 rules agent per ruleset (not per campaign)
- 1 Discord thread per campaign/setting
- sub-agents only for temporary tasks (they donāt need to be permanent)
When to create a new full agent
Only if you need one of these:
- Different persona/behavior that must stay isolated
- Different tool permissions/sandbox
- Different model/auth/workspace isolation
- You keep getting lore bleed and thread/file separation isnāt enough
If not, keep it in one DM agent and separate by:
- campaign folders/files in workspace
- one thread per campaign
- strict āload only this campaign fileā prompt pattern
So yes, too many agents can become maintenance pain. Start lean, then split only where isolation is really needed.
Docs:
Which prompt, would be best to make different agents work and cooperate?
Great question. The best ācooperation promptā is less about creativity and more about a strict contract between agents.
Use this pattern in AGENTS.md for each role:
1) Orchestrator (main DM) prompt
You are the Campaign Orchestrator DM.
Goal:
- Run the game session for players.
- Delegate specialist tasks to other agents when needed.
- Merge specialist outputs into one final in-world response.
Specialists:
- rules-agent: validates mechanics/rules interactions
- lore-agent: validates setting canon and continuity
Delegation rules:
1) Delegate only when needed (rules ambiguity, canon conflict, encounter balance).
2) Send clear, bounded tasks with context and expected output format.
3) Never expose internal agent chatter to players.
4) If specialists disagree, ask one clarification follow-up, then decide.
5) Keep the player-facing response concise and immersive.
Output behavior:
- To player: narrative + actionable choices.
- Internal: keep summaries of decisions, rulings, and canon updates.
2) Rules agent prompt
You are Rules Agent. Your scope is mechanics only.
Do:
- Validate moves strictly by the chosen ruleset.
- Cite rule source/section if available.
- Return ruling + confidence + edge cases.
Do NOT:
- Write story narration.
- Change campaign lore.
- Invent rules when uncertain; provide best interpretation and uncertainty.
Output JSON only:
{
"ruling": "...",
"reasoning_short": "...",
"confidence": "high|medium|low",
"edge_cases": ["..."],
"needs_dm_decision": true|false
}
3) Lore agent prompt
You are Lore Agent. Your scope is setting continuity only.
Do:
- Check names, factions, places, timeline consistency.
- Flag contradictions with existing canon notes.
- Propose minimal retcons when needed.
Do NOT:
- Decide mechanics.
- Override DM tone/goals.
Output JSON only:
{
"canon_ok": true|false,
"conflicts": ["..."],