Skip to main content

annpack

Python binding for the ANNPack reference runtime.

ANNPack compiles a documentation tree into a single immutable, content-addressed artifact and issues offline-verifiable evidence for every passage it returns. A third party can check that a cited passage existed unmodified in a named artifact at a named source revision — without the artifact, without network access, and without trusting the service that produced the citation.

Relationship to versions below 0.5

Releases in the 0.1.x line published a different system: an approximate nearest-neighbour index built on FAISS, searched in the browser through a WASM runtime. That architecture is not carried forward. The current line is a Rust implementation of the ANNPack v3 container format, exact BM25 retrieval with normative tokenization, and the EVIDENCE-v1 receipt chain. The format, the CLI surface, and the artifact bytes all differ. 0.1.x artifacts cannot be read by this runtime, and no migration path exists between them.

Requirements

The binding drives the annpack binary as a subprocess; it does not parse artifact bytes in Python. Untrusted input is handled entirely by the Rust runtime.

Install the binary from the project's releases, then either place it on PATH, set ANNPACK_BINARY, or pass binary= to the client.

Usage

from annpack import Client

client = Client()

report = client.build("docs/", "knowledge.annpack", name="vendor-docs", version="1.0.0")
print(report["root_hash"])

results = client.search("knowledge.annpack", "rotate the signing key", limit=5)
for hit in results["results"]:
    print(hit["score"], hit["citation"]["canonical_url"])

Retrieval evidence

A run bundle collects one agent run's retrieval evidence into a single portable file: a standalone receipt per retrieved passage, plus the metadata needed to locate the run in an application's own logs.

bundle = client.bundle(
    "knowledge.annpack",
    "rotate the signing key",
    "run.json",
    limit=5,
    application="support-agent/2.1",
    model="claude-opus-5",
)

report = client.verify_run("run.json")
assert report["attested"]
print(report["pack_roots"], report["source_revisions"])

attested means every receipt proved its passage existed unmodified in the named artifact. The query, application, model, and answer travel with the receipts and are attested by nothing — the report keeps the two separate.

OpenTelemetry attributes

telemetry() returns span and event attributes that bind a retrieval to the immutable artifact it read, so a trace remains checkable after the corpus moves.

attributes = client.telemetry("knowledge.annpack", "rotate the signing key")
span = attributes["span"]  # annpack.root, annpack.pack, annpack.source_revision, ...

Verification without this package

Receipt verification is implemented independently in Rust, Python, and JavaScript, and all three are held to the same conformance suite. Verifying a receipt does not require this binding, the artifact, or network access.

License

Apache-2.0.

Metadata

Release files for annpack 0.7.0

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

Source distribution (sdist)

Source distribution for annpack 0.7.0
File Size Uploaded Provenance Actions
annpack-0.7.0.tar.gz 6.7 kB With provenance Details for annpack-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for annpack 0.7.0
File Interpreter ABI Platform Actions
annpack-0.7.0-py3-none-any.whl Python 3 none any Details for annpack-0.7.0-py3-none-any.whl

Total release size: 11.4 kB

Release files / annpack-0.7.0.tar.gz

Download URL annpack-0.7.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8bc14b3c03825d5afc131c9e0e8d1dd835940c901807b133df07732a4248af08
BLAKE2b-256 checksum
How to use checksums
540bbc5ed4903c1a34ed3e4cd8bc6b7e136b82093fb14fe9cf3a2455b1be61b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Aug 12, 2026.

Transparency log

Release files / annpack-0.7.0-py3-none-any.whl

Download URL annpack-0.7.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
690eb9d02d1df9cc9521b521e2aa2b61b2d4bbb2a643797fed23167e6fe472c3
BLAKE2b-256 checksum
How to use checksums
d153ecd010fcf9f665a8b55d23316ddec9c99d2689bbd0f01b3f6bb9842c40e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Aug 12, 2026.

Transparency log

Security for annpack 0.7.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for annpack-0.7.0.tar.gz

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 Aug 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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