@-addressed turns and reply as a single assistant message.
Quick Start
1
Simplest: Python on one platform
2
With YAML
Declare the room under
rooms: and bind it with a room:<name> route.3
Several platforms at once
User Interaction Flow
- A user posts a message in a group chat.
- The gateway resolves the route
room:standupand callsGatewayRoom.achat(prompt). - Every rostered agent speaks in round 0; later turns go to whoever is
@-mentioned. - The combined reply (
**researcher**: …then**critic**: …) returns through the outbox. - The group sees one assistant turn.
- After a restart, the next message resumes the same schedule from the saved transcript.
How a Gateway Room Runs
Configuration Options
Eachrooms.<name> YAML entry is one RoomConfig.
The top-level key is
rooms: (plural). A room that cannot be built is rejected when the config loads, with an error like rooms.standup: ….Rooms SDK Reference
Full
RoomConfig surface.Conversation Rooms
The core, in-memory
Room.Durable Transcript
The transcript lives inGatewayRoom.chat_history, so a restart loses nothing.
BotSessionManagerswaps the transcript in per user/chat and saves it to the configured session store.- Member replies are stored as
{"role": "assistant", "content": "<id>: <text>"}, because session stores keep onlyroleandcontent. - Ids containing
": "still reload intact, since the longest id is matched first. - The session’s per-agent lock keeps one writer per room.
Member Isolation
Each agent is cloned withclone_for_channel() when it joins a room, so history and tools never leak between rooms or routes.
The room swaps each member’s chat_history and tools per turn, so a shared instance would corrupt other routes.
Choosing a Surface
Common Patterns
Different rooms on different channels
Different rooms on different channels
Missing roster member
Missing roster member
build_rooms logs roster ids [...] are not defined under 'agents:' and will pass, and the gateway keeps running.Bad room config
Bad room config
A bad roster is rejected at load time as
rooms.<name>: <reason>, before any traffic arrives.Narrow tools per route
Narrow tools per route
A route
tool_policy narrows the room’s tools (the union of its members’ tools) for one turn, then restores them.Attachments and cancel
Attachments and cancel
attachments go to each member whose chat / achat accepts them. A set cancel_token stops the roster between turns by raising InterruptedError.Best Practices
Keep the caps low
Keep the caps low
The defaults (
max_rounds: 3, max_messages: 20) already bound cost per human message. Raise them only when needed.Use agents that can be cloned
Use agents that can be cloned
Members without
clone_for_channel() pass instead of sharing state, so they never speak.Avoid ': ' in agent ids
Avoid ': ' in agent ids
Reload handles it, but plain ids keep the transcript readable.
Order the roster on purpose
Order the roster on purpose
Round-0 fan-out and multi-mention turns both follow roster order.
Pair with a turn lock across replicas
Pair with a turn lock across replicas
Use Gateway Turn Lock when several gateway replicas serve the same chat.
Related
Conversation Rooms
The core, in-memory room.
Bot Gateway
Channels, agents, and routes.
Rooms SDK Reference
Full
Room and RoomConfig API.Gateway Turn Lock
Serialise per-session turns across replicas.

