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.2.1

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.2.1
File Size Uploaded Provenance Actions
tapirus-1.2.1.tar.gz 854.6 kB With provenance Details for tapirus-1.2.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for tapirus 1.2.1
File Actions
tapirus-1.2.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for tapirus-1.2.1-cp310-abi3-win_amd64.whl
tapirus-1.2.1-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.2.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
tapirus-1.2.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for tapirus-1.2.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
tapirus-1.2.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for tapirus-1.2.1-cp310-abi3-macosx_11_0_arm64.whl
tapirus-1.2.1-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for tapirus-1.2.1-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 28.0 MB

Release files / tapirus-1.2.1.tar.gz

Download URL tapirus-1.2.1.tar.gz
Size 854.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5db26b09b0a5fc3a01c928d63e49b7111fc41589567f208be231919f201b4e4e
BLAKE2b-256 checksum
How to use checksums
93bebdf54e6267f38e7fcf303458732a14a56fbc607880be4e841d011a6501b5
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 16, 2026.

Transparency log

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

Download URL tapirus-1.2.1-cp310-abi3-win_amd64.whl
Size 5.5 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9222aa1daed17d4d5b4c59eb7e1ecba763d0185ed5dd9f017dc5a0e74f1de3aa
BLAKE2b-256 checksum
How to use checksums
010a75a230b6b19b4ce6d8524dc7aa331d979d202930ba4f4a14178c5f26eecf
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 16, 2026.

Transparency log

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

Download URL tapirus-1.2.1-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
85fa6d18a05039609d3af17a9b8f2eb3521293aeccde3cb07b8643cfb2b58ca0
BLAKE2b-256 checksum
How to use checksums
15a69464e58b57919198076520e5d99f5da03f0f2b622f671f1a52fdea54e1d2
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 16, 2026.

Transparency log

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

Download URL tapirus-1.2.1-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
fa6a23efd99c1cd8c9d580273f86fab2d3c70d9477b7e45445c84e59999488e4
BLAKE2b-256 checksum
How to use checksums
b9a4b1c5472bd24070756dced03aec23b07df4db3dae8346f2a17cd9da046e1e
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 16, 2026.

Transparency log

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

Download URL tapirus-1.2.1-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
0f0f89aa42411679b4597884a25d0aefe9c55065a6bcb9e376e0c3e923dd4825
BLAKE2b-256 checksum
How to use checksums
68b5ebe7106314596ffa2d460c36d942410a9b339c5157cf129a42774bddf353
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 16, 2026.

Transparency log

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

Download URL tapirus-1.2.1-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
dde5feb7cb8610f30acc79862f8c937a3adb9e53e1704d5ede1f409ea545d92d
BLAKE2b-256 checksum
How to use checksums
689e12ee9ea8b975be7933429066c1d1ef6e1a2e747cc0587c57f74f28ff77c2
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 16, 2026.

Transparency log

Security for tapirus 1.2.1

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.2.1.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 16, 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