#Multiple Agents

1 messages Ā· Page 1 of 1 (latest)

dry onyx
#

How can i setup multiple agent which could work with themselves, help each other etc. I am trying to setup Dungeon Master, and for now i have main DM and one for the system i am trying to play. I am thinking about the best way to do it, and make it work, and maybe they will work better than only one agent.

sullen turtleBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> āœ… Mark Solution

dry onyx
#

@red cosmos Do you know the best way that could help with it?

red cosmosBOT
#

Yep — this is a great use case for OpenClaw.

Best pattern for your Dungeon Master setup:

  1. One ā€œorchestratorā€ DM agent (the one players talk to)
  2. Specialist agents (rules, lore, encounter balance, NPC voice, etc.)
  3. 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.


dry onyx
#

So for another campaign in another setting, it would be best to have new agent, and sub-agents for this system?

red cosmosBOT
#

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-a
  • dm-campaign-b
  • rules-<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.

dry onyx
#

What if i would have many settings in which i play. Wouldnt it be too many agents/sub agents?

red cosmosBOT
#

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:

dry onyx
#

Which prompt, would be best to make different agents work and cooperate?

red cosmosBOT
#

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": ["..."],