Hebbrix Python SDK
Official Python SDK for the Hebbrix api - the only memory API with Reinforcement Learning.
🚀 Features
- ✅ Core API Coverage - Typed resources for memories, search, and ProofLoop
- ✅ Reinforcement Learning - Train AI agents to optimize memory operations
- ✅ Temporal Knowledge Graphs - Track facts over time with bi-temporal model
- ✅ Procedural Memory - Store and execute learned skills
- ✅ Working Memory - Short-term context buffer for conversations
- ✅ Memory Consolidation - Automatic compression of episodic memories
- ✅ ProofLoop - Learn from outcomes with automatic, verifiable evidence receipts
- ✅ Sync + Async - Equivalent core memory and ProofLoop workflows
- ✅ Type Hints - Complete type annotations
- ✅ Clean API - Pythonic, intuitive interface
📦 Installation
pip install hebbrix
🔥 Quick Start
import asyncio
from hebbrix import MemoryClient
async def main():
# Initialize client
client = MemoryClient(api_key="mem_sk_your_api_key")
# Create a collection
collection = await client.collections.create(
name="My AI Agent",
description="Personal memory for my chatbot"
)
# Store a memory
memory = await client.memories.create(
collection_id=collection["id"],
user_id="customer-7",
agent_id="support-agent",
content="User prefers dark mode and loves Python",
importance=0.9,
wait_for_index=True,
)
# wait_for_index=True polls the returned memory status through the SDK.
# It returns only when searchable=true, raises on terminal failure, and
# raises TimeoutError if the caller's readiness deadline expires.
# Batch contract: a successful synchronous return means every accepted item
# is searchable. A bounded server timeout raises explicitly and is safe to
# retry with the same idempotency key; it is never a successful 202.
batch = await client.memories.create_batch(
[{"content": "First fact"}, {"content": "Second fact"}],
collection_id=collection["id"],
wait_for_index=True,
idempotency_key="import-42",
)
# For wait_for_index=False receipts:
# batch = await client.memories.wait_batch_until_searchable(batch)
# Search memories
results = await client.search(
query="What programming language does user like?",
collection_id=collection["id"],
limit=5
)
print(results)
# Close client
await client.close()
asyncio.run(main())
Blocking applications can use the same create/search/ProofLoop fields:
from hebbrix import SyncMemoryClient
with SyncMemoryClient(api_key="mem_sk_your_api_key") as client:
collection = client.collections.create(name="My Agent")
client.memories.create(
collection_id=collection["id"],
user_id="customer-7",
content="User prefers concise answers",
wait_for_index=True,
)
results = client.search(
"How should answers be formatted?",
collection_id=collection["id"],
user_id="customer-7",
)
ProofLoop: search → decision → outcome → proof
search = await client.search_with_proof(
"What should the agent do next?",
collection_id="collection-42",
user_id="customer-7",
)
decision = await client.proofloop.decide(
policy_key="agent.next_action",
candidates=[{"action_key": "act"}, {"action_key": "ask"}],
collection_id="collection-42",
user_id="customer-7",
proof_context=search["proof_context"],
)
await client.proofloop.record_outcome(
decision["decision_id"], success=True, idempotency_key="run-123-result"
)
proof = await client.proofloop.proof(decision["decision_id"])
📚 Complete Documentation
Visit https://docs.hebbrix.com for full documentation.
🔗 Links
- Documentation: https://docs.hebbrix.com
- API Reference: https://api.hebbrix.com/docs
- GitHub: https://github.com/hebbrix/hebbrix
- Examples: https://github.com/hebbrix/examples
📄 License
MIT License - see LICENSE for details
Built with ❤️ by the Hebbrix team
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 hebbrix-2.3.2.tar.gz.
File metadata
- Download URL: hebbrix-2.3.2.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38ecac741d649e0cb8c8e9f34ff6b62bc00a153422921505a56db17a8a707fc5
|
|
| MD5 |
87337f818646edb8b83ce8e0cf6d5a45
|
|
| BLAKE2b-256 |
83d963a20b2abb1a9dc596b198c3a330e645cf0d4f8c79c349ddfd6b83336356
|
Provenance
The following attestation bundles were made for hebbrix-2.3.2.tar.gz:
Publisher:
release.yml on Hebbrix/hebbrix-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hebbrix-2.3.2.tar.gz -
Subject digest:
38ecac741d649e0cb8c8e9f34ff6b62bc00a153422921505a56db17a8a707fc5 - Sigstore transparency entry: 2616661368
- Sigstore integration time:
-
Permalink:
Hebbrix/hebbrix-python@2fe387812517653fd07d3c4a8436325d012632a1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Hebbrix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2fe387812517653fd07d3c4a8436325d012632a1 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file hebbrix-2.3.2-py3-none-any.whl.
File metadata
- Download URL: hebbrix-2.3.2-py3-none-any.whl
- Upload date:
- Size: 28.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc7e8d27065049970601784f47e6352915606507e38fa2d6bc927177ad2fc4a7
|
|
| MD5 |
0ef933217e96409d891615ebd4be751b
|
|
| BLAKE2b-256 |
2f73d0984ed764d9f27fc7802cf338fd2f2b5b21241e78002061a25528ea076a
|
Provenance
The following attestation bundles were made for hebbrix-2.3.2-py3-none-any.whl:
Publisher:
release.yml on Hebbrix/hebbrix-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hebbrix-2.3.2-py3-none-any.whl -
Subject digest:
fc7e8d27065049970601784f47e6352915606507e38fa2d6bc927177ad2fc4a7 - Sigstore transparency entry: 2616661944
- Sigstore integration time:
-
Permalink:
Hebbrix/hebbrix-python@2fe387812517653fd07d3c4a8436325d012632a1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Hebbrix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2fe387812517653fd07d3c4a8436325d012632a1 -
Trigger Event:
workflow_dispatch
-
Statement type: