---
title: "turbovec"
type: "tool"
slug: "ryancodrai-turbovec"
canonical_url: "https://www.graphcanon.com/tools/ryancodrai-turbovec"
github_url: "https://github.com/RyanCodrai/turbovec"
homepage_url: "https://pypi.org/project/turbovec/"
stars: 12594
forks: 1117
primary_language: "Python"
license: "MIT"
categories: ["data-retrieval", "vector-databases"]
tags: ["embeddings", "neon", "python", "nearest-neighbor", "embedding", "avx512", "faiss", "ann"]
updated_at: "2026-07-07T18:31:45.200396+00:00"
---

# turbovec

> A vector index built on TurboQuant with Rust and Python bindings

turbovec is a vector index designed for efficient storage and fast retrieval of embeddings, particularly beneficial in scenarios where memory or latency constraints are critical. It supports online ingestion, SIMD-optimized search operations, allows filtering at search time, and ensures data remains within the local environment.

## Facts

- Repository: https://github.com/RyanCodrai/turbovec
- Homepage: https://pypi.org/project/turbovec/
- Stars: 12,594 · Forks: 1,117 · Open issues: 12 · Watchers: 59
- Primary language: Python
- License: MIT
- Last pushed: 2026-06-10T18:07:32+00:00

## Categories

- [Data & Retrieval](/categories/data-retrieval.md)
- [Vector Databases](/categories/vector-databases.md)

## Tags

embeddings, neon, python, nearest-neighbor, embedding, avx512, faiss, ann

## Related tools

- [transformers](/tools/huggingface-transformers.md) - 🤗 Transformers: the model-definition framework for state-of-the-art machine learning models (★ 162,347)
- [langflow](/tools/langflow-ai-langflow.md) - Langflow is a powerful platform for building and deploying AI-powered agents and workflows. (★ 151,298)
- [firecrawl](/tools/firecrawl-firecrawl.md) - The API to search, scrape, and interact with the web at scale. (★ 147,117)
- [PaddleOCR](/tools/paddlepaddle-paddleocr.md) - PaddleOCR: A powerful OCR toolkit for transforming PDFs/images into structured data (★ 84,919)
- [graphify](/tools/graphify-labs-graphify.md) - AI coding assistant skill that transforms various file types into a queryable knowledge graph (★ 79,371)
- [worldmonitor](/tools/koala73-worldmonitor.md) - Real-time global intelligence dashboard. (★ 61,516)
- [llm-app](/tools/pathwaycom-llm-app.md) - Ready-to-run cloud templates for RAG, AI pipelines, and enterprise search with live data. (★ 59,097)
- [meilisearch](/tools/meilisearch-meilisearch.md) - Meilisearch is a lightning-fast search engine API that brings AI-powered hybrid search to your sites and applications. (★ 58,448)

## README (excerpt)

```text
<p align="center">
  <img src="docs/header.png" alt="turbovec — Google's TurboQuant for vector search" width="100%">
</p>

<p align="center">
  <a href="https://github.com/RyanCodrai/turbovec/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/turbovec" alt="License"></a>
  <a href="https://pypi.org/project/turbovec/"><img src="https://img.shields.io/pypi/v/turbovec?label=pypi&color=blue" alt="PyPI version"></a>
  <a href="https://crates.io/crates/turbovec"><img src="https://img.shields.io/crates/v/turbovec?label=crates.io&color=blue" alt="crates.io version"></a>
  <a href="https://arxiv.org/abs/2504.19874"><img src="https://img.shields.io/badge/paper-arXiv-b31b1b.svg" alt="TurboQuant paper"></a>
</p>

---

**A 10 million document corpus takes 31 GB of RAM as float32. turbovec fits it in 4 GB - and searches it faster than FAISS.**

turbovec is a Rust vector index with Python bindings, built on Google Research's [**TurboQuant**](https://arxiv.org/abs/2504.19874) algorithm — a data-oblivious quantizer with near-optimal distortion and no separate training phase.

- **Online ingest.** Add vectors, they're indexed — no train step, no parameter tuning, no rebuilds as the corpus grows.
- **Fast SIMD search.** Hand-written NEON (ARM) and AVX-512BW (x86) kernels beat FAISS IndexPQFastScan by 10–19% on ARM; on x86 they win the 4-bit configs and trail by a few percent on 2-bit.
- **Filter at search time.** Pass an id allowlist (or a slot bitmask) to `search()` and the kernel honours it directly. You always get up to `k` results from the allowed set — no over-fetching, no recall hit on selective filters.
- **Pure local.** No managed service, no data leaving your machine or VPC. Pair with any open-source embedding model for a fully air-gapped RAG stack.

Building RAG where privacy, memory, or latency matters? **You're in the right place.**

## Python

```bash
pip install turbovec
```

```python
from turbovec import TurboQuantIndex

index = TurboQuantIndex(dim=1536, bit_width=4)
index.add(vectors)
index.add(more_vectors)

scores, indices = index.search(query, k=10)

index.write("my_index.tv")
loaded = TurboQuantIndex.load("my_index.tv")
```

Need stable ids that survive deletes? Use `IdMapIndex`:

```python
import numpy as np
from turbovec import IdMapIndex

index = IdMapIndex(dim=1536, bit_width=4)
index.add_with_ids(vectors, np.array([1001, 1002, 1003], dtype=np.uint64))

scores, ids = index.search(query, k=10)   # ids are your uint64 external ids
index.remove(1002)                         # O(1) by id

index.write("my_index.tvim")
loaded = IdMapIndex.load("my_index.tvim")
```

### Hybrid retrieval (filtered search)

Restrict results to a candidate set produced by another system (SQL, BM25, ACL, time window, …):

```python
import numpy as np
from turbovec import IdMapIndex

idx = IdMapIndex(dim=1536, bit_width=4)
idx.add_with_ids(vectors, ids)

# Stage 1: external system narrows to candidate ids.
allowed = np.array(db.execute("SELECT id FROM docs WHERE tenant=?", (t,)).fetchall(),
                   dtype=np.uint64)

# Stage 2: dense rerank within the candidate set.
scores, ids = idx.search(query, k=10, allowlist=allowed)
```

Filtering happens inside the SIMD kernel at 32-vector block granularity: blocks with no allowed slots are short-circuited before any LUT lookup or scoring work, and individual non-allowed slots inside scored blocks are dropped at heap-insert. Selective allowlists (small fraction of the index allowed) therefore avoid most of the SIMD cost rather than paying it and discarding the result afterwards.

The output length is `min(k, len(allowed))` — when the allowlist is smaller than `k` you get exactly `len(allowed)` results rather than padded fallbacks.

See [`docs/api.md`](docs/api.md) for the full reference.

### Framework integrations

Drop-in replacements for the in-tree reference vector / document stores in each framework. Same public surface, same persistence semantics, same retriever and pipeline wiring — s
```

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/tools/ryancodrai-turbovec`](/api/graphcanon/tools/ryancodrai-turbovec)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
