Skip to main content

TapirusDB native Python SDK

Python 3.10+ binding to the Rust engine through PyO3. This package opens actual .tapir files; it does not require a daemon. python/ is a separate legacy ctypes integration and does not define this package's API.

import tapirus

with tapirus.connect("agent.tapir") as db:
    db.execute("CREATE TABLE notes (id INTEGER PRIMARY KEY, body TEXT)")
    db.execute("INSERT INTO notes VALUES (?, ?)", [1, "Don't interpolate SQL"])
    print(db.query("SELECT * FROM notes WHERE id = ?", [1]))
    source = db.store_memory({
        "content": "The delivery arrives on Tuesday",
        "embedding": [1.0, 0.0],  # supply your model's actual embedding
        "namespace": "support",
        "session_id": "case-7",
        "tags": ["source:delivery-policy"],
    })
    print(db.search_memories({"embedding": [1.0, 0.0], "namespace": "support"}))

execute/query accept a list or tuple of bound parameters: None, bool, signed 64-bit integer, finite float, string, bytes or a finite vector list. Results are lists of dictionaries; integers retain precision and blobs return bytes. Literal question marks inside SQL strings are preserved.

store_memory, search_memories and forget_memory use the core AI memory contract. Results include source content/IDs and separate lexical, semantic and recency scores. Applications supply embeddings from a consistent model. These calls execute locally without contacting a network service. For hard per-owner namespace/session boundaries in multi-tenant servers or Rust, see MemoryAccessScope and --api-key-namespace. TAP classification/verification scores are deterministic engine scores rather than calibrated probabilities.

execute("BEGIN"), COMMIT, ROLLBACK and savepoints apply to SQL and AI memory together. The context manager closes the database on exit; it does not automatically commit an explicit transaction. close() is idempotent. It invalidates retained collection handles and releases the native connection. Connection and collection objects must stay on their creating Python thread; this module requires the GIL.

Pass a second argument to connect(path, passphrase) to open an XChaCha20-Poly1305 encrypted native .tapir database (or use TapirusWasm.new_encrypted(passphrase) in browser WASM). Use tapirus.SessionDatabase.open(path) for independently owned transactions and non-blocking snapshots.

Build and validate the wheel

The wheel also installs tapirus-migrate, tapirus-agent and tapirus-eval. See AI and embedded workflows for source upsert/batch/TTL/model contracts, sessions, SQLite migration, a runnable agent, and the optional verified local multilingual E5 ONNX backend. The ONNX runtime, tokenizer and NumPy dependencies are optional; install the onnx extra or its declared dependencies when using --backend onnx.

python -m pip install 'maturin>=1.16,<2'
maturin build --manifest-path sdks/python/Cargo.toml --locked --out target/python-wheels
python scripts/test-python-sdk.py --wheel target/python-wheels
maturin sdist --manifest-path sdks/python/Cargo.toml --out target/python-sdist
python scripts/normalize-python-sdist.py --sdist target/python-sdist --check

The consumer check installs the wheel offline into a fresh directory, writes in a subprocess, then reopens in a second process. It checks parameters, large integers, blobs, vectors, AI filters/rollback, collections, close and encrypted reopen. Local evidence covers Windows/Python 3.12; CI defines additional host/interpreter checks. Registry publication is a separate release step.

The source-package step prunes lock entries for workspace crates excluded by Maturin. It rejects registry version/checksum changes, retains other archive bytes and compiles the extracted package with --locked --offline. Python 3.12+ is required for this packaging check; the SDK itself supports Python 3.10+.

The wrapper retains its existing MIT declaration. The embedded engine uses the repository's BUSL-1.1 terms, included as CORE_LICENSE; the combined wheel is labeled MIT AND BUSL-1.1. See NOTICE for the component boundary.

Metadata

Release files for tapirus 1.3.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 tapirus 1.3.0
File Size Uploaded Provenance Actions
tapirus-1.3.0.tar.gz 892.7 kB With provenance Details for tapirus-1.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for tapirus 1.3.0
File Actions
tapirus-1.3.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for tapirus-1.3.0-cp310-abi3-win_amd64.whl
tapirus-1.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for tapirus-1.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
tapirus-1.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for tapirus-1.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
tapirus-1.3.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for tapirus-1.3.0-cp310-abi3-macosx_11_0_arm64.whl
tapirus-1.3.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for tapirus-1.3.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 28.0 MB

Release files / tapirus-1.3.0.tar.gz

Download URL tapirus-1.3.0.tar.gz
Size 892.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ec1634d5511018db48dba1377a96b857f2d01d1763028ba581d18b3a6169150f
BLAKE2b-256 checksum
How to use checksums
f3fca3b98cfaf2bdfa60ed2f366d9e87579c7a77e9da7626ec8a4cd1d252207c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 25, 2026.

Transparency log

Release files / tapirus-1.3.0-cp310-abi3-win_amd64.whl

Download URL tapirus-1.3.0-cp310-abi3-win_amd64.whl
Size 5.5 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
72535bd5e95f0fb34e364a8df2efb3701b119108f2878f0ad1cc605c2e0bae2c
BLAKE2b-256 checksum
How to use checksums
3916803ee23db7b27abfc45ea0ab37bbc22dd767dc2c01e89b6c5ef187d978b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 25, 2026.

Transparency log

Release files / tapirus-1.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL tapirus-1.3.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 5.7 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c2ace8f269d1f5cf6fd7f710187dc7509b947dad5624cb156ec0bf229f96787f
BLAKE2b-256 checksum
How to use checksums
3286c2bc6526d4e58386924cd7dcf7f779c007e4e4fdfe90dbdb6aef7732f8fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 25, 2026.

Transparency log

Release files / tapirus-1.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL tapirus-1.3.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 5.4 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
4fe468dfd490477a5763ee270f2a7e3dfa9481d70ff235675a183679523b3ac5
BLAKE2b-256 checksum
How to use checksums
b0ffb6b9467e80daa790987887d0b2a559b52758cfec97db4b3b0ad8474455bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 25, 2026.

Transparency log

Release files / tapirus-1.3.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL tapirus-1.3.0-cp310-abi3-macosx_11_0_arm64.whl
Size 5.0 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bf8e1e53ccff3ef9586e3f8f0be0ff6408bf18f314599705ca9b2e6a0050b5ad
BLAKE2b-256 checksum
How to use checksums
acd5fdde1dd0ab664e844e86643eefa0547bac7b53bc9d41d76d9ad6d39620ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 25, 2026.

Transparency log

Release files / tapirus-1.3.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL tapirus-1.3.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 5.5 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
31328c34d43ecad153e106394e14e77942067eba5a5d45f75d44e1178277cdc7
BLAKE2b-256 checksum
How to use checksums
6c6ba86680faa00253622fa1d8bea3ff0e6780adea8258d807ddd73eff17b858
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 25, 2026.

Transparency log

Security for tapirus 1.3.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

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for tapirus-1.3.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 Nov 25, 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