# turbovec

> A vector index built on TurboQuant, written in Rust with Python bindings

- Type: agent or tool
- Field: ML & AI
- Repository: https://github.com/RyanCodrai/turbovec
- GitHub stars: 17509
- Licence: MIT
- Language: Rust
- Last push: 2026-10-07
- Page: https://imutechz.in/agents/turbovec

## What it is
turbovec is an in-process vector index for Python and Rust that stores each vector at 2 or 4 bits per dimension using Google Research's TurboQuant, and searches the compressed form directly with SIMD kernels. It is aimed at developers who need fast, low-memory similarity search inside their own process rather than as a service. It has no training step, so vectors are searchable as soon as they are added.

## Features
- Stores vectors at 2 or 4 bits per dimension with TurboQuant
- Staged search scans one bit plane then rescores the shortlist exactly
- No training step or rebuilds; add and remove vectors online
- sync(path) writes only changes since the last call, crash-safe
- Filtered search via an id allowlist or bitmask
- IdMapIndex keys vectors by your own uint64 ids

## Best for
- Local semantic search over large embedding sets
- Memory-constrained vector search in Python or Rust
- Filtered retrieval by ACL, SQL predicate or time window
- Offline stacks paired with an open-source embedding model

## Pros
- Reports 7.8x smaller than float32 at 4-bit and 15.5x at 2-bit at matched recall
- Reports 4.4x FAISS FastScan speed at 4-bit and 2.2x at 2-bit on ARM and x86
- Runs in-process; nothing leaves your process
- Drop-in integrations for LangChain, LlamaIndex, Haystack and Agno

## Cons
- Inputs must be 2-D float32 arrays of shape (n, dim); other dtypes raise
- Scores are inner products, so vectors must be normalised for cosine similarity

## Install
```
pip install turbovec
```

## Usage
```
index = TurboQuantIndex(dim=1536, bit_width=4)
```

Tags: vector-search, vector-index, quantization, rust, python, embeddings, similarity-search, simd
