This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
HiveMind Python SDK
Persistent memory and a working-context compiler for your agent, in three lines inside your own loop. Your model, your key — HiveMind never calls an LLM.
pip install hivemind-sdk
Python ≥ 3.10, zero dependencies. The import name is hivemind.
Docs: https://hivemind.militant.ai/docs
from hivemind import HiveMind
mind = HiveMind(base_url="...", api_key="...", tenant_id="...")
session = mind.session(budget_total=8192)
result = session.turn(user_input) # store -> recall -> compile
reply = call_your_llm(result.messages) # your model, your key
session.record(reply) # completes the exchange
What one turn() does
- Stores the user message (receipted).
- Semantically recalls relevant memories and past conversation.
- Compiles local history + recalled records + active holds + your operator briefing into a token-budgeted bundle.
result.messages is the entire prompt payload — send it as-is, splice
nothing in. result.bundle["decisions"] explains every admission under
the budget; result.receipt is the audit record. Empty recall on a young
tenant is normal, not an error.
session.record(reply) stores your model's reply as the other half of the
exchange, so the next turn — and every future session — remembers it.
Beyond the loop
mind.remember(content, metadata)— deliberately store a durable lesson, decision, fact, or outcome.mind.recall(query)/mind.recall_filtered(query, metadata)— explicit recall,[]when nothing matches.session.hold_set(key, content)/hold_clear(key)— pin operational state ("stop-order", "API is down") into every compile until cleared.mind.receipts(session_id=...)— the audit trail: what ran, what it consumed, what it produced, with lineage.mind.delete_by_metadata(metadata)— destructive, audited deletion.mind.client— the raw HTTP client for anything not wrapped.
Configuration
Constructor arguments override environment:
| Env var | Meaning |
|---|---|
HIVEMIND_BASE_URL |
Service root (hosted or local — same API) |
HIVEMIND_API_KEY |
Sent as Authorization: Bearer <key> |
HIVEMIND_TENANT_ID |
Your tenant (X-Tenant-ID) |
HIVEMIND_TIMEOUT |
Request timeout, seconds (default 30) |
HIVEMIND_BUDGET_TOTAL |
Default compile token budget (default 4096) |
Examples
examples/quickstart.py— the full loop with no LLM key needed.examples/chat_loop.py— a real chat with any OpenAI-compatible model.
Development note (this repo)
The import name hivemind collides with the service package at the repo
root, so run SDK tests as their own invocation:
python -m pytest sdk/python/tests
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_sdk-0.1.0.tar.gz.
File metadata
- Download URL: hivemind_sdk-0.1.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d782a0d64114c5bfee6f7400a0fbca207abd828e81286365de0fee128c94394e
|
|
| MD5 |
af7ff8f5b01fda33727ba7994b84f8b8
|
|
| BLAKE2b-256 |
f12da0ab5a6f54abeaf5b4ab76780b80062d9d307d1c06facfa55ac7636b63a0
|
File details
Details for the file hivemind_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hivemind_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6c2f7c83d6f1084b73bc339c300645ac1361359043c571fba6c19d8a34228f3
|
|
| MD5 |
2d410db9362a69e789e55b079c5b3178
|
|
| BLAKE2b-256 |
0270fc1c3f4fa520e718d2cd4ea832cd9417f90e152887f8b0a0b0920250e494
|