Skip to main content

Hebbrix Python SDK

PyPI version Python versions License

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,
    )

    # 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

📄 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.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

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

hebbrix-2.3.0-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file hebbrix-2.3.0.tar.gz.

File metadata

  • Download URL: hebbrix-2.3.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for hebbrix-2.3.0.tar.gz
Algorithm Hash digest
SHA256 d765044d1412e5e10f4cf60b4a867d3076ad7df6da59c2c1ce92e1604018539a
MD5 a43dd8626d1628d84d3129a8cd5e2bbc
BLAKE2b-256 42cb19a72f0f7094642e2c50036302337e319ebe19b4b1a66dc970448a899fb2

See more details on using hashes here.

File details

Details for the file hebbrix-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: hebbrix-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for hebbrix-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c42fa1411630796ff1b289bc95568b612f7e408ab70fe01b4436242fcc5ceaa
MD5 07e8b6ff7fea9ccee8ffccba8536095d
BLAKE2b-256 0e11a62b4f6837833305f9f1fe68970b06a3c3df4a3549fb6f1204425caa7bba

See more details on using hashes here.

Release history Release notifications | RSS feed

2.4.1

2 files

2.4.0

2 files

2.3.2

2 files

2.3.1

2 files

This release

2.3.0 This release

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page