Overview
Rooms are the runtime and collaboration boundary in MeshAgent. A room is where humans, agents, tools, services, files, queues, and shared documents come together around the same live context. Projects can contain many rooms, and each room can have its own participants, room-scoped services, and persisted state. The Room APIs are how you interact with that runtime. They give you the built-in primitives for messaging, storage, queues, documents, containers, secrets, and the other capabilities that make a room useful as an execution environment.CLI commands
Usemeshagent rooms ... to create and manage rooms in a project:
bash
meshagent room <api> ... to work inside a specific room through the Room APIs. Start with meshagent room --help, then drill into the API you need:
bash
meshagent room service ... when you want to inspect or restart services that are already running in a room session. Use the project-level meshagent service ... command when you want to deploy, update, validate, or delete saved services. See Deploy Services with MeshAgent.
How rooms fit into MeshAgent
- A project groups many rooms.
- A room is the live workspace for one stream of collaboration or execution.
- A session is one active run of that room.
Room APIs
Rooms expose a set of room-scoped APIs through theRoomClient:
- Agents API
AgentsClient: Call agents, invoke toolkits, and work with agent participants in the room. - Containers API
ContainersClient: Run containers and inspect container activity in the room runtime. - Database API
DatabaseClient: Store and query structured room data in tables. - Memory API
MemoryClient: Store and recall room-scoped memories for agents and workflows. - Developer API
DeveloperClient: Send logs and inspect developer events for the room. - Messaging API
MessagingClient: Send and receive real-time messages between room participants. - Queues API
QueuesClient: Send and receive queued work inside the room. - Secrets API
SecretsClient: Create and use room-scoped secrets, OAuth tokens, and related credentials. - Services API
ServicesClient: List running services in the room and request a restart for one service. - Storage API
StorageClient: Read and write files in room storage. - Sync API
SyncClient: Work with shared documents and synchronized room state.
Room lifecycle and sessions
Rooms are durable named workspaces, but runtime activity happens in sessions.- A room session starts when the room becomes active.
- During that session, participants connect, services run, and room activity is recorded.
- When activity stops, the room shuts down automatically so compute is not kept running unnecessarily. Persisted data written through storage, database, or sync remains available according to that API’s behavior.
Using Room APIs in Deployed Services
If you deploy a MeshAgent service and want that service to use the Room APIs, you must grant that access through the participant tokenapi scope. Deployment alone does not automatically give a service access to storage, database, secrets, containers, or the other Room APIs.
In practice, that means:
- set the token
apiscope on service tokens injected throughcontainer.environment[].token - or set the endpoint
apiscope for the participant identity that joins through a MeshAgent endpoint
ApiScope.agent_default()enables Agents, Queues, Messaging, Database, Sync, Storage, Containers, and Developer access.ApiScope.full()adds Secrets, Admin, and Tunnels access on top ofagent_default().
- Storage / Sync: path-based grants
- Database: table-level grants
- Queues: send/receive/list controls
- Messaging: broadcast/list/send controls
- Containers: pull/run/log controls
- a room grant allowing it to join the room
- an
apiscope granting access to the Room APIs it needs
Using RoomClient from SDKs
All of the main SDKs expose aRoomClient with the same overall shape:
- connect to a room
- wait for readiness
- use sub-clients such as agents, messaging, storage, database, queues, secrets, and sync
- dispose the client when you are done
- Python:
RoomClientinmeshagent.api - TypeScript / JavaScript:
RoomClientin@meshagent/meshagent - Dart / Flutter:
RoomClientinpackage:meshagent/room_server_client.dart - .NET:
Meshagent.RoomClient