Ultra efficient vector extension for SQLite (marcobambini.substack.com)

🤖 AI Summary
sqlite-vector is a new, ultra‑efficient SQLite extension designed to make vector search fast, memory‑frugal and natural to use in ordinary SQL workflows. Rather than chasing billion‑scale benchmarks or heavy indexing schemes, the project optimizes a brute‑force approach with runtime‑selected, hardware‑specific distance kernels, support for quantization and preloading, and multiple data types (FLOAT32, FLOAT16, BFLOAT16, INT8, UINT8). Crucially, vectors live in regular tables (no special virtual tables) and can be queried via a helper like vector_quantize_scan, keeping queries simple and avoiding complex JOIN gymnastics. The extension is free for open‑source projects and aims to fill a gap left by existing tools (sqlite‑vss/Faiss integration issues, sqlite‑vec’s virtual‑table model, and libsql’s slow HNSW indexing). Benchmarks on an M1 Pro (100k vectors, d=384, FLOAT32, 30 MB memory cap) show practical gains: inserts ~50% faster than sqlite‑vec (563 ms vs 1179 ms) and plain full scans ~16% faster (56.7 ms vs 67.8 ms). With 8‑bit quantization, one‑time quantize took ~225 ms, quantized scan ~17.4 ms, and quantize+preload queries ~3.97 ms while using ~37 MB and achieving Recall@20 = 1.0 — roughly 17× faster than sqlite‑vec in this setup. For developers needing lightweight, fast vector search on laptops, phones or small servers (millions, not billions, of vectors), sqlite‑vector offers a pragmatic, low‑latency alternative that integrates naturally into existing SQLite applications.
Loading comments...
loading comments...