Skip to main content

Hivemind Websocket Client

Project description

Ask DeepWiki

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_keys gates 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:

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

hivemind_bus_client-0.9.0a3.tar.gz (407.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hivemind_bus_client-0.9.0a3-py3-none-any.whl (58.6 kB view details)

Uploaded Python 3

File details

Details for the file hivemind_bus_client-0.9.0a3.tar.gz.

File metadata

  • Download URL: hivemind_bus_client-0.9.0a3.tar.gz
  • Upload date:
  • Size: 407.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hivemind_bus_client-0.9.0a3.tar.gz
Algorithm Hash digest
SHA256 9929207ec46a6123169e3a4a4c7699492515ef2558a4e908bb21ce72d9cb01ee
MD5 9b509c7d4f4d6614c04ee9f1f0131600
BLAKE2b-256 f87f652a0a0485b682ec637f5be0ed64b19c9939f23876176e1cd45ca849593f

See more details on using hashes here.

File details

Details for the file hivemind_bus_client-0.9.0a3-py3-none-any.whl.

File metadata

File hashes

Hashes for hivemind_bus_client-0.9.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 3a7b9ead13b295713412e639ef65fb9ad46bddf22c85d82e999579e204383d49
MD5 5f0e6673b46b3cad72a2c33f6da16fa2
BLAKE2b-256 9dd166424112021b33c46e09a497e051325dc9d53921a6785197c29fd4f66cd5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page