Hacker News
Faster Retrieval for Better, More Efficient RAG
armcat
|next
[-]
From my own experience, these learned methods from Apple, Spotify and others, are highly relevant to hyperscale only - when you are dealing with hundreds of millions of items to choose from (or more), and require super high relevance in the top-5. For all other use cases (up to a few million items) I found that just building a BM25 index, and giving the LLM a BM25 "search tool" and casting a "wide net" wins every single time compared to learned methods (though the latter are more publishable in recsys and icml).
[1] https://research.atspotify.com/2025/9/you-say-search-i-say-r...
totetsu
|root
|parent
|next
[-]
I've been experimenting with hybrid memory retrieval using SQLite FTS5/BM25 for lexical search and dense embeddings from Nomic Embed Text v1.5 (768D), all-MiniLM-L6-v2 (384D), and Qwen3-Embedding (0.6B), with NumPy cosine similarity, Matryoshka-style dimensional truncation (64D → 768D reranking), and optional graph-based candidate expansion. In one 40-query benchmark, combining retrieval channels improved candidate recall from 30/40 with compact vectors alone to 40/40, although Top-1 accuracy was only 33/40. Another metric I was looking at was number of final candidates found to filter. If its very high, you can get better accuracy, but at the expense of resource use, and it can also lead to worse accuracy if your tying to choose top result efficently.. it makes a needle in a needle stack.
fcarraldo
|root
|parent
|next
|previous
[-]
Funny, I did exactly this for my last RAG project. Works great for a small dataset.
freakynit
|root
|parent
|next
[-]
I have tried this by ingesting all of cloudflare's highly technical complex documents (more than 3000 A4 sized pages) and then comparing results with that of cloudflare's own chatbot in their dashboard.
In all cases my system either matched, or performed marginally better than cloudflare's own bot.
I do use a few more techniques though, but, not RDF triplets, and definitely no custom trained neural network.
bob1029
|root
|parent
|previous
[-]
I've been saying this for a while now. Lexical is approximately the same thing as semantic when a frontier LLM is driving the search terms.
mickeyp
|next
|previous
[-]
Most embedding/BERT models are far too small to truly grasp the nettles when an AI ask questions to them; and if you condition the AI to only search for really basic things, then... you're basically back to grep + regex.
You need to prune all manner of useless detritus that might gum up your matches like test files, documentation, and sidecars that semantically overlap or you're just going to match your tests. That's fine if you're building a document store for a business, but if you want a "one-and-done" solution for your codebase it's rarely good enough.
And if you do use a very large embedding model (which means it'll require running in the cloud as most company computers won't run it well), then... well, you're better off just using a language model as a subagent to scout ahead for you and elide the embedding model to begin with.
comandillos
|next
|previous
[-]
refactor_master
|root
|parent
|next
[-]
lavendermon
|next
|previous
[-]
I enjoy watching the slow burn approach Apple is deploying as they quietly gear up to offer some % of local inference on iPhones to provide most of the AI services consumers want. Local inference could enable a very low price point for AI services that Apple would leverage alongside their massive ecosystem advantages and privacy claims to compete very effectively for personal assistant AI subscriptions.
QuantumNomad_
|root
|parent
|next
[-]
Didn’t Apple sort of already enter this market early-on with their subpar Siri?
I’ve been an iPhone and MacBook Pro user for years, but each time when I set up a new Apple device the first thing I do is say no to anything Siri, and also turning off additional Siri related settings. To the best of my knowledge, Siri is worse than useless, and I haven’t regretted staying away from it.
elpakal
|root
|parent
|next
|previous
[-]
An on-device, 100% private AI assistant seems like it could be so big that it could be a legitimate threat to the frontier model providers they are partnering with right now, imho.
andriy_koval
|root
|parent
|next
[-]
bet could be that this space will be commoditized: many good enough open weight models and multiple competing provides.
makmanalp
|root
|parent
|previous
[-]
That said in a pinch they could also acquire / acquihire both of those companies without much thought.
brrrrrm
|next
|previous
[-]
"why not use grep?"
jillesvangurp
|root
|parent
|next
[-]
For ranked searches, you can do more than one and combine their results. Reciprocal rank fusion (RRF) is a common approach to do that. A simple ranked lexical query and one or more vector searches. Can be combined to amplify results that perform well across multiple of these.
RRF is really easy: for each search result, take its position in each ranked list, add 60, and divide 1 by that number. Add up those values across all lists to get the final score. Results that rank highly in multiple lists get higher scores. The magical number of 60 dampens the effect of highly ranked results biasing the outcome to much. It's not going to be a good approach for all data sets. But it works surprisingly well and it's stupidly easy to implement.
For term search, expending some AI and other cleverness at indexing time to e.g. calculate categorizations is very helpful. If you can reduce your result set with some simple term searches, it might be small enough to pass to an LLM directly and skip ranked searches entirely. Using vector search as magic pixie dust is generally going to work a lot better if you can filter and combine it with a lexical search. Using e.g. a decision model at index time to calculate some categorizations and classifications is relatively cheap and easy relative to calculating vector embeddings.
mejutoco
|root
|parent
|next
|previous
[-]
goldenarm
|root
|parent
|next
|previous
[-]
ozkatz
|root
|parent
|next
[-]
jdthedisciple
|root
|parent
[-]
still doesn't include typo'ed variants for any of these
ozkatz
|root
|parent
[-]
everforward
|root
|parent
|next
[-]
I think we're verging on the point where people will care more about the most token-efficient ways to do a task than the lowest human effort version. Humans are expensive, humans using half as many tokens are cheaper.