Skip to content
openclawOS

A federated AI agent on Matrix with openclawOS

Add Pi to your Matrix homeserver — end-to-end encrypted rooms, federated identity, sessions per room, all on your hardware.

Dipankar Sarkar 6 min read
  • matrix
  • federation
  • tutorial
  • e2ee

Matrix is the federated chat protocol the internet keeps wanting. If you self-host a homeserver (Synapse, Dendrite, Conduit), adding an AI agent that respects the federated, end-to-end encrypted model is the natural next step.

openclawOS pairs Matrix cleanly. Here’s the setup.

Setup

  1. Provision a Matrix account for the bot on your homeserver (e.g., @pi:matrix.example.com).
  2. Get an access token from your client (Element → settings → Advanced → Access Token).
  3. openclaw apps install matrix, paste the homeserver URL + access token.
  4. Invite @pi:your.server to a room.

E2EE handshake

On the bot’s first appearance in an E2EE room, you’ll be prompted to verify Pi’s device — same flow as verifying any new Element device. openclawOS uses matrix-rust-sdk and speaks Olm/Megolm; verified sessions persist.

Sessions

Each Matrix room is its own session by default. Identity linking can bridge sessions across rooms if you want a single Pi memory across your federated identity.

Federation

Pi appears as a federated user. A Matrix user on another homeserver can interact with @pi:your.server and Pi responds, end-to-end encrypted. This is the closest thing to a true peer-to-peer AI assistant — federated identity, federated state, locally-decrypted execution.

Why bother

For self-hosted Matrix admins, openclawOS finishes the stack. You’ve already chosen “my data stays in my domain”; adding an AI that respects the same posture is just the next checkbox.

Frequently asked

Yes. openclawOS uses matrix-rust-sdk which speaks Olm/Megolm. Verify Pi's device the same way you'd verify any other device in your Matrix client.

Run your own gateway.

Free, MIT, no signup. Pi is waiting.