Remix.run Logo
roflcopter69 3 days ago

I think the whole field of vector databases is mostly just one huge misunderstanding. Most of you are not Google or any other big tech company so so won't have billions of embeddings.

It's crazy how people add bloat and complexity to their stuff just because they want to do medium scale RAG with ca. 2 million embeddings.

Here comes the punchline, you do not need a fancy vector database in this case. I stumbled over https://github.com/sqliteai/sqlite-vector which is a SQLite extension and I wonder why no one else did this before, but it simply implements a highly optimized brute force search over the vectors, so you get sub 100ms queries over millions of vectors with perfect recall. It uses dynamic runtime dispatch that makes use of the available SIMD instructions your CPU has. Turns out this might be all you need. No need for memory a memory hungry search index (like HNSW) or writing a huge index to disk (like DiskANN).

nojvek 2 days ago | parent | next [-]

There’s vss as duckdb extension too that builds a hnsw index.

https://github.com/duckdb/duckdb-vss

Since duckdb is already columnar, it goes brrrrr with single digit millisecond vector similarly lookups.

roflcopter69 2 days ago | parent | next [-]

Okay, bummer. No support for quantized datatypes yet and from the docs I cannot see anything that mentions fast brute force search. I personally don't need an index. But I see that https://github.com/unum-cloud/usearch which is used by duckdb-vss in turn uses https://github.com/ashvardanian/simsimd which should make a really fast exact vector similarity search possible. Am I missing something here?

roflcopter69 2 days ago | parent | prev [-]

Oh right, duckdb being columnar is the ultimate brrr factor for such a brute force vector similarity search. But doesn't using a HNSW index completely forfeit this potential advantage?

stevesimmons 3 days ago | parent | prev [-]

Might be all you need, except an open source licence:

> For production or managed service use, please contact SQLite Cloud, Inc for a commercial license.

graphGL 2 days ago | parent | next [-]

Try https://github.com/asg017/sqlite-vec - Apache 2, Mozilla backed!

roflcopter69 2 days ago | parent [-]

I'd be cautious. Project seems abandoned. And I wouldn't say it's one of those cases where a piece of software is just finished and doesn't need any changes.

roflcopter69 2 days ago | parent | prev [-]

Damn, you're right. That's a deal breaker for me at least.