Status: experimental and unstable.
Assistant turns are stored as normal m.room.message events with:
- standard Matrix fallback fields such as
msgtypeandbody com.beeper.ai, which carries an AI SDK-styleUIMessage
Current shape:
{
"msgtype": "m.text",
"body": "...",
"com.beeper.ai": {
"id": "turn_123",
"role": "assistant",
"metadata": {
"turn_id": "turn_123"
},
"parts": []
}
}The final edit keeps com.beeper.ai as the canonical payload inside m.new_content. Streaming-only UI parts are compacted before final persistence.
When live streaming is available, the placeholder message also carries com.beeper.stream.
The bridge code does not hardcode the transport backend. It asks a BeeperStreamPublisher for a descriptor, registers the placeholder event, and emits live deltas against that target.
Live delta payloads use the stable com.beeper.llm envelope:
{
"turn_id": "turn_123",
"seq": 7,
"part": {
"type": "text-delta",
"id": "text-turn_123",
"delta": "hello"
},
"m.relates_to": {
"rel_type": "m.reference",
"event_id": "$placeholder"
}
}Envelope fields:
turn_idseqpartm.relates_to- optional
agent_id
part follows the AI SDK UIMessageChunk model.
When a turn completes, the placeholder is edited with the final assistant content. The final event is authoritative. The stream descriptor is no longer present after finalization.
For replacement events, Matrix fallback fields remain at the top level while canonical assistant fields such as com.beeper.ai and link previews are carried inside m.new_content.
The AI bridge may emit com.beeper.ai.compaction_status timeline events while retrying after context compaction.
Current fields are:
typesession_idmessages_beforemessages_aftertokens_beforetokens_aftersummarywill_retryerror
AI rooms broadcast org.matrix.msc4391.command_description state events for the user-facing commands implemented by the bridge. See docs/msc/com.beeper.mscXXXX-commands.md.
These keys appear as metadata or rendering hints on Matrix events:
com.beeper.aicom.beeper.streamcom.beeper.ai.model_idcom.beeper.ai.agentcom.beeper.ai.image_generationcom.beeper.ai.tts
- Custom agents are stored in login metadata, not published as room state events.
com.beeper.ai.infois registered as a known state type, but it is not actively broadcast.- Room capability state is sent through standard Beeper room-feature state, not a custom AI state event.