https://github.com/asg017/sqlite-vec Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} asg017 / sqlite-vec Public * Notifications You must be signed in to change notification settings * Fork 41 * Star 2k Work-in-progress vector search SQLite extension that runs anywhere. License Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT 2k stars 41 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 36 * Pull requests 2 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights asg017/sqlite-vec This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 221 Commits .github .github benchmarks benchmarks bindings bindings examples examples scripts scripts site site tests tests .gitignore .gitignore LICENSE-APACHE LICENSE-APACHE LICENSE-MIT LICENSE-MIT Makefile Makefile README.md README.md VERSION VERSION reference.yaml reference.yaml sqlite-dist.toml sqlite-dist.toml sqlite-vec.c sqlite-vec.c sqlite-vec.h.tmpl sqlite-vec.h.tmpl tmp-static.py tmp-static.py View all files Repository files navigation * README * Apache-2.0 license * MIT license sqlite-vec [6874747073] An extremely small, "fast enough" vector search SQLite extension that runs anywhere! A successor to sqlite-vss Important sqlite-vec is a pre-v1, so expect breaking changes! * Store and query float, int8, and binary vectors in vec0 virtual tables * Written in pure C, no dependencies, runs anywhere SQLite runs (Linux/MacOS/Windows, in the browser with WASM, Raspberry Pis, etc.) * Pre-filter vectors with rowid IN (...) subqueries sqlite-vec is a Mozilla Builders project, with additional sponsorship from [f] Fly.io , [t] Turso, and [s] SQLite Cloud. See the Sponsors section for more details. Installing See Installing sqlite-vec for more details. Language Install More Info Python pip install sqlite-vec sqlite-vec PyPI with Python Node.js npm install sqlite-vec sqlite-vec npm with Node.js Ruby gem install sqlite-vec sqlite-vec Gem with Ruby go get -u github.com/ sqlite-vec Go asg017/sqlite-vec/ with Go Go Reference bindings/go Rust cargo add sqlite-vec sqlite-vec Crates.io with Rust datasette install sqlite-vec Datasette datasette-sqlite-vec with Datasette Datasette sqlite-utils install sqlite-vec sqlite-utils sqlite-utils-sqlite-vec with sqlite-utils sqlite-utils Github GitHub tag (latest Release SemVer pre-release) Sample usage .load ./vec0 create virtual table vec_examples using vec0( sample_embedding float[8] ); -- vectors can be provided as JSON or in a compact binary format insert into vec_examples(rowid, sample_embedding) values (1, '[-0.200, 0.250, 0.341, -0.211, 0.645, 0.935, -0.316, -0.924]'), (2, '[0.443, -0.501, 0.355, -0.771, 0.707, -0.708, -0.185, 0.362]'), (3, '[0.716, -0.927, 0.134, 0.052, -0.669, 0.793, -0.634, -0.162]'), (4, '[-0.710, 0.330, 0.656, 0.041, -0.990, 0.726, 0.385, -0.958]'); -- KNN style query select rowid, distance from vec_examples where sample_embedding match '[0.890, 0.544, 0.825, 0.961, 0.358, 0.0196, 0.521, 0.175]' order by distance limit 2; /* +-------+------------------+ | rowid | distance | +-------+------------------+ | 2 | 2.38687372207642 | | 1 | 2.38978505134583 | +-------+------------------+ */ Sponsors Development of sqlite-vec is supported by multiple generous sponsors! Mozilla is the main sponsor through the new Builders project. sqlite-vec is also sponsored by the following companies: Fly.io logo Turso logo SQLite Cloud logo As well as multiple individual supporters on Github sponsors! If your company interested in sponsoring sqlite-vec development, send me an email to get more info: https://alexgarcia.xyz See Also * sqlite-ecosystem, Maybe more 3rd party SQLite extensions I've developed * sqlite-rembed, Generate text embeddings from remote APIs like OpenAI/Nomic/Ollama, meant for testing and SQL scripts * sqlite-lembed, Generate text embeddings locally from embedding models in the .gguf format About Work-in-progress vector search SQLite extension that runs anywhere. Resources Readme License Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT Activity Stars 2k stars Watchers 48 watching Forks 41 forks Report repository Releases 39 v0.1.0: The first stable release of `sqlite-vec` Latest Aug 1, 2024 + 38 releases Packages 0 No packages published Contributors 3 * @asg017 asg017 Alex Garcia * @dleviminzi dleviminzi Daniel Levi-Minzi * @Adriankhl Adriankhl k.h.lai Languages * C 57.2% * Python 31.3% * Rust 2.5% * Makefile 2.3% * TypeScript 2.2% * Vue 1.4% * Other 3.1% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.