News for hackers. Stuff that matters.
Re:Haystack DB – 10x faster than FAISS with binary embedding... by fbdab103 on Monday April 29, 2024 @08:12PM (#40205820)
These are not bit vectors, but float64. I could probably convert to float32 to cut down the ram. This is a one time job, so no changes.

My initial attempt has been using the scikit-learn cosine similarity function[0] which lets you take a query matrix against a target one. The actual calculation is pretty fast and seems quite optimized (at least, I can see all of my cores max out when it does the calculation). Then I iterate across the results matrix, sorting for best matches, and record best seen to date.

[0] https://scikit-learn.org/stable/modules/generated/sklearn.me...

There are no comments on this comment yet.