asg017 / sqlite-vss

A SQLite extension for efficient vector search, based on Faiss!
MIT License
1.59k stars 59 forks source link

Fix go cybertron #45

Closed mattn closed 1 year ago

mattn commented 1 year ago

image

asg017 commented 1 year ago

Thanks for contributing @mattn !

Just a heads up, all vss0 tables have a hidden distance column that, when vss_search() is used, contains the distance of the search query to the row's vector. So you don't need to calculate it yourself with vss_distance_linf(embedding, st_encode(?1))

with similar_matches as (
  select rowid, distance
  from vss_fruits
  where vss_search(embedding, st_encode(?1))
  limit 20
), final as (
  ...
)