Use
sqlite-vec when you need a lightweight, embedded solution for vector similarity search. It is ideal for applications that require vector data handling on-device or at the edge, such as mobile apps, IoT devices, or local AI model inference.pip install sqlite-vec import sqlite3 import sqlite_vec from sqlite_vec import serialize_float32 db = sqlite3.connect(":memory:") db.enable_load_extension(True) sqlite_vec.load(db) db.enable_load_extension(False) embedding = [0.1, 0.2, 0.3, 0.4] result = db.execute('SELECT vec_length(?)', [serialize_float32(embedding)]) print(result.fetchone()[0]) # Outputs: 4
For NumPy arrays, cast to 32-bit floats with
.astype(np.float32)Introducing sqlite-vec v0.1.0: a vector search SQLite extension that runs everywhere
Install with Python, Node.js, Deno, Bun Rust, Go, C, WASM...
https://alexgarcia.xyz/blog/2024/sqlite-vec-stable-release/index.html


Seonglae Cho