Repo of the Day
asg017/sqlite-vec
Published: Mar 13, 2026
Open repository ↗A vector search SQLite extension that runs anywhere!
Summary
sqlite-vec is a SQLite extension written in pure C that adds vector search directly to SQLite databases. It supports storing and querying float, int8, and binary vectors inside vec0 virtual tables, and runs on Linux, macOS, Windows, Raspberry Pi, and in the browser via WASM. The project is explicitly pre-v1, so breaking changes are expected.
What it is useful for
For engineers already using SQLite, sqlite-vec lets you add nearest-neighbor search to existing data without standing up a separate vector database. Practical uses include local semantic search over embeddings, similarity lookups for recommendations, and similarity-based deduplication, where keeping vectors next to their metadata in a single SQL file simplifies deployment.
The README demonstrates the pattern directly. You create a virtual table like create virtual table vec_examples using vec0(sample_embedding float[8]), insert rows with vector literals expressed as JSON arrays, and then query with the match keyword to retrieve the closest rows ordered by distance. Because the extension is pure C with no dependencies, it fits environments where pulling in a heavier stack is inconvenient, such as edge devices or in-browser SQLite.
The README also notes that non-vector data can be stored alongside vectors in metadata, auxiliary, or partition key columns, which is useful when you need to filter results.
How engineers can use it
The README lists install commands for several languages. Python uses pip install sqlite-vec, Node.js uses npm install sqlite-vec, Ruby uses gem install sqlite-vec, Go uses go get -u github.com/asg017/sqlite-vec/bindings/go, and Rust uses cargo add sqlite-vec. Tooling integrations include Datasette (datasette install datasette-sqlite-vec) and rqlite (rqlited -extensions-path=sqlite-vec.tar.gz).
In SQL the documented flow is to load the extension (.load ./vec0), create the vec0 virtual table, insert vectors as JSON or a compact binary format, and run a KNN-style query such as select rowid, distance from vec_examples where sample_embedding match '<...>' order by distance limit 2;. Setup details beyond these commands (including WASM browser builds) are documented in the language-specific guides linked from the README, so consult those for environment-specific steps.