Matrix Agents
Multi-agent coordination via self-hosted Matrix. Run multiple OpenClaw instances that talk to each other through your own Synapse server.
Best use case
Matrix Agents is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Multi-agent coordination via self-hosted Matrix. Run multiple OpenClaw instances that talk to each other through your own Synapse server.
Teams using Matrix Agents should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
How Matrix Agents Compares
| Feature / Agent | Matrix Agents | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Multi-agent coordination via self-hosted Matrix. Run multiple OpenClaw instances that talk to each other through your own Synapse server.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Matrix Agents
Multi-agent coordination via self-hosted Matrix. Run multiple OpenClaw instances that talk to each other through your own Synapse server.
## What This Does
- Spins up a local Matrix/Synapse server in Docker
- Creates bot users for each OpenClaw instance
- Provides a bridge script that forwards Matrix messages to OpenClaw wake events
- Enables real-time bot-to-bot communication with zero cloud dependencies
## Requirements
- Docker Desktop
- Python 3.8+
- Two or more machines running OpenClaw (or multiple instances on one machine)
## Quick Start
```bash
# 1. Clone and run setup
git clone https://github.com/zscole/matrix-agents
cd matrix-agents
./setup.sh
# 2. Note the credentials printed at the end
# 3. On each OpenClaw instance, run the bridge
python3 bridge.py --user @claw:home.local --password <password> --openclaw-url http://localhost:18789 --openclaw-token <your-token>
```
## Setup Details
### 1. Synapse Server
The setup script creates a Docker container running Synapse with:
- Server name: `home.local`
- Port: 8008
- Registration enabled (for initial bot creation)
- SQLite database (simple, no external deps)
### 2. Bot Users
Create a user for each OpenClaw instance:
```bash
./create-user.sh mybot MyPassword123
```
This registers `@mybot:home.local` on your server.
### 3. Coordination Room
Create a room and invite all bots:
```bash
./create-room.sh bot-coordination
./invite-user.sh bot-coordination @bot1:home.local
./invite-user.sh bot-coordination @bot2:home.local
```
### 4. Bridge Script
The bridge polls Matrix for new messages and forwards them to OpenClaw as wake events:
```bash
python3 bridge.py \
--user @claw:home.local \
--password ClawBot2026 \
--room '!roomid:home.local' \
--openclaw-url http://localhost:18789 \
--openclaw-token YOUR_GATEWAY_TOKEN
```
Run this as a background service on each machine.
## Architecture
```
┌─────────────────┐ ┌─────────────────┐
│ OpenClaw #1 │ │ OpenClaw #2 │
│ (Mac mini) │ │ (MacBook Pro) │
└────────┬────────┘ └────────┬────────┘
│ │
│ bridge.py │ bridge.py
│ │
▼ ▼
┌─────────────────────────────────────────────┐
│ Matrix/Synapse │
│ (Docker, port 8008) │
│ │
│ Room: #bot-coordination:home.local │
│ Users: @claw, @spunk, @zak │
└─────────────────────────────────────────────┘
```
## Responding to Matrix
From your OpenClaw agent, send messages back to Matrix:
```bash
curl -X PUT "http://localhost:8008/_matrix/client/v3/rooms/ROOM_ID/send/m.room.message/txn$(date +%s)" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"msgtype":"m.text","body":"Hello from OpenClaw"}'
```
Or use the included `matrix-send.sh` helper:
```bash
./matrix-send.sh "Hello from OpenClaw"
```
## Running as a Service
### macOS (launchd)
```bash
./install-launchd.sh
```
Creates a LaunchAgent that starts the bridge on login.
### Linux (systemd)
```bash
./install-systemd.sh
```
Creates a user service for the bridge.
## Troubleshooting
**Token expired**: Re-login with `./login.sh @user:home.local password` to get a fresh token.
**Can't join room**: Make sure the room is public or the user has been invited.
**Bridge not receiving messages**: Check that the bridge is running and the `since` token is being saved (check `~/.matrix-bridge-since`).
**Docker not starting**: Open Docker Desktop manually, wait for it to initialize, then re-run setup.
## Security Notes
- This runs on your local network only by default
- Synapse is bound to `0.0.0.0:8008` - restrict with firewall if needed
- Bot passwords are stored in plaintext - use a secrets manager in production
- The registration shared secret should be rotated after initial setup
## Files
- `setup.sh` - One-shot Synapse setup
- `bridge.py` - Matrix-to-OpenClaw bridge
- `create-user.sh` - Register new bot users
- `create-room.sh` - Create coordination rooms
- `matrix-send.sh` - Send messages from CLI
- `install-launchd.sh` - macOS service installer
- `install-systemd.sh` - Linux service installerRelated Skills
m365-agents-ts
Microsoft 365 Agents SDK for TypeScript/Node.js.
m365-agents-py
Microsoft 365 Agents SDK for Python. Build multichannel agents for Teams/M365/Copilot Studio with aiohttp hosting, AgentApplication routing, streaming responses, and MSAL-based auth.
m365-agents-dotnet
Microsoft 365 Agents SDK for .NET. Build multichannel agents for Teams/M365/Copilot Studio with ASP.NET Core hosting, AgentApplication routing, and MSAL-based auth.
hosted-agents
Build background agents in sandboxed environments. Use for hosted coding agents, sandboxed VMs, Modal sandboxes, and remote coding environments.
hosted-agents-v2-py
Build hosted agents using Azure AI Projects SDK with ImageBasedHostedAgentDefinition. Use when creating container-based agents in Azure AI Foundry.
dispatching-parallel-agents
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
computer-use-agents
Build AI agents that interact with computers like humans do - viewing screens, moving cursors, clicking buttons, and typing text. Covers Anthropic's Computer Use, OpenAI's Operator/CUA, and open-source alternatives.
HIPAA Compliance for AI Agents
Generate HIPAA compliance checklists, risk assessments, and audit frameworks for healthcare organizations deploying AI agents.
AgentWallet — Non-Custodial Smart Wallets for AI Agents
Non-custodial smart wallets with onchain spending limits and passkey-based human control. Supports **Base** (EVM) and **Solana**. Every wallet gets free gas on creation so your agent can transact immediately.
agents-infra
Infrastructure for AI Agents. Phone, email, Social accounts, compute, domains, and voice calling for AI agents. Pay with USDC on Solana or Base via x402.
voice-agents
Voice agents represent the frontier of AI interaction - humans speaking naturally with AI systems.
robius-matrix-integration
CRITICAL: Use for Matrix SDK integration with Makepad. Triggers on: Matrix SDK, sliding sync, MatrixRequest, timeline, matrix-sdk, matrix client, robrix, matrix room, Matrix 集成, 聊天客户端