How to perform a multi-vector KNN search?
Author: mholtCreated Oct 11, 2024Updated May 14, 2026
Hello!
Thanks for the help in Discord. As requested, also asking here for public benefit.
If my users would like to find images similar to several selected images, instead of just one image, what is the best way to go about that?
I'm sure there are pros and cons to various approaches.
Maybe the simplest is to compute a centroid of the images' embeddings and then search using that one centroid vector.
Or maybe there's a way using a SQL query to combine multiple vectors and let sqlite-vec figure it out.
Thanks for any thoughts!
Source: asg017/sqlite-vec