Feature: Self-hosted Matrix channel plugin — sovereign agent-to-human communication #212

Open
opened 2026-03-06 20:54:58 +00:00 by doxios · 0 comments
Collaborator

Motivation

Cobot's self-sovereign philosophy means the agent should not depend on third-party infrastructure it doesn't control. Current channel options (Telegram, IRC) all route through centralized services:

  • Telegram: Messages traverse Telegram's servers. Bot API is proprietary. Telegram can read, censor, or cut off communication at any time.
  • IRC: Better (federated, open protocol), but most networks are still centrally operated.

For a truly self-sovereign agent, the communication channel itself should be self-hosted.

Proposal

Add a Matrix channel plugin that connects to a self-hosted Matrix homeserver (e.g., Synapse, Conduit, Dendrite).

Why Matrix?

  • Self-hostable: Operator runs their own homeserver — no third-party dependency
  • Federated: Can still communicate with the wider Matrix network if desired, or run fully isolated
  • E2E encrypted: Olm/Megolm encryption — messages are unreadable even to the homeserver operator (if desired)
  • Open protocol: Well-documented spec, multiple server and client implementations
  • Rich ecosystem: Bridges to Telegram, IRC, Discord, Signal etc. — so Matrix becomes the sovereign hub
  • Bot SDK: matrix-nio (Python, async) is mature and well-maintained

Architecture

Same pattern as the existing Telegram plugin:

  • Implements ChannelProvider interface
  • Registers channel.on_message / channel.send_message
  • Config in cobot.yml:
    matrix:
      homeserver: https://matrix.example.com
      user_id: "@cobot:example.com"
      access_token: "..."
      # or device_id + keys for E2E
      rooms:
        - "!abc123:example.com"
    
  • Optional dependency: matrix-nio[e2e] (for encryption support)

Self-Sovereignty Comparison

Channel Self-hostable E2E Encrypted Open Protocol Federation
Telegram (bot API)
IRC ⚠️ (possible) (native) ⚠️
Matrix
Nostr ⚠️ (NIP-04/44)

Matrix and Nostr are the two most sovereign options. Matrix has the advantage of a mature bot ecosystem and reliable message delivery (homeserver stores history). Nostr has the advantage of no server at all — but relay availability and message ordering are less reliable for real-time agent communication.

Discussion Points

  1. Should this replace Telegram as the primary human↔agent channel, or complement it?
  2. E2E encryption: mandatory or optional? (E2E adds complexity — device verification, key management)
  3. Lightweight homeserver recommendation? Conduit (Rust, single binary) might be ideal for olymp
  4. Should the Matrix plugin also handle agent↔agent communication, or keep that on FileDrop/Nostr?

Prior Art


Filed by Doxios on behalf of Ben (@webdiverblue) from the Olymp-Doxios chat.

## Motivation Cobot's self-sovereign philosophy means the agent should not depend on third-party infrastructure it doesn't control. Current channel options (Telegram, IRC) all route through centralized services: - **Telegram**: Messages traverse Telegram's servers. Bot API is proprietary. Telegram can read, censor, or cut off communication at any time. - **IRC**: Better (federated, open protocol), but most networks are still centrally operated. For a truly self-sovereign agent, the communication channel itself should be self-hosted. ## Proposal Add a **Matrix channel plugin** that connects to a self-hosted Matrix homeserver (e.g., Synapse, Conduit, Dendrite). ### Why Matrix? - **Self-hostable**: Operator runs their own homeserver — no third-party dependency - **Federated**: Can still communicate with the wider Matrix network if desired, or run fully isolated - **E2E encrypted**: Olm/Megolm encryption — messages are unreadable even to the homeserver operator (if desired) - **Open protocol**: Well-documented spec, multiple server and client implementations - **Rich ecosystem**: Bridges to Telegram, IRC, Discord, Signal etc. — so Matrix becomes the sovereign hub - **Bot SDK**: `matrix-nio` (Python, async) is mature and well-maintained ### Architecture Same pattern as the existing Telegram plugin: - Implements `ChannelProvider` interface - Registers `channel.on_message` / `channel.send_message` - Config in `cobot.yml`: ```yaml matrix: homeserver: https://matrix.example.com user_id: "@cobot:example.com" access_token: "..." # or device_id + keys for E2E rooms: - "!abc123:example.com" ``` - Optional dependency: `matrix-nio[e2e]` (for encryption support) ### Self-Sovereignty Comparison | Channel | Self-hostable | E2E Encrypted | Open Protocol | Federation | |---------|:---:|:---:|:---:|:---:| | Telegram | ❌ | ❌ (bot API) | ❌ | ❌ | | IRC | ⚠️ (possible) | ❌ (native) | ✅ | ⚠️ | | Matrix | ✅ | ✅ | ✅ | ✅ | | Nostr | ✅ | ⚠️ (NIP-04/44) | ✅ | ✅ | Matrix and Nostr are the two most sovereign options. Matrix has the advantage of a mature bot ecosystem and reliable message delivery (homeserver stores history). Nostr has the advantage of no server at all — but relay availability and message ordering are less reliable for real-time agent communication. ## Discussion Points 1. Should this replace Telegram as the primary human↔agent channel, or complement it? 2. E2E encryption: mandatory or optional? (E2E adds complexity — device verification, key management) 3. Lightweight homeserver recommendation? Conduit (Rust, single binary) might be ideal for olymp 4. Should the Matrix plugin also handle agent↔agent communication, or keep that on FileDrop/Nostr? ## Prior Art - `matrix-nio`: https://github.com/matrix-nio/matrix-nio (Python async Matrix client) - Conduit: https://conduit.rs/ (lightweight Rust homeserver) - Dendrite: https://github.com/element-hq/dendrite (Go homeserver) --- *Filed by Doxios on behalf of Ben (@webdiverblue) from the Olymp-Doxios chat.*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ultanio/cobot#212
No description provided.