Hivemind Websocket Client
Project description
HiveMind Bus Client
Python client library for hivemind-core — the primary library for building HiveMind satellites.
Extends the standard OVOS bus client with secure, encrypted, routed communication across a HiveMind mesh network. See the whitepaper for protocol details.
Install
uv pip install hivemind_bus_client
Quick Start
from hivemind_bus_client import HiveMessageBusClient
from hivemind_bus_client.message import HiveMessage, HiveMessageType
from ovos_bus_client.message import Message
client = HiveMessageBusClient(host="ws://localhost", port=5678)
client.connect()
client.on_mycroft("speak", lambda msg: print(msg.data["utterance"]))
client.emit(HiveMessage(HiveMessageType.BUS,
Message("recognizer_loop:utterance",
{"utterances": ["hello world"]})))
Message Types
| Type | Direction | Description |
|---|---|---|
BUS |
satellite ↔ master | Standard AI bus message |
ESCALATE |
upstream | Forward up the authority chain |
QUERY |
upstream + response | First answering node wins |
BROADCAST |
downstream | Admin pushes to all satellites |
PROPAGATE |
flood | Forward to all peers in all directions |
CASCADE |
flood + responses | Collect answers from all nodes |
INTERCOM |
any → any | End-to-end hybrid-encrypted (AES-GCM + RSA) |
PING |
inside PROPAGATE | Flood-based network topology discovery |
Security
- Per-link encryption: AES-GCM or ChaCha20-Poly1305, negotiated at handshake
- Hybrid INTERCOM encryption: Random AES-256 key per message, RSA-encrypted key exchange
- Trusted peers:
NodeIdentity.trusted_keysgates BUS injection for PROPAGATE and INTERCOM from untrusted peers - Topology-as-policy: Network structure determines access control (see whitepaper §4)
Trusted Keys
from hivemind_bus_client.identity import NodeIdentity
identity = NodeIdentity()
identity.add_trusted_key("living-room-hub", "<RSA_PUBLIC_KEY>")
identity.save()
Untrusted PROPAGATE(BUS) and INTERCOM messages are silently dropped.
CASCADE Response Aggregation
CASCADE collects responses from all reachable nodes via CascadeAggregator:
proto.cascade_select_callback = lambda responses: responses[0] # pick best
proto.hive_mapper = mapper # enables early resolution when all nodes answered
CLI
hivemind-client set-identity --key KEY --password PASS --siteid SITE
hivemind-client terminal --host ws://hub.local --port 5678
hivemind-client ping --host ws://hub.local --port 5678
hivemind-client send-mycroft --msg "recognizer_loop:utterance" --payload '{"utterances": ["hello"]}'
hivemind-client escalate --msg "recognizer_loop:utterance" --payload '{"utterances": ["hello"]}'
hivemind-client propagate --msg "recognizer_loop:utterance" --payload '{"utterances": ["hello"]}'
Documentation
Full docs in /docs:
- API Reference —
HiveMessage,HiveMessageBusClient,NodeIdentity,HiveMapper - Message Types — Routing modes, QUERY, CASCADE, PING
- Identity & Trust — Credentials, RSA keys, trusted peers
- Examples — Chat, TTS, INTERCOM, QUERY, CASCADE, trust management
- CLI Guide — Terminal, ping, send commands
- Serialization — Binary wire format
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hivemind_bus_client-0.7.0a2.tar.gz.
File metadata
- Download URL: hivemind_bus_client-0.7.0a2.tar.gz
- Upload date:
- Size: 384.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5acc341138d8b6236326d25594372e777e7cb67057e54d223db880bc394ce5b3
|
|
| MD5 |
7d29c95fdbedee062c17bbf84e62cceb
|
|
| BLAKE2b-256 |
472c3526c9000bc3fc238c7992963c436d053cc013af4946be43c6bfa8ca30f6
|
File details
Details for the file hivemind_bus_client-0.7.0a2-py3-none-any.whl.
File metadata
- Download URL: hivemind_bus_client-0.7.0a2-py3-none-any.whl
- Upload date:
- Size: 48.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
808e2db4f8d3b7adb20fd41027dc68021e4293ec9f77238e485f65b55f731957
|
|
| MD5 |
335d946e349b4e5ee59f869651f9e148
|
|
| BLAKE2b-256 |
ee20c5d6295fb7889d8bd68b2626b2e1557170a05c2bd63473288f6046e72f41
|