Skip to main content

kalpack

Python binding for the Kalpack reference runtime.

Kalpack 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 Kalpack 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 kalpack CLI

pip install kalpack is not a complete installation. The binding drives the kalpack 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/kalpack --tag v0.8.0 kalpack

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

kalpack --version    # kalpack 0.8.0

Usage

from kalpack import Client

client = Client()

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

results = client.search("knowledge.kalpack", "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.kalpack",
    "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.kalpack", "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 kalpack 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 kalpack 0.8.0
File Size Uploaded Provenance Actions
kalpack-0.8.0.tar.gz 7.1 kB With provenance Details for kalpack-0.8.0.tar.gz

Built distribution (wheel)

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

Total release size: 12.3 kB

Release files / kalpack-0.8.0.tar.gz

Download URL kalpack-0.8.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d15ef043e15b1c023fa063bc804890409bd0fdde2ada991d00913a048a6835bc
BLAKE2b-256 checksum
How to use checksums
c7f46e99f17b8c625e819d9b4f65b42b29882317f90381ba6474f1430f76e5bf
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 15, 2026.

Transparency log

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

Download URL kalpack-0.8.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0670a6d18964da5c699eeac52a9de6b0be416141c585bd1f5fb42ebfdce244b
BLAKE2b-256 checksum
How to use checksums
bfa1fc3128f69909ff99c75912c9dc9388685ef1fa3980d7c0911acbd008b4f9
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 15, 2026.

Transparency log

Security for kalpack 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 kalpack-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 15, 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.

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files Full provenance

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