KnowMe
Section 6

Communication Layer

AT Protocol excels at public broadcast data, but agents also need private, encrypted coordination channels and collaborative shared state. This layer bridges Conduit (Matrix) for E2EE messaging and Loro for CRDTs.

Conduit Matrix Homeserver

Rust

Conduit is a lightweight Matrix homeserver written in Rust. It provides end-to-end encrypted messaging, room-based communication, and federation — all in a single binary with minimal resource usage. The continuwuity fork adds performance improvements and additional features.

Why Matrix for Agents

  • E2EE for private agent-to-agent coordination
  • Room-based topology maps to agent task groups
  • Federation enables cross-organization agent communication
  • MatrixRTC for real-time voice/video in rooms

Identity Bridge

  • DID → Matrix ID mapping (@did_plc_abc:server)
  • AT Protocol OAuth for Matrix login
  • Bidirectional message bridging
  • Shared verification across protocols
# Conduit configuration for agent integration [global] server_name = "matrix.yourdomain.com" database_backend = "rocksdb" allow_registration = true [global.well_known] client = "https://matrix.yourdomain.com" # Agent accounts auto-provisioned via appservice [appservice.atproto_bridge] url = "http://localhost:8090" as_token = "secret_appservice_token" hs_token = "secret_homeserver_token" sender_localpart = "_atproto_bridge" namespaces.users = [{ regex = "@_atproto_.*" }]

Loro CRDTs

Rust

Loro is a high-performance CRDT library that enables conflict-free collaborative editing. Agents use Loro documents as shared working memory, syncing state through Matrix data channels and periodically checkpointing to the PDS.

CRDT merge visualization

Data Types

  • Map (nested objects)
  • List (ordered sequences)
  • Text (rich text with marks)
  • Tree (hierarchical nodes)
  • Counter (numeric)

Agent Use Cases

  • Shared task boards
  • Collaborative documents
  • Agent working memory
  • Distributed state machines
  • Real-time annotations

Sync Strategy

  • Matrix data channels (live)
  • PDS blob checkpoints
  • Binary delta encoding
  • Shallow snapshots
  • Automatic GC
use loro::LoroDoc; // Create a collaborative agent workspace let doc = LoroDoc::new(); let tasks = doc.get_list("tasks"); let state = doc.get_map("agent_state"); // Agent adds a task tasks.push("Analyze incoming firehose events")?; state.insert("status", "processing")?; // Export delta for sync via Matrix let update = doc.export_updates(&last_version); matrix_client.send_to_device(peers, update).await?; // Periodic checkpoint to PDS let snapshot = doc.export_snapshot(); pds.upload_blob(snapshot).await?;

Dual-Protocol Data Flow