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.
# 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
hebbrix-2.3.1.tar.gz
(29.4 kB
view details)
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
hebbrix-2.3.1-py3-none-any.whl
(25.5 kB
view details)
File details
Details for the file hebbrix-2.3.1.tar.gz.
File metadata
- Download URL: hebbrix-2.3.1.tar.gz
- Upload date:
- Size: 29.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a706f761bf418705ecfe5444ed112d7d9e5462b2d44e9ac022d3fa009d668df
|
|
| MD5 |
da632909b076b5ccde306ab4837b0635
|
|
| BLAKE2b-256 |
e9f4b9e691aa3e95873805e8b09b95f0349623fdd21cb751687c8c18f26157ab
|
File details
Details for the file hebbrix-2.3.1-py3-none-any.whl.
File metadata
- Download URL: hebbrix-2.3.1-py3-none-any.whl
- Upload date:
- Size: 25.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6340d0489ccaa7805a5fbd8e5199930e483eec422484bd7f9273f055d01299a8
|
|
| MD5 |
2233092de82c24763b19fbb46ac47a09
|
|
| BLAKE2b-256 |
5222b99ddf2608d20c77a13337619fa5459dc000fa417a0b93320a3ec85de3b1
|