Skip to main content

valise

Retrieval in one file.

Your RAG prototype works. Now ship it — and suddenly the corpus isn't a thing you have, it's a thing you operate. A vector database container. An index directory that has to travel with the documents and stay consistent with them. A rebuild step in CI. The most valuable artifact you built is the one piece you can't hand to anyone.

SQLite solved this for relational data. Valise does it for retrieval: documents, a BM25 index, compressed vectors, and the schema describing them, in one .vls file you copy, version, and query in place.

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.

Copy it while it's being written

That's the test that matters. Take a copy of a live corpus mid-write, move it to a machine with a different OS and instruction set, open it there. On a 171,000-document hybrid corpus:

Valise Tantivy + USearch SQLite + FTS5 + vec
Mid-write copies that opened correctly 50 / 50 4 / 50 0 / 50
Artifact 239 MB, 1 file 677 MB, 62 files 865 MB

Top-10 results come back identical across macOS/ARM and Linux/x86-64, from the same file, with no reconfiguration.

There is no index to build

Every ANN library builds a graph first, and pays again whenever the corpus changes. Valise builds nothing: vectors are stored only as quantized codes, and the candidate-search sketch is derived from those same codes at open — in memory, never written.

At 100k × 768d against recall-matched baselines: 0.50 s to ingest and commit, versus 50 s for FAISS HNSW, 91 s for USearch, 139 s for hnswlib. 90–310× faster to build, and nothing on disk but your data.

The bill: the scan is linear, so a mature HNSW answers individual queries faster. If you build once and serve a billion queries over a static corpus, use a graph. If your corpus changes, travels, or there are thousands of small ones, this trade is the right way round.

Valise does not generate embeddings — bring your own model.

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.

Metadata

Release files for valise 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for valise 0.1.4
File Size Uploaded Provenance Actions
valise-0.1.4.tar.gz 570.2 kB With provenance Details for valise-0.1.4.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for valise 0.1.4
File Actions
valise-0.1.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for valise-0.1.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
valise-0.1.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for valise-0.1.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
valise-0.1.4-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for valise-0.1.4-cp39-abi3-macosx_11_0_arm64.whl
valise-0.1.4-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for valise-0.1.4-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 7.2 MB

Release files / valise-0.1.4.tar.gz

Download URL valise-0.1.4.tar.gz
Size 570.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b5ca4e52a5e556368d866fda14858d0190c63617e5eb09bd405eef832ed5ea12
BLAKE2b-256 checksum
How to use checksums
c26350a8cefddcfddfe3f61e6c68bb1396871dad6a8286e37ea312e5958d75f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 27, 2026.

Transparency log

Release files / valise-0.1.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL valise-0.1.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.8 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
7f942ab634954d0251f069cbd5ef1f71b3bde7d002dfa09db38f1cb67a020d1a
BLAKE2b-256 checksum
How to use checksums
0065d96685e562fa73e04c89c907165bd611ad6176e430ecac5445ffa38f7bb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 27, 2026.

Transparency log

Release files / valise-0.1.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL valise-0.1.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.6 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
8744b464d3f0cbe22dce4041eee3a34975425c43d583632104832e92c35bb044
BLAKE2b-256 checksum
How to use checksums
5019b9a21282dc6d547f49a6ade45887dc86eb024444dbdb3eeb3ec7ecf1b700
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 27, 2026.

Transparency log

Release files / valise-0.1.4-cp39-abi3-macosx_11_0_arm64.whl

Download URL valise-0.1.4-cp39-abi3-macosx_11_0_arm64.whl
Size 1.5 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cd38401daa7ab97beedba3f515b1bc284462d9003930ecc0718d32cf209926d1
BLAKE2b-256 checksum
How to use checksums
0a0dc990c198b79f708961588e6b26f7e9f232d7a098c4560aa8f4b4b08f9c9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 27, 2026.

Transparency log

Release files / valise-0.1.4-cp39-abi3-macosx_10_12_x86_64.whl

Download URL valise-0.1.4-cp39-abi3-macosx_10_12_x86_64.whl
Size 1.7 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
296a808a098db1315e6baee6ee70c2e565b1807a807b6d7e335f3a0f5252e2e0
BLAKE2b-256 checksum
How to use checksums
4577fe38ecaa989bbb9ec89f29172838c87cfe81ae6e78e2ff8d2ae8b7e174d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 27, 2026.

Transparency log

Security for valise 0.1.4

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 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for valise-0.1.4.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 Jul 27, 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