Get the latest tech news

Exact binary vector search for RAG in 100 lines of Julia


I wanted to experiment in how quickly precise RAG lookups could be performed with a binary vector space. Why binary? It turns out the accuracy is very similar to a full 32-bit vector.

I wanted to experiment in how quickly precise RAG lookups could be performed with a binary vector space. We might not need a fancy vector DB or the newest HSNW library (HNSW is approximate search anyway, we're doing exact). The point is there is more than 1 arithmetic unit, so we can conceivably do several additons or bit operations in the same clock cycle as long as they do not depend on each other.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of lines

lines

Photo of Julia

Julia

Photo of RAG

RAG

Related news:

News photo

Build Your Own React.js in 400 Lines of Code

News photo

Rust 1.78 Upgrade For Linux 6.10, Dropping In-Tree "alloc" Fork To Save ~10k Lines

News photo

RAG with PostgreSQL