{"id":26260886,"url":"https://github.com/jiacai2050/vsag-sqlite","last_synced_at":"2025-06-24T06:35:52.585Z","repository":{"id":268314453,"uuid":"898531761","full_name":"jiacai2050/vsag-sqlite","owner":"jiacai2050","description":"An vector search SQLite extension baked by VSAG.","archived":false,"fork":false,"pushed_at":"2024-12-16T08:36:27.000Z","size":20,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T07:05:17.534Z","etag":null,"topics":["knn","knn-search","sqlite","sqlite3","vector","vector-database","vector-search"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jiacai2050.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://liujiacai.net/donate/"]}},"created_at":"2024-12-04T15:05:12.000Z","updated_at":"2025-04-07T11:18:31.000Z","dependencies_parsed_at":"2024-12-16T01:31:51.019Z","dependency_job_id":"336b43a3-f60e-4145-8bb0-26f1e0dfa091","html_url":"https://github.com/jiacai2050/vsag-sqlite","commit_stats":null,"previous_names":["jiacai2050/vsag-sqlite"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fvsag-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fvsag-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fvsag-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fvsag-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiacai2050","download_url":"https://codeload.github.com/jiacai2050/vsag-sqlite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251658200,"owners_count":21622819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["knn","knn-search","sqlite","sqlite3","vector","vector-database","vector-search"],"created_at":"2025-03-13T23:17:21.835Z","updated_at":"2025-04-30T07:05:24.504Z","avatar_url":"https://github.com/jiacai2050.png","language":"Rust","funding_links":["https://liujiacai.net/donate/"],"categories":[],"sub_categories":[],"readme":"#+TITLE: vsag-sqlite\n#+DATE: 2024-12-04T22:55:37+0800\n#+LASTMOD: 2024-12-16T16:36:15+0800\n#+AUTHOR: Jiacai Liu\n\n[[https://github.com/jiacai2050/vsag-sqlite/actions/workflows/CI.yml][https://github.com/jiacai2050/vsag-sqlite/actions/workflows/CI.yml/badge.svg]]\n\nAn vector search SQLite extension baked by [[https://github.com/antgroup/vsag][VSAG]], a vector indexing library used for similarity search.\n\nThis extension provide a virtual table allowing users to add vectors to VSAG and do KNN style search. The schema of the virtual table is:\n\n#+begin_src sql\nCREATE TABLE vsag(id PRIMARY KEY, vec, distance)\n#+end_src\n* Usage\nExecute SQL below in sqlite:\n#+begin_src bash :results verbatim :exports results :wrap src sql\ncat test.sql\n#+end_src\n\n#+RESULTS:\n#+begin_src sql\n\n.load target/debug/libvsag_sqlite\n\nCREATE VIRTUAL TABLE test_table\nUSING vsag (dimension=3);\n\nINSERT INTO test_table (id, vec)\n    VALUES (1, '[1,2,3]'), (2, '[11,22,33]'), (3, '[111,232,333]');\n\n-- KNN style query\nSELECT\n    id,\n    distance\nFROM\n    test_table\nWHERE\n    vec MATCH '[1,2,4]';\n#+end_src\n\nIf everything works well, the =SELECT= will output:\n#+begin_src\n1|1.0\n2|1341.0\n3|173241.0\n#+end_src\n* Install\n** Prebuilt binaries\nGo to [[https://github.com/jiacai2050/vsag-sqlite/releases][release page]] to download latest prebuilt binary.\n\nAfter download, set =LD_LIBRARY_PATH= env to where you unzip it.\n** Build from source\nFirst install dependencies(tested on Ubuntu, other Linux distributions can refer to [[https://github.com/antgroup/vsag/blob/main/DEVELOPMENT.md][DEVELOPMENT.md]]):\n#+begin_src bash\nsudo apt install -y gfortran libomp-15-dev lcov\n#+end_src\n\nThen build this project:\n#+begin_src bash\ncargo build\n#+end_src\n\nAfter build, set =LD_LIBRARY_PATH= to tell sqlite where to find our so files:\n#+begin_src bash\nso_file=$(find target -name libvsag.so | head -n1)\ncp \"${so_file}\" ./target/debug\nexport LD_LIBRARY_PATH=./target/debug\n#+end_src\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiacai2050%2Fvsag-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiacai2050%2Fvsag-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiacai2050%2Fvsag-sqlite/lists"}