minivecdb
Ultra-fast 1-bit quantised vector database with TTL garbage collection — Rust native extension for Python.
pip install minivecdb
pip install "minivecdb[langchain]" # + LangChain adapter
Same core as @microvecdb/core (browser / Node.js) — compiled from the same Rust codebase via PyO3 + Maturin.
Quick start
from minivecdb import MiniVecDb
import numpy as np, time
db = MiniVecDb(capacity=10_000)
vec = np.random.randn(384).astype(np.float32)
vec /= np.linalg.norm(vec)
db.insert(id=0, vector=vec.tolist(), inserted_at=time.time() * 1000)
db.build_index(m=16, ef_construction=200)
results = db.search(vec.tolist(), limit=5)
# → [{"id": 0, "score": 1.0, "distance": 0}]
LangChain adapter
from langchain_openai import OpenAIEmbeddings
from minivecdb.langchain import LangChainMiniVecDb
# Ephemeral agent scratchpad — 10 min TTL
with LangChainMiniVecDb(
embedding=OpenAIEmbeddings(model="text-embedding-3-small"),
ttl_minutes=10,
gc_interval_sec=30,
) as memory:
memory.add_texts(["User mentioned ticket #42-ABC."])
docs = memory.similarity_search("what is the ticket number?", k=3)
TTL & GC
Every text has a wall-clock TTL. A daemon GC thread tombstones expired vectors automatically. Set ttl_minutes=0 (default) to disable.
count = store.run_gc() # manual GC cycle — returns tombstone count
store.destroy() # stop GC thread, free native memory
Benchmarks
| Metric | Result |
|---|---|
| Search latency (10k vectors) | 0.08 ms |
| RAM per vector (384-dim) | 48 B (vs 1,536 B f32) |
| Recall@5 (sentence embeddings) | 100% |
License
MIT
Release files for minivecdb 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| minivecdb-1.1.0.tar.gz | 37.2 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| minivecdb-1.1.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| minivecdb-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| minivecdb-1.1.0-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 554.4 kB
Release files / minivecdb-1.1.0.tar.gz
| Download URL | minivecdb-1.1.0.tar.gz |
|---|---|
| Size | 37.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c9c7b5ff62d2ef866f11242522be0b297b84cb28132293cc845e4c16b05486c
|
|
BLAKE2b-256 checksum How to use checksums |
2dd84593ecdccd08e039a9ccde58cf48c67e155f1633cb993c96da588bdb13b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 29, 2026.
Transparency logRelease files / minivecdb-1.1.0-cp39-abi3-win_amd64.whl
| Download URL | minivecdb-1.1.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 116.7 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1d77bff632957d0bcfae3166166823dc35a943fc722e3cbf4a2cebb9300da4c2
|
|
BLAKE2b-256 checksum How to use checksums |
9b8c78ee13b604df2b2b4099f2f4dec7728a58055eaef81890f465be3586fd9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 29, 2026.
Transparency logRelease files / minivecdb-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | minivecdb-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 211.1 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
fae9d008963f478861ca28c6df6ab28e8ada93a86368d7ce8cfc53c322ba0ed5
|
|
BLAKE2b-256 checksum How to use checksums |
e0b04eaeebb44def9b0b2ac32e855c6bfaa71930fb9052ecc6144c7c23c89395
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 29, 2026.
Transparency logRelease files / minivecdb-1.1.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | minivecdb-1.1.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 189.4 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fe5d522d0bbab99ff7c12785428def9de0af745ac5443d21dda3c655d1030562
|
|
BLAKE2b-256 checksum How to use checksums |
51cd6dd4ae0448f9468f6cbfa631422a7847a4bb4c4c6fe0402c27b5f540832b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 29, 2026.
Transparency log