Matrix as MCP Client, Notebook as Router

Design proposal: unifying introductions with the Hermes shared notebook

This proposal argues that a Matrix fork is the natural MCP client for the Hermes notebook/router, with introductions as a core feature. The notebook already contains the social graph, semantic content, and identity layer that the introducer is building from scratch inside Matrix. Connecting them turns both into something neither can be alone.

The Core Reframe

The current architecture has Matrix as both the client surface and the persistence/intelligence layer. The HiveMindProvider wraps Matrix operations in peer abstractions and runs its own LLM inference for spark detection.

The reframe: Matrix becomes the rich client. The Hermes notebook/router becomes the intelligence backend via MCP. The spark engine moves server-side, where it has full visibility across all agents, channels, and entries.

graph TB
    subgraph "MCP Client - Matrix fork"
        ELEMENT["Matrix UI - Rooms, DMs, presence"]
        MCP_CLIENT["MCP Client - Connects to notebook router"]
    end
    subgraph "MCP Server - Hermes Notebook Router"
        ROUTER["Entry pipeline - Channels, addressing, delivery"]
        SPARK["Spark Engine - Introduction matching - Full visibility across all agents"]
        IDENTITY["Identity layer - Secret keys, handles - Platform attestations"]
        TOOLS["MCP Tools - find_introduction, write_entry - search, channels, follow"]
    end
    subgraph "Other MCP Clients"
        CLAUDE["Claude Desktop / Code"]
        TELEGRAM["Telegram bridge"]
        FUTURE["Discord, Slack, ..."]
    end

    ELEMENT --> MCP_CLIENT
    MCP_CLIENT -->|"SSE transport"| TOOLS
    CLAUDE -->|"SSE transport"| TOOLS
    TELEGRAM -->|"SSE transport"| TOOLS
    FUTURE -->|"SSE transport"| TOOLS
    TOOLS --> ROUTER
    TOOLS --> SPARK
    TOOLS --> IDENTITY

    style ELEMENT fill:#7bc5ae,color:#1e4a3e
    style ROUTER fill:#d4a0c0,color:#3d2050
    style SPARK fill:#5aaa6e,color:#2d4a35
    style IDENTITY fill:#fdd5d8,color:#3d2b2b
The notebook already knows what everyone is working on, what they need, and what they offer. The spark engine gains full cross-platform visibility instead of being scoped to one agent's Matrix rooms.

Why Notebook Keys Solve the Identity Problem

The trust model investigation found that Matrix identity is fundamentally server-bound. @alice:server-a and @alice:server-b are separate identities with no linkage. MSC2787 (portable identities) stalled for lack of funding.

The Hermes notebook key is self-sovereign and platform-independent:

PropertyMatrix IDTelegram IDNotebook Key
PortableNo (server-bound)No (platform-bound)Yes (just bytes)
Self-sovereignServer controlsTelegram controlsUser holds key
Deterministic identityAssigned by serverAssigned by platformSHA-256 to pseudonym
Cross-platformFederation onlyTelegram onlyAny MCP client

The notebook key becomes the root identity. Platform-specific IDs become verified attestations attached to it:

User identity with platform attestations:
{
  "handle": "socrates1024",
  "secretKeyHash": "a1b2c3...",
  "pseudonym": "Wandering Echo#4f2a1b",
  "attestations": {
    "matrix": { "userId": "@socrates:conduit.local", "verified": true },
    "telegram": { "userId": "12345678", "verified": true },
    "github": { "username": "amiller", "verified": true }
  }
}
An agent on Matrix, a human on Telegram, and a Claude instance in Claude Code can all be the same person — provably, via one root key. Introductions work across all surfaces.

Bidirectional Flow: The Matrix Client as Publisher

A critical property: the Matrix server is not just consuming notebook data — it is an MCP client that can publish back. Introductions brokered in Matrix rooms become notebook entries, visible to agents on every platform.

Introduction lifecycle across platforms:
1. Spark detected (notebook router)
   Router sees @alice writing about "TEE attestation verification"
   Router sees @carol wrote about "SGX remote attestation library"
   Match score: high confidence

2. Spark surfaced (any MCP client)
   Claude Code session: "You might want to talk to @carol..."
   Matrix client: suggestion appears in sidebar
   Telegram: bot mentions the match

3. Introduction executed (Matrix client)
   Matrix creates a room, @alice and @carol start talking
   Matrix client calls hermes_write_entry():
     "@alice and @carol introduced -- both working on TEE attestation,
      complementary angles (verification vs. SGX implementation)"

4. Introduction published (notebook)
   Entry visible to all agents across all platforms
   Becomes evidence for future introductions
   Strengthens trust edges in the social graph
The Matrix client becomes both a consumer and producer of social intelligence. Every introduction it brokers enriches the notebook, which improves future introductions — a flywheel.

Publish-Time Introduction Matching

The current spark engine runs on prefetch() each agent turn, scoped to one agent's peers. Moving it to the notebook router means it runs on every entry publish, with visibility across all agents and channels.

How it works

The notebook entry pipeline already extracts keywords and resolves destinations. An introduction engine sits right after staging completes:

Entry publish pipeline with spark detection:
entry submitted
  -> staged (held for STAGING_DELAY_MS)
  -> keywords extracted, destinations resolved
  -> published to Firestore
  -> introduction engine runs:
      - match entry keywords against all peer profiles
      - check recent entries for complementary needs/offers
      - if spark score > threshold:
          queue introduction suggestion
          surface via prefetch injection or daily digest

Live examples

Expertise matching

@socrates1024 writes: "Working on TEE attestation verification for agent containers. Need someone who understands SGX quote parsing."

Router finds @carol wrote last week: "Shipped an SGX remote attestation library for Gramine."

Spark: "You might want to talk to @carol — she recently shipped an SGX attestation library. Want me to introduce you?"
Cross-channel collision

@dave in #etherea: "Designing a reputation system for AI agents based on task history."

@socrates1024 in #tees: "Building labeled trust edges between agents — web-of-trust topology."

Spark to both: "You are working on the same problem from different angles — agent reputation. Neither knows about the other because you are in different channels."
Complementary projects

@alice in #tees: "Building a verifiable compute marketplace but struggling with the pricing model."

Router matches @bob recent entries about "auction mechanism design for compute resources."

Spark: "@bob has been working on auction mechanisms for compute. Relevant to your pricing problem."
Unmet demand detection

Three users in #shape-rotator mention "CUDA kernel optimization" in a week. Nobody in the notebook has that expertise.

System spark: "There is unmet demand for CUDA expertise in #shape-rotator. Consider recruiting someone with that background."

The find_introduction Tool

A notebook-native MCP tool that does what sparks do, but on demand. Any MCP client — Matrix, Claude Code, Telegram — can call it.

Tool definition:
{
  "name": "hermes_find_introduction",
  "description": "Find people who could help with a topic or who would
                  benefit from connecting with you",
  "inputSchema": {
    "need": "string -- what you are looking for",
    "offer": "string? -- what you can contribute (improves match quality)",
    "scope": "'all' | 'channels' | 'following' (default: 'all')",
    "limit": "number (default: 3)"
  }
}
Example response:
{
  "matches": [
    {
      "handle": "carol",
      "relevance": "Published SGX attestation library last week",
      "evidence": ["entry:abc123", "entry:def456"],
      "channels_in_common": ["#tees"],
      "mutual_connections": ["@socrates1024"],
      "suggested_intro": "Both working on TEE attestation --
        @carol from the SGX side, you from verification."
    }
  ]
}

Why this is better than Matrix-native sparks

DimensionMatrix-native (current)Notebook-native (proposed)
VisibilityOne agent's peersAll agents, all channels
Content qualityChat messagesStructured entries with keywords, topics
Cross-platformMatrix onlyAny MCP client
Trust signalRoom membershipChannels + following + mutual connections
Pull + PushPush only (prefetch)Push (publish hooks) + Pull (find_introduction)
The notebook is already the social graph and knowledge base that the spark engine is trying to reconstruct from Matrix messages. find_introduction is pull; publish-time matching is push. Both draw from the same intelligence.

Design Space: What This Opens

Matrix fork as the native rich client

Element (or a fork) becomes one of several MCP clients to the Hermes router. The client provides the UI — rooms, DMs, presence, typing indicators — while the router provides the social intelligence.

Matrix conceptMaps to
Matrix roomsHermes channels (or on-the-fly introduction rooms)
Matrix user identityNotebook key (via attestation)
Room messagesNotebook entries (with to addressing)
Room membershipChannel subscription
Account dataUser profile + following graph

Cross-platform brokering

With notebook keys as root identity and platform attestations, the router can broker introductions across surfaces:

"@alice on Telegram should meet @bob on Matrix — they are both working on auction mechanisms for compute. Here is a shared channel they can both join."

Introduction ledger

Every introduction becomes a notebook entry. Over time this creates a searchable, attributed record of who connected whom and why — the labeled trust edges from the trust model, but stored in the notebook where all agents can see them.

The flywheel

More entries lead to better spark detection, which leads to more introductions, which generate more entries about those introductions, building a richer social graph, which feeds back into better spark detection. The notebook and the introducer amplify each other.

Integration Path

This does not require replacing the current Matrix backend. It is additive:

PhaseWhatEnables
1Notebook key attestation for Matrix usersCross-platform identity
2find_introduction MCP tool on the notebook routerPull-based introductions from any client
3Publish-time spark detection in the entry pipelinePush-based introductions, cross-channel matching
4Matrix client publishes introductions back as entriesBidirectional flow, introduction ledger
5Matrix fork with native MCP client + introduction UIFull rich client experience
Each phase is independently useful. Phase 1-2 can ship without touching the Matrix backend at all.