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.

This package requires the annpack CLI

pip install annpack is not a complete installation. The binding drives the annpack binary as a subprocess and does not parse artifact bytes in Python, so untrusted input stays in the Rust runtime — but the binary has to exist.

Install it from the releases page, or from source with Rust 1.88 or newer:

cargo install --git https://github.com/Arjun2729/ANNPACK --tag v0.8.0 annpack

Then put it on PATH, set ANNPACK_BINARY, or pass binary= to the client:

annpack --version    # annpack 0.8.0

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.8.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.8.0
File Size Uploaded Provenance Actions
annpack-0.8.0.tar.gz 6.7 kB With provenance Details for annpack-0.8.0.tar.gz

Built distribution (wheel)

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

Total release size: 11.6 kB

Release files / annpack-0.8.0.tar.gz

Download URL annpack-0.8.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b783a85b3f44ec93192c4961c2d398b038e4ea58fdf495c375ad04747765880a
BLAKE2b-256 checksum
How to use checksums
e93dbbf3b05df0ee88814ab083f0121026a215f5280c9dfda91514d7524c9fde
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 17, 2026.

Transparency log

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

Download URL annpack-0.8.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d851bace5ecd527df9466c0ac10c5f6e7633cfeec6906d6fbbdb73a1c3e0ab9
BLAKE2b-256 checksum
How to use checksums
f1a46e757faa74501d8f2d45af98fb714449d5292015e050805eaaf1888938dc
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 17, 2026.

Transparency log

Security for annpack 0.8.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.8.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 17, 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