Skip to main content

WARM logo

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.

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.

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

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

Source distribution (sdist)

Source distribution for warm-python 0.7.3
File Size Uploaded Provenance Actions
warm_python-0.7.3.tar.gz 2.3 MB With provenance Details for warm_python-0.7.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for warm-python 0.7.3
File Actions
warm_python-0.7.3-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for warm_python-0.7.3-cp39-abi3-win_amd64.whl
warm_python-0.7.3-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details for warm_python-0.7.3-cp39-abi3-musllinux_1_2_x86_64.whl
warm_python-0.7.3-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details for warm_python-0.7.3-cp39-abi3-musllinux_1_2_aarch64.whl
warm_python-0.7.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for warm_python-0.7.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
warm_python-0.7.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for warm_python-0.7.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
warm_python-0.7.3-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for warm_python-0.7.3-cp39-abi3-macosx_11_0_arm64.whl
warm_python-0.7.3-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for warm_python-0.7.3-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 43.9 MB

Release files / warm_python-0.7.3.tar.gz

Download URL warm_python-0.7.3.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
5266ea0684fa60e0899ad003f9670c60c30fb9c069240036381f1481fcdd64c1
BLAKE2b-256 checksum
How to use checksums
058af29a555df8cc919b00fe3262da9ca9674835805eab9c68e49980c573c28e
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 26, 2026.

Transparency log

Release files / warm_python-0.7.3-cp39-abi3-win_amd64.whl

Download URL warm_python-0.7.3-cp39-abi3-win_amd64.whl
Size 5.8 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7c5b8ec01820cc6c09b5c549f77dcbaee233afcea3977161493f968bf34dace2
BLAKE2b-256 checksum
How to use checksums
6c03a57a74940926117b5c2903ebfe29ebb1dbceed0908784950f6da3591d1c9
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 26, 2026.

Transparency log

Release files / warm_python-0.7.3-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL warm_python-0.7.3-cp39-abi3-musllinux_1_2_x86_64.whl
Size 6.3 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
8379b127b8a22eb97815561f468a1a5c9f63bb21e55fc2784bc9124e6c66b77d
BLAKE2b-256 checksum
How to use checksums
b18bbf39564da020bdf6410250e90a949f71ea3a7f332e29035d23d3f6062078
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 26, 2026.

Transparency log

Release files / warm_python-0.7.3-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL warm_python-0.7.3-cp39-abi3-musllinux_1_2_aarch64.whl
Size 6.0 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
20eefd4b46fd6b5369e8ca04229e8e3d8414f38f8e4f4311b6c440399089f706
BLAKE2b-256 checksum
How to use checksums
1c0786c7b99e71575349e132734ab4e455e30e1d8727f7ed5a4f72324a94fa1f
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 26, 2026.

Transparency log

Release files / warm_python-0.7.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL warm_python-0.7.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 6.1 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
ded8335ef291a60616a9d4b46430575bc7dfe3347e9e148a93dbb30128559db7
BLAKE2b-256 checksum
How to use checksums
6259dcabafdf2e582541b48aee96713c789fc05fc26f1d64ee0c7341d4088c45
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 26, 2026.

Transparency log

Release files / warm_python-0.7.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL warm_python-0.7.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 5.8 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
2e88f19d8967f5b0d42c9b7b348c94d027ed38282d8edaea3a7cb9a41c57f0f2
BLAKE2b-256 checksum
How to use checksums
fb92a63daceecc7f691bed11672cb02824a3ab4df857e08007fd57c3b1df0fb0
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 26, 2026.

Transparency log

Release files / warm_python-0.7.3-cp39-abi3-macosx_11_0_arm64.whl

Download URL warm_python-0.7.3-cp39-abi3-macosx_11_0_arm64.whl
Size 5.6 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7d77afaff95cdb4d324f69f241dcaea45d6a6e0f0c28e9b18a3e94b0f2eeac2a
BLAKE2b-256 checksum
How to use checksums
b470c7d161c5b453f6c6573fcd5b7fa62d30fe4bdd79b977b3b95d2b15ce99dd
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 26, 2026.

Transparency log

Release files / warm_python-0.7.3-cp39-abi3-macosx_10_12_x86_64.whl

Download URL warm_python-0.7.3-cp39-abi3-macosx_10_12_x86_64.whl
Size 6.0 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d264a1ba310308a38458f18bf6aa838f5a9d14285d3e39c1b31768e85a5c968c
BLAKE2b-256 checksum
How to use checksums
9aa85ddefddec4f96416ae86bdcd321534bb4ee53c3b4ffaa739da18ad9bda61
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 26, 2026.

Transparency log

Security for warm-python 0.7.3

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.

Select from 8 files

Attestation for warm_python-0.7.3.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 26, 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