Skip to content

What is Chat?

Chat is the user-facing conversation app for Matrix. It is one vertical built on the Matrix substrate (Matrix is docker-for-actors / npm-for-actors — a typed pub/sub/RPC fabric where every Feed, Service, and Component is an actor on a federated bus; Chat is one product surface on that fabric, not the fabric itself).

It lets a user pick an actor target (a chat agent, a workstream, an actor running on the user's Host, or the Director's currently-selected mount) and have a back-and-forth conversation with it. Behind the scenes, Chat translates user input into $prompt ops on system.agents, follows the resulting $activity stream, and renders thinking, tokens, tool calls, and final responses inline.

The shipped surface

The Chat app (@open-matrix/chat) is a hybrid package — it has a browser bundle and a runtime-side component declaration. The browser bundle registers these custom elements:

TagClassPurpose
chat-appMatrixChatAppPage-level shell and orchestrator.
chat-inputChatInputText input with submit.
chat-message-listChatMessageListStreaming transcript.
chat-sidebarChatSidebarSessions, settings, themes.
chat-headerChatHeaderTarget/session indicator.
chat-session-panelSessionPanelSession detail.
chat-connection-statusConnectionStatusBus connection indicator.
chat-status-barChatStatusBarBottom status.
mx-chat-messageMxChatMessageSingle message bubble (markdown, code, etc.).
mx-code-viewerMxCodeViewerHighlighted code block actor.
mx-markdown-viewerMxMarkdownViewerMarkdown actor with KaTeX, mermaid.
mx-data-tableMxDataTableInline interactive data table.
mx-component-browserMxComponentBrowserPick a component to embed in chat.
mx-activity-traceMxActivityTraceActorRender $activity frames as an ops trace.

Plus the runtime-side headless services (declared in matrix.json components[]): ChatSecurityRealmService, ChatTopicClaimService, ChatConversationProxy, ChatComponentLibraryProxy, ChatIdentityProxy, ChatPreferencesProxy, ChatSessionStateProxy, ChatMcpProxy, ChatExportService.

What Chat does today

  • Sends prompts to any promptable actor by setting a "target" (the actor you're conversing about) and routing through system.agents.
  • Streams responses (thinking → tokens → done) into the message list.
  • Maintains sessions: every conversation has a session ID, persisted by system.agents and surfaced in the sidebar.
  • Supports inline components (e.g., /files, /build, /diff, /components) via the messages.add-component op on chat-message-list. Slash commands are listed in ChatApp.ts:131-146.
  • Exports conversations as Markdown / JSON / printable HTML via ChatExportService.
  • Loads existing sessions (resume) by reading session_state.read({ key: 'transcript' }) against system.agents.

What Chat doesn't do

  • Run inference itself. Chat does not call provider drivers directly; it asks system.agents and observes activity frames.
  • Manage credentials. system.factotum is the only actor that reads/writes provider credentials.
  • Replace Director's Explorer. The Chat app is a focused thread lens; for browsing the actor space, use Director.
  • Fan out one prompt to multiple agents. A session has a single target.

Three runtime modes

The same browser bundle adapts based on the declared mode (chat/src/runtime/resolve-chat-config.ts:9):

Mode (code identifier)Where it runsWhen it's used
standalone-localSelf-contained: in-memory transport, local services, no external bus.Demos, tests, docs sandboxes.
standalone-connectedBrowser, with a caller-supplied transport (e.g., NATS-WS).Embedding Chat in another package's runtime.
daemon-hostedDeployed inside a runtime supervised by Host Service; services are runtime-side actors.Default for /apps/chat/ on a real Host.

The mode determines which services are bound (in-memory LocalConversationService vs. RemoteActorConversationAdapter, etc.). See Developer Guide: runtime integration.

Status note. The string daemon-hosted is a v1 code-level identifier. Host Service supervises runtimes today; the retired matrixd daemon is not the product path. The identifier will be renamed to runtime-vocabulary when the manifest reconciliation in P1.41 lands.

See also

Source: projects/matrix-3/packages/chat/src/index.ts (registration), src/ChatApp.ts:151-198 (page actor declaration), chat/matrix.json (manifest).