This release is a pre-release and may not be stable for production use.
HiveMind Matrix Bridge
Relay a Matrix chatroom to a HiveMind hub.
The bridge is a HiveMind satellite. Its input and output are a Matrix room instead of a microphone. Messages that mention the bot go to the hub as utterances. The hub's spoken reply posts back into the room. This turns any HiveMind hub, and the OVOS skills behind it, into a Matrix chatbot.
Matrix room ⇄ HiveMind-matrix-bridge ⇄ HiveMind hub (hivemind-core) ⇄ OVOS skills
Prerequisites
- A running HiveMind hub (hivemind-core) you can reach over the network.
- A HiveMind access key and password for this bridge, issued by the hub with
hivemind-core add-client(see Quickstart). - A Matrix account for the bot and an access token for it. Any homeserver works (
matrix.orgor self-hosted). Create the account, log in once, and copy its access token (in Element: Settings → Help & About → Access Token). - The room alias the bot should join, for example
#hivemind-bots:matrix.org. Invite the bot account to that room.
Install
pip install git+https://github.com/JarbasHiveMind/HiveMind-matrix-bridge
Or from a checkout:
git clone https://github.com/JarbasHiveMind/HiveMind-matrix-bridge
cd HiveMind-matrix-bridge
pip install .
This installs the HiveMind-matrix console command.
Quickstart
1. Register the bridge on the hub (run where hivemind-core is installed):
hivemind-core add-client --name matrix-bridge \
--access-key "your-access-key" --password "your-password"
Note the access key and password. The bridge needs them to authenticate.
A new client is registered but mute: the hub denies every message type until you whitelist it. Run this too, or the bridge will connect and never do anything:
hivemind-core allow-msg recognizer_loop:utterance matrix-bridge
hivemind-core allow-msg speak matrix-bridge
If you are running more than one bridge on the same host (Matrix, Mattermost, DeltaChat, HackChat side by side), give each one its own hivemind-client set-identity credentials and, if applicable, its own config directory. Bridges that share an identity share a Noise session pin, and the hub will treat reconnects from either one as the same client, which breaks encryption for both.
2. Store the HiveMind credentials so they are read automatically:
hivemind-client set-identity \
--key "your-access-key" \
--password "your-password" \
--host "ws://192.168.1.100"
set-identity ships with hivemind-bus-client, a dependency of this bridge. You can instead pass --key/--password/--host on every run, without storing an identity.
3. Run the bridge:
HiveMind-matrix run \
--botname thehivebot \
--matrixtoken "syt_your_access_token" \
--matrixhost "https://matrix.org" \
--room "#hivemind-bots:matrix.org"
4. Send a message. In the joined room, mention the bot:
thehivebot what time is it?
The bridge strips the mention, forwards what time is it? to the hub, waits for the hub's speak reply, and posts it back to the room.
Configuration
HiveMind-matrix run options:
| Option | Description | Default |
|---|---|---|
--botname |
Mention prefix that triggers the bot. If omitted, the bridge answers every message in the room. | none |
--matrixtoken |
Matrix access token for the bot account | none |
--matrixhost |
Matrix homeserver URL | https://matrix.org |
--room |
Room alias to join | #hivemind-bots:matrix.org |
--key |
HiveMind access key | read from identity file |
--password |
HiveMind password | read from identity file |
--host |
HiveMind host (a ws:// prefix is added if no scheme) |
read from identity file |
--port |
HiveMind port | 5678 |
When --key/--password/--host are omitted, the bridge reads them from the stored NodeIdentity. If none of the three are available, the bridge exits with an error that points you at hivemind-client set-identity.
Troubleshooting
NodeIdentity not set: runhivemind-client set-identity, or pass--key/--password/--hostexplicitly.- Bot ignores messages: with
--botnameset, the message must contain it exactly, and messages without the mention are dropped by design. Without--botname, the bridge answers every message in the room instead. - Reply is the literal text
Error: the hub did not return aspeakwithin the response timeout (30s). Confirm the hub is reachable, the access key is authorized, and an OVOS pipeline produces spoken answers. - Connection refused or no reply: verify
--hostand--portpoint at the running hub, and that the bridge's access key is registered (hivemind-core list-clients). - Bridge connects but the room never gets a reply: the client is registered but not whitelisted. Run
hivemind-core allow-msg recognizer_loop:utterance matrix-bridgeandhivemind-core allow-msg speak matrix-bridgeon the hub. invalid api keyat connect time: the hub rejected the handshake, usually because the bridge (orhivemind-bus-client) is older than the hub. Upgrade the bridge.- "reconnect worker already running" in the bridge log: a known issue in older
hivemind-bus-clientreleases when a connection drops and retries overlap. It is fixed upstream; upgradehivemind-bus-clientand the bridge. - Handshake fails after the hub was reinstalled or the client's key changed: the bridge is holding a stale Noise session pin from a previous run. Clear it on the hub with
hivemind-core reset-noise-pin matrix-bridgeand restart the bridge.
Documentation
- Setup walkthrough: a full path from an empty machine to a running bridge.
- Operator setup: get the bot's Matrix account and access token (or self-host a homeserver), register the bridge on a HiveMind hub, run it, and check the live end-to-end test.
- Configuration reference: every option, credential, and default.
- Examples: sample runs and embedding the bridge in your own program.
Related projects
- HiveMind-core: the HiveMind hub this bridge connects to.
- hivemind-bus-client: the client library that provides
set-identityand the HiveMind connection.
License
See LICENSE.
Metadata
Release files for HiveMind-matrix-bridge 0.2.2a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hivemind_matrix_bridge-0.2.2a1.tar.gz | 14.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hivemind_matrix_bridge-0.2.2a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.6 kB
Release files / hivemind_matrix_bridge-0.2.2a1.tar.gz
| Download URL | hivemind_matrix_bridge-0.2.2a1.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
886fda1b8129e80b0b4ebfddb9dc7584a0bc6c63a4ce595eb0060b0b0180eff3
|
|
BLAKE2b-256 checksum How to use checksums |
606707daf3e8c3e25a3358db46bd90562f420ae80914b239b56f15885e1d2a67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hivemind_matrix_bridge-0.2.2a1-py3-none-any.whl
| Download URL | hivemind_matrix_bridge-0.2.2a1-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f25aa42230c6619797977e9534436894453d89caabda535a7bd1f4514df8eb38
|
|
BLAKE2b-256 checksum How to use checksums |
9066794193df2db3973db1ad219b1229cae266107d84c0ec1f581bbac01da722
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|