{"data":{"slug":"ryancodrai-turbovec","name":"turbovec","tagline":"A vector index built on TurboQuant, written in Rust with Python bindings","github_url":"https://github.com/RyanCodrai/turbovec","owner":"RyanCodrai","repo":"turbovec","owner_avatar_url":"https://avatars.githubusercontent.com/u/10856497?v=4","primary_language":"Rust","stars":14822,"forks":1329,"topics":["ann","avx512","embedding","embeddings","faiss","nearest-neighbor","neon","python","quant","quantization","rag","rust","simd","turboquant","vector-search"],"archived":false,"github_pushed_at":"2026-08-18T05:17:55+00:00","maintenance_label":"Very active","stars_delta_30d":1320,"url":"https://www.graphcanon.com/tools/ryancodrai-turbovec","markdown_url":"https://www.graphcanon.com/tools/ryancodrai-turbovec.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/ryancodrai-turbovec","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=ryancodrai-turbovec","description":"A vector index built on TurboQuant, written in Rust with Python bindings","homepage_url":"https://pypi.org/project/turbovec/","license":"MIT","open_issues":17,"watchers":64,"ai_summary":"turbovec is a Rust-based vector indexing library offering significant memory savings and fast SIMD search capabilities. Built on Google Research's TurboQuant algorithm, it supports efficient online ingest and filtering at search time without external managed services.","readme_excerpt":"<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/RyanCodrai/turbovec/main/docs/header.png\" alt=\"turbovec — Google's TurboQuant for vector search\" width=\"100%\">\n</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/RyanCodrai/turbovec/blob/main/LICENSE\"><img src=\"https://img.shields.io/pypi/l/turbovec\" alt=\"License\"></a>\n  <a href=\"https://pypi.org/project/turbovec/\"><img src=\"https://img.shields.io/pypi/v/turbovec?label=pypi&color=blue\" alt=\"PyPI version\"></a>\n  <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>\n  <a href=\"https://arxiv.org/abs/2504.19874\"><img src=\"https://img.shields.io/badge/paper-arXiv-b31b1b.svg\" alt=\"TurboQuant paper\"></a>\n</p>\n\n---\n\n**A 10 million document corpus takes 31 GB of RAM as float32. turbovec fits it in 4 GB - and searches it faster than FAISS.**\n\nturbovec 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.\n\n- **Online ingest.** Add vectors, they're indexed — no train step, no parameter tuning, no rebuilds as the corpus grows.\n- **Fast SIMD search.** Hand-written kernels — NEON SDOT/SMMLA on ARM, AVX-512 VNNI and `vpermb` on x86, with AVX2 and scalar fallbacks — beat FAISS IndexPQFastScan in every measured config, averaging 3.4× at 4-bit and 23% at 2-bit across the eight cells of each width, on both architectures.\n- **Incremental saves.** `sync(path)` persists just what changed since the last sync — one fsync per call, crash-safe at any byte, and a removal or a small append costs milliseconds however large the index. `write`/`load` stay for whole-file snapshots.\n- **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.\n- **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.\n\nBuilding RAG where privacy, memory, or latency matters? **You're in the right place.**\n\n## Python\n\n```bash\npip install turbovec\n```\n\n```python\nfrom turbovec import TurboQuantIndex\n\nindex = TurboQuantIndex(dim=1536, bit_width=4)\nindex.add(vectors)\nindex.add(more_vectors)\n\nscores, indices = index.search(query, k=10)\n\nindex.write(\"my_index.tv\")\nloaded = TurboQuantIndex.load(\"my_index.tv\")\n\nindex.sync(\"my_index.tv\")   # after more changes: durable incremental save\n```\n\n`vectors` and `query` are 2-D `float32` arrays of shape `(n, dim)` — other dtypes are rejected rather than silently converted, so cast with `np.asarray(x, dtype=np.float32)` first if needed.\n\nNeed stable ids that survive deletes? Use `IdMapIndex`:\n\n```python\nimport numpy as np\nfrom turbovec import IdMapIndex\n\nindex = IdMapIndex(dim=1536, bit_width=4)\nindex.add_with_ids(vectors, np.array([1001, 1002, 1003], dtype=np.uint64))\n\nscores, ids = index.search(query, k=10)   # ids are your uint64 external ids\nindex.remove(1002)                         # O(1) by id\n\nindex.write(\"my_index.tvim\")\nloaded = IdMapIndex.load(\"my_index.tvim\")\n\nindex.sync(\"my_index.tvim\")   # durable incremental save, ids included\n```\n\n### Hybrid retrieval (filtered search)\n\nRestrict results to a candidate set produced by another system (SQL, BM25, ACL, time window, …):\n\n```python\nimport numpy as np\nfrom turbovec import IdMapIndex\n\nidx = IdMapIndex(dim=1536, bit_width=4)\nidx.add_with_ids(vectors, ids)\n\n# Stage 1: external system narrows to candidate ids.\nallowed = np.array(db.execute(\"SELECT id FROM docs WHERE tenant=?\", (t,)).fetchall(),\n                   dtype=np.uint64)\n\n# Stage 2: dense rerank within the candidate set.\nscores, ids = idx.search(query, k=10, allowlist=allowed)\n```\n\nFiltering happens inside the SIMD kernel at 32-vector block granula","github_created_at":"2026-03-26T10:32:44+00:00","created_at":"2026-07-07T17:37:00.853364+00:00","updated_at":"2026-08-18T06:02:25.886475+00:00","categories":[{"slug":"vector-databases","name":"Vector Databases","url":"https://www.graphcanon.com/categories/vector-databases","markdown_url":"https://www.graphcanon.com/categories/vector-databases.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/vector-databases"}],"tags":[{"slug":"ann","name":"ann"},{"slug":"avx512","name":"avx512"},{"slug":"embedding","name":"embedding"},{"slug":"embeddings","name":"embeddings"},{"slug":"faiss","name":"faiss"},{"slug":"nearest-neighbor","name":"nearest-neighbor"},{"slug":"neon","name":"neon"},{"slug":"quantization","name":"quantization"}],"trust":{"provenance":{"is_fork":false,"github_id":1192555574,"owner_type":"User","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-18T06:02:25.173Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":0,"days_since_push":0,"last_release_at":null,"stars_delta_30d":1320,"open_issues_delta_30d":-14},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T11:08:35.861Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-18T06:02:25.592Z"},"languages":{"value":["rust"],"source":"github.language","observed_at":"2026-08-18T06:02:25.592Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-08-18T06:02:25.592Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["- Use turbovec when you need to save substantial amounts of memory; for instance, a 10 million document corpus can fit in 4 GB RAM instead of the typical 31 GB with float32.","- Optimize your implementation if latency is critical, as it provides faster SIMD search capabilities compared to FAISS on specific hardware architectures (i.e., ARM).","- Utilize turbovec when working with RAG (Retrieval-Augmented Generation) systems where privacy constraints prevent the use of external managed services, and you require a fully air-gapped solution.","- Consider turbovec if real-time or near-real-time indexing is necessary, owing to its capability for online ingestion without needing prior training steps."],"when_not_to_use":["- Avoid using turbovec in environments where the hardware architecture does not support specific SIMD instructions (like NEON on ARM and AVX-512BW on x86), as this can lead to performance degradation.","- Do not use it if your application requires external managed services for vector indexing, as turbovec is designed for local deployments without data leaving the machine or VPC.","- Avoid if you require high precision beyond what 4-bit quantization (or lower bit-widths depending on the configuration) offers.","- Refrain from using turbovec in scenarios where the lack of a training phase leads to suboptimal performance, as it might not adapt well to certain datasets that benefit from such pre-processing."],"source":"enrich:decision_facts","observed_at":"2026-07-11T15:21:55.066Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"turbovec is a Rust-based vector indexing library with Python bindings that offers significant memory savings and fast SIMD search capabilities, built on Google Research's TurboQuant algorithm."}]}}