Ultra-fast 1-bit quantised vector database with TTL GC — Rust native extension
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minivecdb-1.1.0.tar.gz.
File metadata
- Download URL: minivecdb-1.1.0.tar.gz
- Upload date:
- Size: 37.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c9c7b5ff62d2ef866f11242522be0b297b84cb28132293cc845e4c16b05486c
|
|
| MD5 |
05cd63c3cbaee2faaa2bf9371327408a
|
|
| BLAKE2b-256 |
2dd84593ecdccd08e039a9ccde58cf48c67e155f1633cb993c96da588bdb13b3
|
Provenance
The following attestation bundles were made for minivecdb-1.1.0.tar.gz:
Publisher:
publish-pypi.yml on Alekkk777/MiniVecDb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minivecdb-1.1.0.tar.gz -
Subject digest:
0c9c7b5ff62d2ef866f11242522be0b297b84cb28132293cc845e4c16b05486c - Sigstore transparency entry: 1399570148
- Sigstore integration time:
-
Permalink:
Alekkk777/MiniVecDb@e36f9dfbf4e6a706fea9b18767dda0c6084d3e26 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/Alekkk777
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e36f9dfbf4e6a706fea9b18767dda0c6084d3e26 -
Trigger Event:
release
-
Statement type:
File details
Details for the file minivecdb-1.1.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: minivecdb-1.1.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 116.7 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d77bff632957d0bcfae3166166823dc35a943fc722e3cbf4a2cebb9300da4c2
|
|
| MD5 |
3551cf2f7750ac069839335d95f22075
|
|
| BLAKE2b-256 |
9b8c78ee13b604df2b2b4099f2f4dec7728a58055eaef81890f465be3586fd9f
|
Provenance
The following attestation bundles were made for minivecdb-1.1.0-cp39-abi3-win_amd64.whl:
Publisher:
publish-pypi.yml on Alekkk777/MiniVecDb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minivecdb-1.1.0-cp39-abi3-win_amd64.whl -
Subject digest:
1d77bff632957d0bcfae3166166823dc35a943fc722e3cbf4a2cebb9300da4c2 - Sigstore transparency entry: 1399570193
- Sigstore integration time:
-
Permalink:
Alekkk777/MiniVecDb@e36f9dfbf4e6a706fea9b18767dda0c6084d3e26 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/Alekkk777
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e36f9dfbf4e6a706fea9b18767dda0c6084d3e26 -
Trigger Event:
release
-
Statement type:
File details
Details for the file minivecdb-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: minivecdb-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 211.1 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fae9d008963f478861ca28c6df6ab28e8ada93a86368d7ce8cfc53c322ba0ed5
|
|
| MD5 |
15e80a20b4f325b60a8aaafbfcd94dd7
|
|
| BLAKE2b-256 |
e0b04eaeebb44def9b0b2ac32e855c6bfaa71930fb9052ecc6144c7c23c89395
|
Provenance
The following attestation bundles were made for minivecdb-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish-pypi.yml on Alekkk777/MiniVecDb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minivecdb-1.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
fae9d008963f478861ca28c6df6ab28e8ada93a86368d7ce8cfc53c322ba0ed5 - Sigstore transparency entry: 1399570158
- Sigstore integration time:
-
Permalink:
Alekkk777/MiniVecDb@e36f9dfbf4e6a706fea9b18767dda0c6084d3e26 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/Alekkk777
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e36f9dfbf4e6a706fea9b18767dda0c6084d3e26 -
Trigger Event:
release
-
Statement type:
File details
Details for the file minivecdb-1.1.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: minivecdb-1.1.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 189.4 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe5d522d0bbab99ff7c12785428def9de0af745ac5443d21dda3c655d1030562
|
|
| MD5 |
7e32aae811c98d015eaeeb2128079692
|
|
| BLAKE2b-256 |
51cd6dd4ae0448f9468f6cbfa631422a7847a4bb4c4c6fe0402c27b5f540832b
|
Provenance
The following attestation bundles were made for minivecdb-1.1.0-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
publish-pypi.yml on Alekkk777/MiniVecDb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minivecdb-1.1.0-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
fe5d522d0bbab99ff7c12785428def9de0af745ac5443d21dda3c655d1030562 - Sigstore transparency entry: 1399570167
- Sigstore integration time:
-
Permalink:
Alekkk777/MiniVecDb@e36f9dfbf4e6a706fea9b18767dda0c6084d3e26 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/Alekkk777
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e36f9dfbf4e6a706fea9b18767dda0c6084d3e26 -
Trigger Event:
release
-
Statement type: