Matrix โ Decentralized Chat Network
Matrix โ Decentralized Chat Network โ easy-to-understand guide based on official docs
Think of Matrix like email, but for instant messaging. Just as you can send an email from Gmail to Outlook, Matrix lets you chat across different servers โ no walled gardens, no single company owning your conversations.
What Makes Matrix Different?
Most chat apps (WhatsApp, Slack, Discord) run on centralized servers. If that company goes down or changes its policies, youโre stuck. Matrix flips this: anyone can run a homeserver โ your own private chat hub. You can join a giant public server like matrix.org or host one on a Raspberry Pi. Either way, you own your data and your identity.
Hermes Agent plugs directly into this network. It connects like any other user, using the open-source mautrix Python SDK. Once connected, it reads messages, thinks, uses tools, remembers context, and replies in real time โ just like a human teammate.
How Hermes Behaves in Matrix
Hereโs the practical part. Hermes has smart defaults that make it feel natural in any room.
Direct Messages (DMs)
In a private chat, Hermes replies to every message. No need to tag it. Each DM gets its own isolated session, so you can have multiple conversations without them bleeding into each other.
Want the bot to start a thread when you @mention it in a DM? Set:
MATRIX_DM_MENTION_THREADS=true
Rooms (Group Chats)
By default, Hermes waits for an @mention before responding in a room. This prevents spam. But you can change that:
MATRIX_REQUIRE_MENTION=false
Or allow free responses only in specific rooms:
MATRIX_FREE_RESPONSE_ROOMS="!room1:server.com,!room2:server.com"
The bot also auto-accepts room invites โ just invite it, and it joins instantly.
Threads and Auto-Threading
Matrix supports threaded replies (a feature called MSC3440). Hermes uses this intelligently:
- If you reply inside a thread, Hermes keeps that context isolated.
- In a room, Hermes auto-creates a thread for every message it responds to. This keeps multiple conversations tidy.
Disable that with:
MATRIX_AUTO_THREAD=false
For DMs, auto-threading is off by default. Turn it on with:
MATRIX_DM_AUTO_THREAD=true
Note: this is different from MATRIX_DM_MENTION_THREADS, which only triggers a thread when the bot is mentioned.
Commands and Controls
Hermes understands normal /commands like /model or /approve. If your Matrix client hijacks the / key, use !commands instead โ Hermes automatically converts known aliases.
For dangerous actions, you can approve via reactions (emoji clicks). You can even restrict approvals to the original requester.
Thinking and Tool Activity
When Hermes is โthinkingโ or using a tool, it doesnโt flood the main timeline. Instead, it posts updates in a threaded, editable pane โ clean and unobtrusive.
Multi-User Rooms
In a shared room, Hermes keeps separate session history per user. Two people talking in the same room donโt accidentally share one transcript. This is the default, and itโs a great privacy feature.
Summary and Practical Tip
Matrix gives you freedom, and Hermes Agent turns that freedom into a powerful, private AI assistant. It works with any homeserver โ Synapse, Conduit, Dendrite, or matrix.org โ and supports text, images, audio, video, and even end-to-end encryption.
Practical tip: Start with a free public server like matrix.org to test the bot. Then, when youโre comfortable, spin up your own Synapse homeserver using Docker. Youโll get full control, zero data leakage, and a chat AI that answers only to you.
๐ Official Docs
This article is based on the official Hermes Agent documentation:Official docs โบ user-guide/messaging/matrix