Skip to content

ADR 0005 — Chat is a native Qren surface, not a borrowed protocol

Qren needs a chat where people and their agents talk in the same place, as equals. This decides to build that chat ourselves rather than adopt an existing chat network. Borrowing one would bolt a second set of accounts and permissions alongside the ones Qren already enforces, and none of them can show an agent’s work properly — the steps it took, the tools it used, a card you tap to approve something. The quality bar is stated plainly: as quick and as polished as Slack or WhatsApp, with files, images, voice notes, reactions and phone notifications. Outside networks such as WhatsApp, email and Telegram stay connections we plug in, never the foundation.

Qren needs chat where humans and agents are peers. Candidates: Matrix via continuwuity (mature protocol, appservice bots, graded TAKE by the 2026-08-19 component research), a Buzz-style Nostr relay (validated in the 2026-08-17 lab), or a native surface over Qren’s own substrate.

Operator requirements (2026-08-20, non-technical, decisive): Slack/WhatsApp speed and polish; files, images, video; markdown rendered properly; agent conversations rendered like Claude Code (transcript, tool calls, formatted output); voice messages; emoji reactions; future iOS/Android with instant push.

System-level facts the component research could not weigh: Qren already owns an identity + membership + permission + event layer (the workspace substrate); Nostr-in-core was already rejected (2026-08-18); chat transport was already placed at the edge for appliance-down survival (ADR 0002 refinement: edge relay, appliance as participant and archive).

Chat is built as a native surface over the workspace substrate:

  1. Messages are workspace-scoped rows authored by principals, flowing through the same storage, event-bus, and permission machinery as everything else. Agents are chat members because they are principals — no bot API, no second membership system.
  2. Message types are first-class and extensible: text, media, voice note, emoji reaction, agent turn (transcript + tool calls + formatted output), approval card (tap-to-authorize, wired to the broker). The agent-turn type is the differentiator no borrowed protocol models natively.
  3. Transport rides the edge relay (always-on): live delivery and push notifications (APNs/FCM) fire from the edge; the appliance holds the canonical archive and the agent-visible copy; history back-fills on reconnect. Media delivery uses the same R2 machinery as the shadow.
  4. External networks (WhatsApp, Telegram, iMessage, Slack) remain connections — bridged in via the comms layer — never the substrate.

Matrix and Nostr are rejected because each would bolt a second identity/ membership/state system alongside the one Qren already enforces, and both model human-to-human text, leaving agent semantics as a permanent retrofit.

  • Qren owns message UX (threads, mentions, read-state, reactions) — real, well-trodden work; the polish bar is Slack/WhatsApp, explicitly.
  • The mobile apps consume the same edge relay; push exists from day one of mobile, not as a later add-on.
  • Chat quality is coupled to the workspace substrate’s quality — one system to harden instead of two to reconcile.
  • No federation with external Matrix/Nostr networks; interop is bridges, by design.