MyGit

asg017/sqlite-vec

Fork: 122 Star: 3440 (更新于 2024-08-28 19:34:16)

license: Apache-2.0

Language: C .

A vector search SQLite extension that runs anywhere!

最后发布版本: v0.1.0 ( 2024-08-01 18:09:39)

GitHub网址

sqlite-vec

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

Mozilla Builders logo

sqlite-vec is a Mozilla Builders project, with additional sponsorship from Fly.io , Turso, and 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 with Python PyPI
Node.js npm install sqlite-vec sqlite-vec with Node.js npm
Ruby gem install sqlite-vec sqlite-vec with Ruby Gem
Go go get -u github.com/asg017/sqlite-vec/bindings/go sqlite-vec with Go Go Reference
Rust cargo add sqlite-vec sqlite-vec with Rust Crates.io
Datasette datasette install datasette-sqlite-vec sqlite-vec with Datasette Datasette
rqlite rqlited -extensions-path=sqlite-vec.tar.gz sqlite-vec with rqlite rqlite
sqlite-utils sqlite-utils install sqlite-utils-sqlite-vec sqlite-vec with sqlite-utils sqlite-utils
Github Release GitHub tag (latest 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.

Mozilla Builders logo

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

最近版本更新:(数据更新于 2024-08-28 19:32:20)

2024-08-01 18:09:39 v0.1.0

2024-08-01 17:56:00 v0.1.0-alpha.1

2024-07-24 05:09:53 v0.0.1-alpha.37

2024-07-17 14:06:47 v0.0.1-alpha.36

2024-07-17 14:02:41 v0.0.1-alpha.35

2024-07-17 13:59:17 v0.0.1-alpha.34

2024-07-15 05:24:31 v0.0.1-alpha.33

2024-07-15 05:21:53 v0.0.1-alpha.32

2024-07-15 05:18:06 v0.0.1-alpha.31

2024-07-15 05:15:06 v0.0.1-alpha.30

主题(topics):

sqlite, sqlite-extension

asg017/sqlite-vec同语言 C最近更新仓库

2024-09-18 10:46:24 EdgeTX/edgetx

2024-09-16 04:44:29 valkey-io/valkey

2024-09-15 05:40:49 ValdikSS/GoodbyeDPI

2024-09-14 12:29:55 dbry/adpcm-xq

2024-09-13 02:27:05 alfiecg24/TrollInstallerX

2024-09-13 01:54:10 AuxXxilium/arc-modules