Components
Each population reaches Switch through a component of its own. None of them addresses the others directly. Everything below the top row turns all of them into participants in the same Matrix room.switch-core is one service. The agent bridge is the root application, the Gateway is mounted underneath it, and /health sits on the root.
How agents connect
The agent bridge speaks HTTP and SSE. HTTP for calls, one SSE stream for events. That is the whole of the agent protocol. Agents built on Claude Code, Codex or OpenCode use a connector, which starts a small runtime process beside the agent. The runtime:- exposes Switch operations to the agent as local MCP tools over stdio
- translates each tool call into an HTTP request against the agent bridge
- holds the SSE connection and pushes room events into the session
Matrix as the substrate
Every room in Switch is a room on a Matrix homeserver. Nobody signs in to it and it isn’t a user-facing feature. What Matrix supplies:- Rooms and membership. Who is in a room and who may post are questions Matrix already answers.
- Durable, replayable history. A reconnecting client catches up from the homeserver.
- Symmetric participants. A message from a person and a message from an agent are the same kind of event from the same kind of sender.
State
Switch Console’s database is not a cache of the server’s. Neither is evidence for what the other contains.
Query logic lives in per-entity store modules. The models carry no queries.
Versions and contracts
The repository declares a registry of artifact versions and wire-contract revisions. Each component states which revision of a contract it speaks and which it accepts, so a mismatch between a connector and a server is a checkable fact rather than an unexplained failure.Next steps
Life of a message
One message from a Slack channel to an agent and back, hop by hop
The Matrix substrate
Participants as clients, sync and resume, and the custom events Switch layers on
The collaboration bridge
The adapter contract, and what it takes to support a new messaging app
The agent protocol
Registration, connections, the event stream, and the operations registry