WARM for Python
Native Python bindings for WARM's vector search and vector-symbolic algebra.
Website · Documentation · Source · License
Install
Python 3.9 or newer is required. Install the native binding; NumPy (>=1.26, which the vector-index API needs) is installed with it:
uv init # only outside an existing uv project
uv add warm-python
The distribution is named warm-python; the import is writerslogic_warm.
For the pinned default embedding model with no first-use download, install
warm-python[embed]. That extra adds the separate
warm-models wheel.
Vector search
VectorIndex builds an approximate nearest-neighbor index over vectors you supply. It supports
angular, Euclidean, and inner-product search. The returned IDs are row numbers in the input matrix.
import numpy as np
from writerslogic_warm import VectorIndex
vectors = np.random.default_rng(7).normal(size=(128, 32)).astype(np.float32)
index = VectorIndex("angular", degree=16, build_ef=64)
index.fit(vectors)
index.set_query_arguments(ef=64, rerank=32)
matches = index.query(vectors[0], 5)
print(matches.tolist())
The binding also provides UpdatableIndex for inserts and deletes, FilteredIndex for restricted
searches, and SparseIndex for sparse vectors.
index.save(path) persists a VectorIndex; index.load(path) reads it into private memory.
Use the same metric and direct_ip setting when loading. On Linux, source builds after
4299b539 also support index.load(path, shared=True) for an immutable memfd snapshot.
The loader requires F_SEAL_WRITE, F_SEAL_SHRINK and F_SEAL_GROW; ordinary files and
F_SEAL_FUTURE_WRITE alone are rejected. Each worker must open the same snapshot inode
to share physical pages. A loaded mapping remains valid after its publishing descriptor closes.
The normal private-memory load remains the default on every platform.
This option is not in the older wheel used by the VectorDBBench entry.
With the [embed] extra, the pinned default text embedding model is available offline:
from writerslogic_warm import Embedder
embedder = Embedder(offline=True)
print(len(embedder.embed_query("Where is my note?")))
Phase-vector algebra
PhaseHVec supports deterministic phase-vector binding, unbinding, bundling, and similarity.
from writerslogic_warm import PhaseHVec
key = PhaseHVec.random(1024, 64, seed=1)
value = PhaseHVec.random(1024, 64, seed=2)
stored = key.bind(value)
assert stored.unbind(key).phases() == value.phases()
resonator_factorize searches codebooks for factors of a bound phase vector.
Phase vectors in bundles and factor codebooks must match the composite's dimension and
resolution. Invalid shapes and resource limits raise ValueError. Empty factor codebooks
are rejected; an empty list of factors returns []. Zero dimensions and zero iterations
retain the Rust API's behavior.
The Python boundary admits at most 65,536 dimensions, 65,536 input vectors, and 4,194,304
total phase elements per operation. Resonators additionally allow at most 64 factors,
1,000 iterations, and 100,000,000 estimated component visits, computed as
(3 * entries + factors**2) * max(dimensions, 1) * (iterations + 1) before cloning codebooks
or allocating the resonator index.
Document search and memory
Warm is the in-process engine: a persistent store with hybrid BM25 and exact-cosine document
search, the memory API and vector search. Requests and results are dicts and lists with the
camelCase fields of the Node binding. One process may write a store at a time.
Warm ships in warm-python 0.7.3 and later; the earlier 0.6.8 wheel does not have it.
from writerslogic_warm import Warm
store = Warm(16384, "./warm-data")
store.memorize_document({"id": "a", "text": "The harbor opens at six in the morning."})
print(store.search_documents("when does the harbor open", {"k": 3})[0]["documentId"])
store.remember({"text": "Ada prefers tea", "subject": "ada"})
print(store.recall("what does Ada drink")["results"][0]["text"])
Hybrid recall
Recall is lexical (BM25) until the store has vectors. Give it vectors one of two ways and
recall blends BM25 with exact cosine by default:
from writerslogic_warm import Embedder, Warm
# The engine embeds facts and queries itself (local embedding model).
store = Warm(16384, "./warm-data", embedder=Embedder())
store.remember({"text": "Ada prefers tea", "subject": "ada"})
store.recall("what does Ada drink") # hybrid
# Or supply the vectors: declare the space, then pass `embedding` on remember and recall.
vector = query_vector = [1.0] * 384 # your model's output
store = Warm(16384, "./warm-ext", embedding_dimensions=384)
store.remember({"text": "Ada prefers tea", "embedding": vector})
store.recall("what does Ada drink", {"embedding": query_vector})
embedding takes a list or a numpy array of exactly the store's dimensions with finite values
and not all zeros; anything else is a ValueError naming the problem. A recall with no
embedding on a store with no embedder ranks lexically, bit-for-bit as before.
{"semanticWeight": 0} forces lexical ranking on a store that has vectors, and
{"fusion": "rrf"} selects reciprocal-rank fusion instead of the default blend. A store is
reopened with the same embedder or embedding_dimensions.
memorize_vector(id, vector) and query_vector(vector, k) use the vertex graph index;
query_vector returns (id, cosine) pairs.
One writer, many readers
A store has one writer at a time. Warm(...) is the writer: a second one fails at open with
StoreLockedError naming the holder. Warm.open_read_only(...) takes no lock, so a reader
runs beside the writer without copying the store, sees only what the writer committed, and
moves to newer commits on refresh() (False when nothing changed; it reads only the new
commits). Mutations on a reader raise
ReadOnlyError; close() (or with Warm(...) as store:) flushes, releases the lock and is
safe to repeat; later calls raise StoreClosedError.
with hm.Warm(1024, "./store") as writer:
writer.memorize_document({"id": "a", "text": "committed"})
reader = hm.Warm.open_read_only(1024, "./store")
writer.memorize_document({"id": "b", "text": "newer"})
reader.refresh() # True: the reader now sees "b"
The consistency guarantee, the cost of a reader, the erasure bound and the Windows differences are in one writer, many readers.
Choosing the right Python package
This native binding runs the engine in your Python process: document search, the memory API,
vector search and phase-vector operations. For an HTTP client to warm-server, use
warm-sdk.
Metadata
Release files for warm-python 0.7.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| warm_python-0.7.5.tar.gz | 2.4 MB | With provenance | Details for warm_python-0.7.5.tar.gz |
Built distributions (wheels)
Total release size: 44.8 MB
Release files / warm_python-0.7.5.tar.gz
| Download URL | warm_python-0.7.5.tar.gz |
|---|---|
| Size | 2.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d2e17839459e8e6d9bead383aecfee967b8de98d0f5009d26f0add30b29c66e
|
|
BLAKE2b-256 checksum How to use checksums |
07015b096204718273b808b362c3d89f722d973b4b53ac887cbb39dc9d8e1e18
|
| 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 28, 2026.
Transparency logRelease files / warm_python-0.7.5-cp39-abi3-win_amd64.whl
| Download URL | warm_python-0.7.5-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 6.0 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e043f991c7137e1c4e63a843ba13e10f94b6dd355a0de659a80029dd8e43ee9b
|
|
BLAKE2b-256 checksum How to use checksums |
d4dd34cc0cc0f6ee881341579ffc19f39618eeb74fd46a88a8140bdce4427cd6
|
| 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 28, 2026.
Transparency logRelease files / warm_python-0.7.5-cp39-abi3-musllinux_1_2_x86_64.whl
| Download URL | warm_python-0.7.5-cp39-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2012c6fe6fb012b3b961c5f903c0746e4f61e7894b46cb96926b2c0326e26828
|
|
BLAKE2b-256 checksum How to use checksums |
327d40c7df0502ef44bf82b4c0d3c74b514a68d5e5d24d03b49db54cb63d7055
|
| 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 28, 2026.
Transparency logRelease files / warm_python-0.7.5-cp39-abi3-musllinux_1_2_aarch64.whl
| Download URL | warm_python-0.7.5-cp39-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 6.1 MB |
| Tags | CPython 3.9 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
faed6b24c5b292ee58b6aab9614b64e10040467998bcb2e98092b7785931807d
|
|
BLAKE2b-256 checksum How to use checksums |
0eaf9b479bdf1a37075c091b1c4a1129189bd704e754a3faa8a44398956f1e0a
|
| 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 28, 2026.
Transparency logRelease files / warm_python-0.7.5-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | warm_python-0.7.5-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ee391c3dbfbd537987652ae7fb61f6947b4f6aa684748ece4447ab6f67fa5636
|
|
BLAKE2b-256 checksum How to use checksums |
60e03a82ec06c39b4f7a655996dbb77392fabf7f32c50766d91fbf680741feae
|
| 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 28, 2026.
Transparency logRelease files / warm_python-0.7.5-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | warm_python-0.7.5-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
5742ee811ad6b7e561264eeb1a1bfa5b167aad3b421cdf40b8aab41aaf245307
|
|
BLAKE2b-256 checksum How to use checksums |
a991621b6cdf5cddb02d89f56cde84821e5d3b7c08473497398790c04cb3983e
|
| 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 28, 2026.
Transparency logRelease files / warm_python-0.7.5-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | warm_python-0.7.5-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
29c9e1dc9e1a4ade366f82e43a775e382b518adad6024409038337bd3c6dbd7e
|
|
BLAKE2b-256 checksum How to use checksums |
bb636090b5c7ae5ef8b23a6daea7f061df8eeedd32f39b9d137b8d36bc375728
|
| 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 28, 2026.
Transparency logRelease files / warm_python-0.7.5-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | warm_python-0.7.5-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 6.1 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
d889221a61b7be7d2e7e3a36d21a46cde5a679b38365249f9ffdffae97b0938f
|
|
BLAKE2b-256 checksum How to use checksums |
584d18e998fdd9456e0b79d508667341272cc4380579cbe91aa77df9849a1190
|
| 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 28, 2026.
Transparency logSecurity for warm-python 0.7.5
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 8 files in this release have been uploaded with provenance metadata.
Attestation for warm_python-0.7.5.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 28, 2026.
Transparency logA 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.