Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Hebbrix Python SDK

Typed Python client for Hebbrix memory, retrieval, and outcome-learning APIs.

This branch is the 2.6.0rc2 prerelease. The new policy configuration and advice helpers require backend schema e5f6g7h8i868 or a compatible successor. A prerelease SDK does not enable autonomous execution. ASK/REVIEW/ACT is advice; an action still requires independent permission.

Install

pip install hebbrix==2.6.0rc2

Python 3.8+ is supported. MemoryClient is asynchronous. SyncMemoryClient supports the core collection, memory, search, correction, procedure, and ProofLoop workflows; advanced temporal, working-memory, consolidation, memory-tool, and RL resources are currently async-only.

Quick start

Both clients expose proofloop.register_context_schema, context_schema, configure_policy, policy_configuration, policy_advice and action_advice. Enroll context before recording decisions. Configuration uses expected_revision for compare-and-swap; do not retry a conflict blindly. Exploration remains an explicit low-risk opt-in. action_advice takes the exact configured description, policy/action IDs and context, and maps user_id to the confidence endpoint's end_user_id. For the complete request shapes, see the learning guide.

import asyncio
from hebbrix import MemoryClient

async def main():
    async with MemoryClient(api_key="hbx_your_api_key") as client:
        collection = await client.collections.create(name="Support memory")
        memory = await client.memories.create(
            collection_id=collection["id"],
            content="Customer prefers concise replies",
            wait_for_index=True,
            idempotency_key="customer-42-preference-v1",
        )
        results = await client.search(
            "How should replies be formatted?",
            collection_id=collection["id"],
        )
        print(memory, results)

asyncio.run(main())

Durable readiness

Memory writes return either a searchable completion or a durable 202 receipt. A durable receipt means the database commit succeeded while indexing is still converging; it is not a failure and does not justify a duplicate write.

When wait_for_index=True, the SDK accepts that receipt and polls the documented status URL. It returns only after searchable=true. If the caller's deadline expires, it raises IndexingTimeoutError; the exception retains the original receipt plus normalized memory_ids, job_id, status_url, request_id, outbox_event_id, retry timing, and idempotency replay metadata when available. The synchronous and asynchronous single, batch, inference-job, and update readiness paths share this behavior. The SDK never repeats the write while it polls.

Catch the typed deadline without discarding the durable acceptance:

from hebbrix import IndexingTimeoutError

try:
    created = await client.memories.create(
        content="Customer prefers concise replies",
        wait_for_index=True,
        idempotency_key="customer-42-preference-v1",
        index_timeout=5,
    )
except IndexingTimeoutError as exc:
    # Resume observation; do not submit an unrelated second write.
    if exc.memory_ids:
        created = await client.memories.wait_until_searchable(exc.memory_ids[0])
    elif exc.job_id:
        created = await client.memory_jobs.wait(exc.job_id)

For a timed-out batch, pass exc.receipt to memories.wait_batch_until_searchable(...). Alternatively, replay the exact same body with exc.idempotency_key; a changed body with the same key is rejected by the API rather than creating a second logical write. For an update, resume polling exc.memory_ids[0] because the relational edit already committed.

For an asynchronous batch receipt:

receipt = await client.memories.create_batch(
    [{"content": "First fact"}, {"content": "Second fact"}],
    collection_id="collection-42",
    wait_for_index=False,
    idempotency_key="import-42",
)
completed = await client.memories.wait_batch_until_searchable(receipt)

Pagination

collections.list() returns the current page's collection items for backward compatibility. Use collections.list_page() when cursor metadata is required. Memory resources provide the same list()/list_page() distinction.

Advanced capabilities and entitlements

The async client exposes the canonical /v1 temporal, working-memory, consolidation, memory-tool, and RL contracts. RL metrics and evaluation require the Pro plan. Process-wide RL training and checkpoint mutation require an admin role. Entitlement failures raise EntitlementError and preserve the stable error code, current/required plan, request ID, and support action.

The experimental World Model is intentionally not exported by this public SDK. It remains withdrawn until a trained, versioned production model artifact and an end-to-end public serving contract are available.

The authoritative account capability matrix is available from GET /v1/users/me/capabilities.

Release compatibility

The production API publishes exact build and artifact compatibility at GET /v1/release. The public OpenAPI is /openapi.json.

License

MIT. See LICENSE in the distribution.

Native experience workflow (prerelease)

The current source includes client.experiences, bounded reflection workers, separate lesson review/revision and explicit one-use execution admission. These methods require the matching new backend; the published 2.5.0 release does not include this extension. The candidate package supplies hebbrix-reflect --help. Importing it does not call a model, approve a lesson or execute a tool.

See docs/native-experience-operations.md for role scopes, uncertain-call recovery, exact-request binding and policy rollback. Do not treat a lesson, score, review or issued permit as execution permission.

Metadata

Release files for hebbrix 2.6.0rc2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hebbrix 2.6.0rc2
File Size Uploaded
hebbrix-2.6.0rc2.tar.gz 71.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hebbrix 2.6.0rc2
File Interpreter ABI Platform
hebbrix-2.6.0rc2-py3-none-any.whl Python 3 none any Details

Total release size: 118.7 kB

Release files / hebbrix-2.6.0rc2.tar.gz

Download URL hebbrix-2.6.0rc2.tar.gz
Size 71.1 kB
Tags Source
SHA-256 checksum
How to use checksums
464396cfe679cf26920d5f424d2640be95699a176ab8fce07186c992ebf5cb7c
BLAKE2b-256 checksum
How to use checksums
76baffdae5789de64684b1deebc249b2e180db5ffa18ee129d723335d9a9e693
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / hebbrix-2.6.0rc2-py3-none-any.whl

Download URL hebbrix-2.6.0rc2-py3-none-any.whl
Size 47.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9b2b9d3061081f5ceb52f55e9521d9cf73484603dceb4b2bab1d0d2dd5e20f3
BLAKE2b-256 checksum
How to use checksums
27be9a0dc3cf225ed89fb00fbab63662fa7fd1254bd2038178a60995afb95f54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

2.6.3

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.6.0

2 release files

This release

2.6.0rc2 This release

2 release files

2.5.0

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release 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