asg017 / sqlite-vss

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

Storing non-vector column in `vss0` virtual tables #20

Open asg017 opened 1 year ago

asg017 commented 1 year ago

Spinoff of #2.

Instead of storing "metadata" in a separate regular SQLite table, you should be able to store non-vector columns like integers, text, and dates inside the vss0 virtual table like so:

create virtual table vss_articles using vss0(
  headline_embeddings(384),
  description_embeddings(384),
  published_at date,
  newsroom text
);

That way you don't need to do weird JOINs to supplement your vector queries. Could also be used to simplify pre-filtering.

things to consider:

Other notes: