logoalt Hacker News

RAG Is Simpler Than You Think

149 pointsby j0selit0today at 8:39 AM68 commentsview on HN

Comments

usernametaken29today at 10:41 AM

I worked on large scale RAG systems before and can say people vastly underestimate full text search and vastly overestimate embeddings. FTS is really easy, portable and scalable and gets you very far, the 80/20 rule applies. Embeddings appear to be nice and magic but when you really get into them you notice: semantic similarity isn’t as good as you think and certainly it won’t make everyone happy. You will inevitably end up having to re-embed more or different chunks of your text to accommodate more and more precise embedding search - at which point you’ll go the last mile and do reranking etc etc all the while having to support the operational burden of vector search. Then you turn around and build a search query with 500 keywords and sure it’s painful but it just works, accommodates all use cases, scales and is overall less annoying to maintain.

show 2 replies
jillesvangurptoday at 12:01 PM

RAG is basically good old information retrieval with LLMs doing the querying. This can include vector search but it works without that as well. Treating vector search as magic pixie dust that makes search great without effort is not necessarily going to work that well. Also, it can add a lot of cost and complexity to the equation. And if not tuned properly, you don't necessarily get good results.

The key thing with RAG is to get the right information in the context with as few queries as possible. That requires good recall (ensuring that if it is there it can be found with a reasonable query) and precision (ensuring the best stuff is on top and minimizing false positives).

With search, and by extension RAG, the principle of shit in, shit out applies. Most of what search teams did before AI and RAG is still the best way to optimize the experience with RAG. And if you mess that up, search is not going to be working that well and no amount of AI can compensate for that or only at great cost in tokens and time. So, having an ETL pipeline to pre-process what you index, testing & benchmarking search quality, etc. are all helpful.

The good news is that you don't need that much skills with agentic coding to build something half decent for this. This code almost writes itself. And even a little bit of effort on extracting structure before indexing can make a big difference.

Angosturatoday at 10:05 AM

I have a particular antipathy for articles too lazy to spell out acronyms on first use.

So: https://en.wikipedia.org/wiki/Retrieval-augmented_generation

show 2 replies
jrochkind1today at 11:11 AM

More LLM-generated text about LLMs.

Is anyone else actually finding it harder and harder to read LLM generated text? I find it quite tiring, my brain just does not want to get through it.

show 2 replies
Otterly99today at 12:07 PM

Althought I agree with the first point of the author that FTS is underrated in this new RAG-first framework, the whole article really hides all the problems with RAG-pipeline and kind of hand wave everything.

If you are building a RAG pipeline for your company and are struggling like me, I would recommend this author that has whole series on entreprise documents (start with the one from May 22nd): https://towardsdatascience.com/author/angela.shi/page/4/

Note: I am not the author, just got her article in my newsletter and found it useful.

refactor_mastertoday at 10:19 AM

Here’s an even simpler take: just embed everything the first time, then track what was changed. Use a cheap model to summarize and clean up the documents/chats with summary and keywords. Unless you have entire libraries of books to embed it’s going to be a few hundred dollars of API calls.

Then, throw it all in BigQuery. Handles all the vector stuff natively.

Sprinkle an agentic bot UI thing on top to make it appear all-knowing and magical.

I assume other vendors than Google have a similar batteries-included approach you can just plug in.

show 2 replies
pioneerjefftoday at 12:17 PM

What RAG means for AI is what a library means for human beings.

It's necessary and would be good for you if you want to learn something systematically.

But for most of the normal issues, we can not rely a lot on it.

7734128today at 9:52 AM

There have been many blogs like this over the last years.

Yes, embeddings are computationally heavy, but they are not at all complicated and they provide a lot of benefit.

90% of "document" based RAG projects should view semantic search with embeddings as their primary method.

It's very powerful and so easy to implement that you could try it out and discover whether performance would be an issue rather than trying to anticipate it.

show 1 reply
sangwooktoday at 12:02 PM

Im curious whether the $10,000 figure includes unstated migration costs, since the raw embedding API cost under the earlier assumptions comes to $10.

bob1029today at 10:20 AM

Agentic query rewrite on top of good old fashioned Lucene is the end game. This is effectively providing a lot of the same magic you get with the semantic approach. Allowing the agent to query the document store iteratively is where the capabilities become unbounded.

Embeddings and semantic search add non determinism on top of non determinism. This seems fundamentally cursed. Lexical is much easier to control, iterate and debug. The tools are incredibly mature. Your users will probably prefer it as well.

show 1 reply
gabosarmientotoday at 11:21 AM

I would like to see how each recipe performs against its corresponding evals. Some sort of ranking would be useful.

Everyone keeps posting articles about how to implement RAG, but I also wonder why there isn’t some sort of skill to help people create a simple retrieval plan, starting with the retrieval methods and connecting them with evals. This could show whether they actually improve the result and make retrieval simpler for any agent, instead of making people start from zero.

jankovicsandrastoday at 10:21 AM

If someone has a Postgres db and want very simple RAG:

https://github.com/jankovicsandras/plpgsql_bm25 BM25 search implemented in PL/pgSQL ( Unlicense / Public domain )

The repo includes also plpgsql_bm25rrf.sql : PL/pgSQL function for hybrid search ( plpgsql_bm25 + pgvector ) with Reciprocal Rank Fusion; and Jupyter notebook examples.

nilirltoday at 9:58 AM

Maybe I'm old but where exactly are the "dragons"?

How is RAG any different from the search systems we've been building before LLMs? Is it the sudden need for everyone to design a search API and engine that's driven this trend?

If so, I'd like to see more design patterns around existing search problems:

- Correcting or backtracking based on feedback.

- Measuring relevance.

- Comparison with task-based pre-written queries. Does every LLM task need a full blown search engine? Why not a tightly scoped domain API for data retrieval?

show 3 replies
apavlinovictoday at 10:06 AM

The article sounds like AI slop with some predictable tells like short punctual sentences, bizarre jargon, and titles like "Recipe 4: On-The-Fly Embedding (The Fresh Data Play)"

Can we not reward junk like this? Most of the sentences are incomprehensible and provide zero actual argumentation, it's just a list of "whats" with no "whys"

show 1 reply
khalictoday at 10:13 AM

> Why this is more flexible than embeddings

Oh boy...

jmutextoday at 11:14 AM

Chunk size matters way more than the retrieval model in my experience. Get that wrong and nothing else helps.

KaseyKimtoday at 11:15 AM

i want to ask that, if a user want to search sth, but he doesnt know the exact name(keywords), just some description. at this moment, whether the text serach fail?

simianwordstoday at 10:22 AM

OT but its interesting that none of the harnesses today use embeddings but just simple grep. I would not have predicted this

show 1 reply
ufociatoday at 12:11 PM

Wow! Terrible layout. Shouldn't fully justify on a small screen.

hizyyotoday at 12:04 PM

[flagged]

manganate06today at 11:46 AM

[flagged]

luciana1utoday at 11:47 AM

[flagged]

unicorn_platfortoday at 12:09 PM

[dead]

tobin1994today at 11:37 AM

[dead]

cloudooratoday at 9:57 AM

[dead]