AI GitHub
sqlite-vec for embedded vector search
Add vector retrieval to a SQLite-backed local application.
Key Takeaways
- The extension represents vector data in SQLite and exposes search through SQL.
- Check extension support in the SQLite library shipped with your application.
- Store a few thousand embeddings, run nearest-neighbor queries and measure speed on the device that will ship.
- Read the supported index and filtering behavior before assuming server-scale performance.
How it works
The extension represents vector data in SQLite and exposes search through SQL. It fits experiments where a document catalog and embeddings should travel together with a local app.
What you need
Check extension support in the SQLite library shipped with your application. Store vectors with the same dimension and encoding throughout the index.
What to try first
Store a few thousand embeddings, run nearest-neighbor queries and measure speed on the device that will ship. Check the size of the resulting database.
Repeat the test with the actual journal and storage settings of the app. A small benchmark that never updates records can hide write and packaging costs.
Where to look for failures
Read the supported index and filtering behavior before assuming server-scale performance. Validate extension loading in the deployment environment.
Related Franklin pages
Decide whether search belongs in your existing database or in an index inside the process. Compare operational needs such as persistence, filtering and updates as well as nearest-neighbor speed.
- Embed approximate nearest-neighbor search directly in an application or experiment. hnswlib for an in-process nearest-neighbor index
- Run exact and approximate vector queries alongside existing relational data. pgvector for embedding search in Postgres
For the role of the index in nearest-neighbor search, see Franklin’s glossary. Vector indexes
Project documentation
Try it for your workflow
Explore the project’s documentation for setup and usage, or save this page to a collection for later.
Read the project documentation ↗