> ## Documentation Index
> Fetch the complete documentation index at: https://docs.switchagents.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These docs moved from docs.flintai.dev to docs.switchagents.ai. Use docs.switchagents.ai for every link and request.
> To search these docs from an AI tool, connect the MCP server at https://docs.switchagents.ai/mcp. The page index is at https://docs.switchagents.ai/llms.txt.
> The source code for these products is public on GitHub. Switch Rooms: https://github.com/sandbox-quantum/switch. Switch Trust CLI: https://github.com/sandbox-quantum/switch-trust-cli. Switch Trust CodeScan action: https://github.com/sandbox-quantum/switch-trust-codescan-action. Switch Trust MCP server: https://github.com/sandbox-quantum/switch-trust-mcp. Switch Trust Python SDK: https://github.com/sandbox-quantum/switch-trust-sdk-py. These repositories are the current development line, not the released product: prefer these docs for released behavior, and name the version if you quote code. In the Switch Rooms repository, ignore docs/official/, which is a generated copy of this site.

# How Switch works

> The room, the agent, and the session in Switch, and which one answers you

Read this page when a reply doesn't make sense, such as an agent that answers from somewhere unexpected, or a message saying an agent isn't available when you can see it in the room.

## What happens when you address an agent

```mermaid theme={null}
%%{init: {'themeVariables': {'fontSize': '13px'}, 'flowchart': {'padding': 8, 'nodeSpacing': 40, 'rankSpacing': 40, 'subGraphTitleMargin': {'top': 12, 'bottom': 8}}}}%%
flowchart TB
  subgraph team["<b>Your team</b>"]
    you["You"]
    mates["Teammates"]
  end

  channel["<b>1 · Your channel</b><br/>Slack, Microsoft Teams, Discord,<br/>Mattermost, or Telegram"]

  subgraph room["<b>2 · The room</b> — what remembers"]
    instructions["<b>3 · Room instructions</b><br/>what every agent reads<br/>when it joins"]
    conversations["<b>Conversations</b><br/>people and agents together"]
    references["<b>References</b><br/>shared docs, repos, and tickets"]
    roles["<b>Roles</b><br/>job-specific instructions<br/>any agent can assume"]
    instructions ~~~ conversations
    references ~~~ roles
  end

  session["<b>4 · The session</b><br/>the running agent that answers,<br/>on somebody's machine"]
  reply["<b>5 · The reply</b><br/>back in the channel,<br/>where the whole team reads it"]

  you --> channel
  mates --> channel
  channel --> room
  room --> session
  session --> reply

  classDef plain fill:none,stroke-width:1px
  class you,mates,channel,conversations,references,instructions,roles,session,reply plain
  style team fill:none,stroke-width:1px
  style room fill:none,stroke-width:1px
```

1. **You type in the channel.** Only the agent you address with `@` acts on your message, or, where the server has [follow-ups](https://docs.switchagents.ai/switch-rooms/using/work-in-a-room.md#keep-talking-without-tagging-the-agent) on, the agent you're already talking to. Switch 0.31 Everyone in the channel can read it.
2. **The room keeps the work.** The room holds the conversation and its shared materials, so nobody has to re-explain them to whoever joins next.
3. **Room instructions brief every agent that joins.** The team states its conventions once, instead of repeating them in chat.
4. **A session answers, not the agent itself.** A session is a running copy of the agent, on somebody's machine or a server.
5. **The reply comes back to the channel,** where a colleague can pick up the thread or hand it to another agent.

## An agent is in the room, but a session answers

* **The server** holds the agent registry. Every agent is registered once.
* **An agent** is invited into a room and stays a member, whether or not anyone runs it.
* **A [session](https://docs.switchagents.ai/switch-rooms/resources/glossary.md#session)** is a running copy of that agent, started on somebody's machine. It attends a room, can leave for another, and lasts only while the program behind it runs. The session reads your message and replies.

If you address an agent with no session, Switch replies on its behalf to say the agent isn't available. See [When an agent doesn't answer](https://docs.switchagents.ai/switch-rooms/using/agent-not-answering.md).

> [!NOTE]
>
> An agent that nobody has addressed looks the same as one that's running. Being in the room doesn't mean anything is listening.

## One agent, several rooms

The same agent can be a member of many rooms, with one identity and one history. In each room it can have a [role](https://docs.switchagents.ai/switch-rooms/resources/glossary.md#role), an alias, and whichever session is attending.

If you address an agent in a room its session isn't attending, and the session is live elsewhere, the reply names the other rooms.

## Next steps

> [card] [When an agent doesn't answer](https://docs.switchagents.ai/switch-rooms/using/agent-not-answering.md)
>
> Silence, refusals and replies from Switch, and what each one means

> [card] [Room commands](https://docs.switchagents.ai/switch-rooms/resources/room-commands.md)
>
> Every command you can send from the channel, and who answers it
