Skip to main content
A gateway room puts a roster of agents into one live chat, where they take bounded, @-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

  1. A user posts a message in a group chat.
  2. The gateway resolves the route room:standup and calls GatewayRoom.achat(prompt).
  3. Every rostered agent speaks in round 0; later turns go to whoever is @-mentioned.
  4. The combined reply (**researcher**: … then **critic**: …) returns through the outbox.
  5. The group sees one assistant turn.
  6. After a restart, the next message resumes the same schedule from the saved transcript.

How a Gateway Room Runs


Configuration Options

Each rooms.<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 in GatewayRoom.chat_history, so a restart loses nothing.
  • BotSessionManager swaps 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 only role and content.
  • 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 with clone_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

A room is routed exactly like an agent id.
build_rooms logs roster ids [...] are not defined under 'agents:' and will pass, and the gateway keeps running.
A bad roster is rejected at load time as rooms.<name>: <reason>, before any traffic arrives.
A route tool_policy narrows the room’s tools (the union of its members’ tools) for one turn, then restores them.
attachments go to each member whose chat / achat accepts them. A set cancel_token stops the roster between turns by raising InterruptedError.

Best Practices

The defaults (max_rounds: 3, max_messages: 20) already bound cost per human message. Raise them only when needed.
Members without clone_for_channel() pass instead of sharing state, so they never speak.
Reload handles it, but plain ids keep the transcript readable.
Round-0 fan-out and multi-mention turns both follow roster order.
Use Gateway Turn Lock when several gateway replicas serve the same chat.

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.