An in-process vector index for Python and Rust that compresses embeddings to 2 or 4 bits per dimension and searches the compressed form with SIMD kernels.
Overview
turbovec is an in-process vector index for Python and Rust built on Google Research’s TurboQuant. It stores each vector at 2 or 4 bits per dimension and runs nearest-neighbor search directly on that compressed representation using SIMD kernels tuned for agent workloads.
Compared to holding embeddings as float32, the index uses far less memory at comparable recall to FAISS in the project’s benchmarks. Search can use a staged flow that scans one bit plane and rescored the shortlist exactly. Adding vectors does not require a training step or full rebuilds; the codebook comes from the math rather than your data. Vectors become searchable as soon as they are added, and removals are meant to be fast. The sync(path) call persists only what changed since the last call with crash-safe incremental writes.
It runs inside your application, not as a network service. Python inputs are 2-D float32 arrays; scores are inner products, so vectors should be normalized for cosine similarity. Optional IdMapIndex keys items by uint64 ids. Drop-in integrations exist for LangChain, LlamaIndex, Haystack, and Agno in-memory stores. Filtered search accepts an allowlist of ids or a bitmask.
The authors position it for corpus sizes where linear scan is acceptable, not as a graph index for hundreds of millions of vectors behind strict latency. Quantization is lossy; recall should be checked on your own data. There is no network API, replication, or multi-tenant server—only a library and file format.
Key features
- 2-bit and 4-bit TurboQuant compression
- SIMD search on compressed vectors
- Incremental add and remove without rebuild
- Crash-safe sync() persistence
- Filtered search with id allowlist or bitmask
- Python and Rust APIs
- LangChain, LlamaIndex, Haystack, Agno integrations
- Optional calibrate(sample) for drifting embeddings
Use cases
- In-process embedding retrieval for RAG
- Offline nearest-neighbor search in Python or Rust
- Low-memory vector storage in an application
- Replacing framework in-memory vector stores
- Local stacks with open embedding models