top | item 40252194

(no title)

alexgarcia-xyz | 1 year ago

Ya you'll be able to do things like:

  SELECT 
    rowid,
    distance
  FROM vec_items
  WHERE rowid IN (SELECT rowid FROM ...)
    AND title_embeddings MATCH ?
  ORDER BY distance
  LIMIT 10
^ This would do a KNN style query, k=10, but only include results where the item's rowid is included in the (...) subquery. This is a half-measure for metadata filtering, by pre-filtering which items should be considered in the KNN search.

It's currently a bit slow, and not the best solution. Eventually there will be support for metadata column in vec0 tables, which with trickery should be much faster, but isn't planned for v0.1.0.

discuss

order

bendavis381|1 year ago

Nice. So if I understand correctly, pre-filtering means we'd get 10 results here if there are at least 10 returned from the subquery?