Skip to main content

Python bindings for the Valise single-file AI/retrieval archive format.

Project description

valise

Retrieval in one file. Text search, vector search, and your documents packed into a single portable .vls file — no server, no sidecar index directory, no external vector database.

pip install valise
import numpy as np
from valise import Store, Schema, Record, Search, Vector

store = Store.open("kb.vls")                      # open-or-create
store.collection("notes", Schema()
    .text("body")                                 # English BM25 by default
    .vector("dense", Vector(dim=768)))            # cosine, auto-calibrated codec

with store.writer() as w:
    w.put("notes", "doc-1",
          Record().text("body", "portable retrieval capsules")
                  .vector("dense", embedding))    # float32 ndarray
    w.commit()                                    # the durability point

hits = store.search("notes", Search()
    .text("body", "retrieval capsule")
    .vector("dense", query)
    .top_k(10))

print(hits.keys)      # ['doc-1']
print(hits.scores)    # float32 ndarray

The schema lives in the file. A later run, another process, or another machine calls Store.open("kb.vls") and searches immediately — nothing to re-declare, nothing to migrate.

Note that leaving the with block releases the writer lock; it does not commit. commit() is explicit, and it is the only durability point.

Why

Valise is for corpora that need to move: between agents, devices, eval runs, customer environments, air-gapped deployments. What you ship is a complete, queryable artifact rather than a service to stand up.

It is not a hosted vector database or a distributed search cluster, and it does not generate embeddings — bring your own model. For live, multi-tenant, continuously-updated corpora, reach for Qdrant, LanceDB, Milvus, or an SQLite extension instead.

What you get

  • Hybrid search. Lexical and vector channels fused at query time, with reciprocal-rank fusion as the default. Text scorers include BM25, TF-IDF cosine, count cosine, approximate cosine variants, and Dice / overlap / containment.
  • Compact vectors. QAM Lloyd-Max and UPQ polar codecs at ~5.5 bits per dimension, with NEON and AVX2 kernels. There is no persisted HNSW graph or IVF index — nothing to rebuild, and nothing on disk but the capsule.
  • Crash safety. Commits are footer-rooted and atomic: after a crash a reader sees the previous committed state or the new one, never a mixture. Segment payloads carry BLAKE3 checksums.
  • Time partitions, tombstones with explicit compaction, and recency as either a ranking signal or a hard filter.
  • A typed surface. Full type hints, checked under mypy --strict, with strict enums rather than magic strings. Vectors cross the FFI boundary zero-copy.

Batch ingest

put_many takes a C-contiguous float32 [N, dim] array and ingests the whole batch in one native call, rather than a per-row Python loop:

vectors = np.ascontiguousarray(model.encode(bodies), dtype=np.float32)
with store.writer() as w:
    w.put_many("notes", keys, vectors, texts=bodies)
    w.commit()

Reading everything back

Your data is never locked in. keys() plus get() walks a whole collection:

r = store.reader()
for key in r.keys("notes"):
    print(r.get("notes", key).text)

The valise command-line tool (cargo install valise) does the same from a shell, including valise export kb.vls > kb.jsonl.

Requirements

Python 3.9 or newer, and NumPy. Wheels are published for Linux and macOS on x86-64 and aarch64.

Windows is not supported yet — the commit protocol relies on positional file IO and fcntl advisory locks, and the Windows equivalents are not implemented.

Status

Pre-1.0 and under active development. Below 1.0, minor versions may break both the API and the on-disk format.

Links

  • Documentation — quickstart, concepts, full API reference
  • Source — the Rust engine, the on-disk format specification, and the benchmark methodology
  • Rust crate

Licensed under MPL-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

valise-0.1.1.tar.gz (553.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

valise-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

valise-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

valise-0.1.1-cp39-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

valise-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file valise-0.1.1.tar.gz.

File metadata

  • Download URL: valise-0.1.1.tar.gz
  • Upload date:
  • Size: 553.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for valise-0.1.1.tar.gz
Algorithm Hash digest
SHA256 38a2703b84c313558f11b2488fed722c89f692303c126fa112d441105153083a
MD5 b8218e98f12ded191a0a2c011916c867
BLAKE2b-256 0b7b31dff77936d006624722a0629e95f1ac598d59776b92134342bb8db4e633

See more details on using hashes here.

Provenance

The following attestation bundles were made for valise-0.1.1.tar.gz:

Publisher: wheels.yml on white07S/valise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file valise-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for valise-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 34a065b9e0ca105ebe511f294c9032848ccb55fd4c7f0e6c064dfae36766b4a1
MD5 e258d98c8ab884eaf1260a8aaf123e56
BLAKE2b-256 f71bcac214b0b97b47d7b14ed687c71a501c587e73f5f681620d764c160b47f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for valise-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on white07S/valise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file valise-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for valise-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a4498b20f22866b934a7a7c255b721b89fd1cffbd50cdc6d3c54f3a2bf528690
MD5 3dccc9f47ef4218adf52a53eee159ddf
BLAKE2b-256 09e89aa21a67f6b101cac6b6b3376d097f6d23eef518bb25ec43e59c8ee5883b

See more details on using hashes here.

Provenance

The following attestation bundles were made for valise-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: wheels.yml on white07S/valise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file valise-0.1.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for valise-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 679286052133c0f164b48765ca0c03b0cef743f73b470975611b749bacff094b
MD5 b7691a530b2adb67e7c158f300e14963
BLAKE2b-256 7c32790751f17faafb4c9e7f5a9edc22a0c0cf92a8c5670db555d25d645dfb2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for valise-0.1.1-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: wheels.yml on white07S/valise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file valise-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for valise-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3d7f50d9d26d980f7805fc6f7278a29fce06b9f38bf7df13886b0e4019d300bd
MD5 3feed744c04173f96418d535cfed7040
BLAKE2b-256 111a681c5f65089adc9db5eb56f4f7d173c8a788261cc52d13178dfde5df8d5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for valise-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: wheels.yml on white07S/valise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page