# Turbovec
**Turbovec is a vector search index that fits a 10M-document corpus in 4 GB of RAM instead of 31 GB, and searches it faster than [[FAISS]].** It is written in Rust with Python bindings, built on Google Research's [[TurboQuant]] quantization.
The point: you keep most of FAISS's recall while paying a fraction of the memory. For 1536-dimensional embeddings that means roughly **16x compression**, vectors squeezed down to 2 or 4 bits each.
## What makes it different
- **Online ingestion.** Add vectors and they're indexed. No training phase, no parameter tuning to babysit.
- **SIMD search.** Hand-written NEON (ARM) and AVX-512BW (x86) kernels do the scoring.
- **Filter at search time.** Id allowlists or slot bitmasks restrict results without over-fetching first.
- **Fully local.** No managed service, no network hop. The index is a file you `write()` and `load()`.
- **Framework integrations** for LangChain, LlamaIndex, Haystack, and Agno.
## How TurboQuant works
1. Normalize each vector to a unit direction.
2. Apply a random orthogonal rotation so coordinates follow predictable Beta distributions.
3. Calibrate per-coordinate, mapping empirical quantiles to canonical distributions.
4. Quantize with Lloyd-Max scalar buckets (4 for 2-bit, 16 for 4-bit).
5. Re-normalize lengths at scoring time to correct the quantization bias.
## Usage
```python
from turbovec import TurboQuantIndex
index = TurboQuantIndex(dim=1536, bit_width=4)
index.add(vectors)
scores, indices = index.search(query, k=10)
index.write("my_index.tv")
```
## Numbers worth keeping
- Recall within **0.2–1.9 points** of FAISS IndexPQ at R@1 across 2-bit/4-bit configs.
- ARM: **10–19% faster** than FAISS FastScan. x86: wins 4-bit by ~5%, slightly behind on 2-bit.
- `pip install turbovec`; Python >= 3.9; targets x86-64-v3 (AVX2) minimum with AVX-512 runtime detection.
- License: MIT. Latest version 0.8.0 (June 2026).
## References
- https://github.com/RyanCodrai/turbovec
- https://pypi.org/project/turbovec/
## Related
- [[TurboQuant]]
- [[FAISS]]
- [[Embeddings]]
- [[Semantic Search]]
- [[Vector Store]]
- [[Retrieval-Augmented Generation (RAG)]]
- [[AI Retrieval Patterns]]
- [[Cloudflare Vectorize]]
- [[qmd]]
- [[Rust]]