| ▲ | RAG Is Simpler Than You Think(lighthousenewsletter.com) |
| 175 points by j0selit0 4 hours ago | 88 comments |
| |
|
| ▲ | usernametaken29 2 hours ago | parent | next [-] |
| 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. |
| |
| ▲ | josh_p 33 minutes ago | parent | next [-] | | I worked on getting an address database into elasticsearch years ago when it was still using modified tf-idf. Customers wanted FTS where a lot of the queries would be something like "100 First Ave, NY" or "200 2nd St, MN". It was one of the most fun projects I've worked on in my career so far. I got a learn a lot about how US and international addresses worked, so many edge cases, and got to really understand how customers were using the existing search to make sure they weren't adding any duplicates to the database. Token filters and synonyms were neat and figuring out the right indexing strategy was a lot of fun. It was a lot more work to get it right for most of the use-cases our customers had than just "throw it into ES and be done". That would probably have been fine for the 80/20 case, like you said, but I agree that the bulk of the work is going to be fine-tuning the search solution, whatever technology you're using. | | |
| ▲ | oever 14 minutes ago | parent [-] | | What's your opinion on nominatim? I find that it gives up quickly when there's one or two typos in an address. It nails your examples. |
| |
| ▲ | jameshart an hour ago | parent | prev | next [-] | | I think people also overestimate the need for full text search when the one doing the querying is an LLM. If your underlying data is structured records, like a customer database, while humans might not have time or skills to figure out that when they want to search by phone number they need to do a join from the contacts table to the users table and normalize the phone number to look up first, making it best to just surface phone numbers as part of the data that is full/text-indexed… an agent is quite happy to handcraft the right SQL to find records that match on a specific field, given the right SKILLS.md and schema information. Turning fuzzy searches into exact DB lookups is a great way LLMs can augment users. (Obviously this doesn’t apply to searching actual rich document data - for that, go all in on text search, embedding, etc) | |
| ▲ | bensyverson 7 minutes ago | parent | prev | next [-] | | Yes, and don’t forget, LLMs are very good at tagging, so it’s not even that painful to backfill the corpus. | |
| ▲ | quijoteuniv 19 minutes ago | parent | prev | next [-] | | On my last go at making my own rag i still got better results by collecting the data and uploading to a project in open(butclosed)ai. My own rag, used by an agent was giving poorer results, and even the agent prefered (derailed)to not use it and look for the info itself rather than using the rag | |
| ▲ | shay_ker 17 minutes ago | parent | prev | next [-] | | How long have "large scale RAG systems" really existed in the first place? I'm always surprised at this, given how new all this really is, relatively speaking. | |
| ▲ | mmargenot 20 minutes ago | parent | prev | next [-] | | And you get bm25 for free with so many modern setups! I do still love to experiment with tuning semantic search for your specific corpus via various kinds of embeddings, but bm25 is hard to beat. | |
| ▲ | lacedeconstruct 2 hours ago | parent | prev | next [-] | | I thought text search was always the first thing you try, then fuzzy search, then you go for RAG | | |
| ▲ | wongarsu an hour ago | parent | next [-] | | It's not like a simple embedding search takes that much longer to implement. Especially on short descriptions where you don't have to deal with chunking. And if you let an LLM write the code it's even less of a difference. Combine that with embedding search promising to solve all your search problems, and I understand why people often skip over full text search and go straight to embeddings | |
| ▲ | ozim an hour ago | parent | prev [-] | | I think Bitwarden implemented some vector search in their password search feature ... totally annoying it gives me back all kinds of stuff that I don't care. I want fuzzy search like 95% of time and then I might consider having additional list of things that can be suggested by vector search. | | |
| ▲ | gwerbin 13 minutes ago | parent | next [-] | | Bandcamp has had legendarily bad semantic search for as long as they've been around. It's often completely impossible to find an artist or album or song even when you type the exact name. | |
| ▲ | a1o 44 minutes ago | parent | prev [-] | | A good UI could do these and also exact match, give some point system to the results, then order them and perhaps use a bold highlight to reflect what parts of the input query reflected in each result. |
|
| |
| ▲ | clevergadget an hour ago | parent | prev | next [-] | | I don't know what level of quality is required for this site but RAG is trash its just trash. its magic beans. | |
| ▲ | kaon_2 2 hours ago | parent | prev [-] | | Can you elaborate? We have technicians searching in different languages. Also our knowledge base is often in different languages. I just don't see how full text search can work? Maybe in a problem space like a wiki where people always know what to search for? | | |
| ▲ | tantalor 2 hours ago | parent | next [-] | | FTS like Elasticsearch supports cross-language (also called multi-language) search. | |
| ▲ | jon-wood 2 hours ago | parent | prev [-] | | Instinctively this feels like a two phase problem - start with some machine translation into a single spoken language and index that, then when people are querying do the same thing. When returning search results show them in the original language. | | |
| ▲ | whilenot-dev 2 hours ago | parent | next [-] | | Why not create indexes for multiple languages, as that would also avoid double translation issues (e.g. GER [query] → ENG [index] → GER [document])? | |
| ▲ | kaon_2 2 hours ago | parent | prev [-] | | Yes we've tried. It works. But jargon is hard. RAG with embeddings works all the same. The LLM doesn't mind receiving sources in Italian, french and German, and then outputting the answer in Japanese while providing the verbatim German jargon term in brackets | | |
| ▲ | jameshart an hour ago | parent [-] | | Embedding search is effectively machine translation into a single common ‘language’ - embedding space - and then searching that; cleaner and less lossy than translating everything into English for searching, but harder to debug when it goes wrong. |
|
|
|
|
|
| ▲ | jillesvangurp an hour ago | parent | prev | next [-] |
| 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. |
|
| ▲ | jrochkind1 2 hours ago | parent | prev | next [-] |
| 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. |
| |
| ▲ | inigyou 6 minutes ago | parent | next [-] | | I'm Becoming AI-Blind: https://news.ycombinator.com/item?id=49386699 | |
| ▲ | Planktonne an hour ago | parent | prev | next [-] | | Your brain is incredibly adept at pattern recognition; it doesn't focus on LLM-generated text for the same reason it doesn't stare at wallpaper. We've all learnt that it's not really communication, and so can be dispensed with. | |
| ▲ | allexander 2 hours ago | parent | prev | next [-] | | In the same boat here. | |
| ▲ | EGreg 2 hours ago | parent | prev [-] | | It’s largely because LLMs are reaching for many different types of adjectives or verbs in the same sentence, in a jarring way. While embedding it in a confidently declarative sentence. Everything sounds like some profound insight, dialed to an 11, but written as poetry. Especially those headings. With the short sentences. | | |
| ▲ | allexander 2 hours ago | parent [-] | | I have to agree with you. Yet it is tiring, people don't even try anymore. |
|
|
|
| ▲ | Angostura 3 hours ago | parent | prev | next [-] |
| 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 |
| |
| ▲ | dotancohen 3 hours ago | parent | next [-] | | The audience for this piece is already very familiar with RAG. I don't want articles discussing e.g. OLED screens telling me what the acronym is - that would be a sign that the article is far below the level that I need. | | |
| ▲ | vaylian 2 hours ago | parent [-] | | A hyperlink to Wikipedia would have solved that issue. | | |
| ▲ | Lorean1 2 hours ago | parent [-] | | Maybe if a person can't even google RAG they are not the intended audience of that article. | | |
| ▲ | inigyou 4 minutes ago | parent | next [-] | | I thought this would be a useless search that brought up pictures of rags, but indeed, DDG delivers a full page of results about retrieval-augmented generation for the query "rag" | |
| ▲ | ninkendo an hour ago | parent | prev | next [-] | | When I hear stuff like this I always imagine going to a restaurant and asking the waitress for a menu and them replying “lol just google it”. It’s not that I can’t or don’t know how, it’s rather that the expectation should be that a website should… link you to the information it believes to be relevant background. It’s why it’s called a “web”, linking is a core concept. | | |
| ▲ | brazukadev 32 minutes ago | parent [-] | | > When I hear stuff like this I always imagine going to a restaurant and asking the waitress for a menu and them replying “lol just google it”. in this case there was a menu in the next empty table and you saw it but in place of getting it you want the waitress to get it for you. Which is a normal behavior but you could save your time by just getting the menu yourself. | | |
| ▲ | AshleyGrant a few seconds ago | parent [-] | | No. It isn't. With acronyms, there's often plenty of potential things it can stand for, and if the person doesn't know enough to know which one is the correct acronym, Googling it isn't going to help them. As OP said, simply providing a link to a Wikipedia article, or a glossary, helps widen the audience beyond "IFYKYK." The NWS knows this and automatically links to their glossary for both acronyms as well as jargon in their discussions. <-- See what I did there? What does NWS mean in this context? If only I had provided a link that would help you know. I very easily could have. I just didn't. |
|
| |
| ▲ | Zambyte 2 hours ago | parent | prev [-] | | Eh, a healthy web is a web. I enjoy my preferred search engine, but surfing the web is becoming a lost medium. | | |
| ▲ | tux3 an hour ago | parent [-] | | Hypermedia? In my hypertext markup language? That is so not Web 5.0. Best I can offer is a support widget that pops up and keeps trying to talk to you until you interract with it. |
|
|
|
| |
| ▲ | _joel 3 hours ago | parent | prev [-] | | For those times you need to Red Amber Green your BM25 |
|
|
| ▲ | refactor_master 3 hours ago | parent | prev | next [-] |
| 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. |
| |
| ▲ | usernametaken29 2 hours ago | parent | next [-] | | > embed everything the first time This assumes your text is small. Try embedding pdf reports - though luck. It surely won’t fit into most embeddings. I can think of many more examples: books, news articles, medical reports, insurance claims etc. they’re all too big to “index it all at once” | | |
| ▲ | robrorcroptrer 2 hours ago | parent | next [-] | | What about splitting bigger content into chunks before embedding? | | |
| ▲ | freakynit 41 minutes ago | parent [-] | | How are you gonna handle the relations that span across individual chunks... if a later chunk refers something from 2 chunks before using `it`, rather than proper name, how will you handle that? Because at query time, that later chunk would not match. |
| |
| ▲ | khalic 39 minutes ago | parent | prev [-] | | you won't get anything out of a whole book embedding anyway, even a structured page is too much |
| |
| ▲ | cpursley 3 hours ago | parent | prev [-] | | Yep, lock into some vendor from day 1. Great idea! | | |
| ▲ | orisho 3 hours ago | parent [-] | | Vendor lock in is 2025. Porting became trivial with LLMs advancing like they have. | | |
| ▲ | cpursley an hour ago | parent [-] | | What I'm saying is pick transportable tech from day 1 so you can easily move if they shut down, hike prices, decide they don't like you, etc. |
|
|
|
|
| ▲ | ivansavz 33 minutes ago | parent | prev | next [-] |
| Does anyone have experience using SMLs for RAG (either as query rewriter or as generator for the final answer)? I'd like to work with a corpus offline (internal university research data) and I'm hoping I can get everything done without the data leaving the premises. I guess the biggest bottleneck is going to be for the context window size which won't be able to fit too many result "hits." Any info or advice would be appreciated. |
|
| ▲ | Otterly99 an hour ago | parent | prev | next [-] |
| 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. |
|
| ▲ | respectattentio 28 minutes ago | parent | prev | next [-] |
| I believe embedding-based RAG, everybody is using, will end. As chips advance, you would use a big llm instead of word embedding for retrieval. It's much more accurate and extensive covering every topic. Still need ~2 years to be replaced. |
| |
|
| ▲ | 7734128 3 hours ago | parent | prev | next [-] |
| 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. |
| |
|
| ▲ | Wren_ops 19 minutes ago | parent | prev | next [-] |
| Agreed, simpler is almost always better. The hard part is resisting the urge to over-engineer it. |
|
| ▲ | seanspradlin0 28 minutes ago | parent | prev | next [-] |
| But over-engineering things is fun. RAG is one of those things where I can hyper optimize to an absolutely needless degree. |
|
| ▲ | bob1029 3 hours ago | parent | prev | next [-] |
| 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. |
| |
| ▲ | jrochkind1 2 hours ago | parent [-] | | An LLM wrote this comment, no? I'm curious your motivation for having an LLM write such a short comment instead of writing it yourself? | | |
| ▲ | pixelbro 2 hours ago | parent [-] | | I've not seen such a clipped cadence out of an LLM. I would not automatically suspect the GP. Maybe there's better ways to spend your time? | | |
| ▲ | jrochkind1 an hour ago | parent [-] | | Maybe people are just learning to write in that style LLMs learned to write from statistical people? "is where the capabilities become unbounded" is a weird thing to say and not really true. "is the end game", "add non determinism on top of non determinism", there are a lot of AI-isms in this short comment. But it's possible people are just learning to write this way now, I am curious if that's so too! As far as uses of time, you are engaging in this dialog too, if you find it not a good way to spend time I recommend ceasing! |
|
|
|
|
| ▲ | jankovicsandras 3 hours ago | parent | prev | next [-] |
| 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. |
|
| ▲ | nilirl 3 hours ago | parent | prev | next [-] |
| 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? |
| |
| ▲ | brabel 3 hours ago | parent | next [-] | | The whole embedding thing which converts “tokens” to vectors, which you then store in a vector database so that you can later query by vector distance, seems to be LLM specific technology, no? As far as I know the vectors look a lot like the weights in a LLM itself which is why the vector search also works with some level of intelligence. | | |
| ▲ | triangle 3 hours ago | parent | next [-] | | Vector embeddings predate LLMs. They have been used as far back as the early 2000s. They are a general machine learning technique, rather than LLM specific | | |
| ▲ | ozim an hour ago | parent [-] | | Unfortunately LLMs made vector search more popular so it seems like something LLM specific. What makes it worse, a lot of people in the thread equate vector search with RAG, whereas RAG is the name for anything that model can query so a user doesn't have to copy/paste feed it to the model manually like access to text files is RAG. |
| |
| ▲ | nilirl 3 hours ago | parent | prev | next [-] | | Sure and that's a new technique for indexing and querying. Where's the new design tension? Indexes always had to be monitored for freshness and queries have always needed cleaning or parsing. | |
| ▲ | KaseyKim 2 hours ago | parent | prev | next [-] | | right, it is the foundation of machine learning. | |
| ▲ | ewidar 3 hours ago | parent | prev [-] | | not really, vectorising text/books is old school ML by this point. at least to me that seems the same as https://en.wikipedia.org/wiki/Word2vec for e.g. | | |
| |
| ▲ | TudorAndrei 3 hours ago | parent | prev [-] | | It's just information retrieval packaged as something new. | | |
|
|
| ▲ | pioneerjeff an hour ago | parent | prev | next [-] |
| 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. |
|
| ▲ | trivet 35 minutes ago | parent | prev | next [-] |
| Start with BM25 and only add embeddings when keyword search actually fails you. Saves a lot of pain. |
|
| ▲ | gabosarmiento 2 hours ago | parent | prev | next [-] |
| 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. |
| |
| ▲ | autogn0me an hour ago | parent [-] | | It seems not many RAG compare themselves across the same benchmarks. https://ggozad.github.io/haiku.rag/ Does an ok job. The part I don’t see being discuss is the whole RL agents writing code to perform RAG queries. It’s one thing haiku-rag does that’s interesting and would like to know what other RAG have that agentic querying with benchmarks |
|
|
| ▲ | sangwook an hour ago | parent | prev | next [-] |
| Im curious whether the $10,000 figure includes unstated migration costs, since the raw embedding API cost under the earlier assumptions comes to $10. |
|
| ▲ | apavlinovic 3 hours ago | parent | prev | next [-] |
| 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" |
| |
| ▲ | dsego 3 hours ago | parent [-] | | You are right, now I noticed "Real talk" and "Why this is underrated" and I can't unsee it. | | |
| ▲ | 7734128 an hour ago | parent [-] | | They're absolutely right – and this is is why it's a load bearing observation that cuts to the heart of the issue. |
|
|
|
| ▲ | khalic 3 hours ago | parent | prev | next [-] |
| > Why this is more flexible than embeddings Oh boy... |
|
| ▲ | bewareofscams 41 minutes ago | parent | prev | next [-] |
| RAG is so 2024. |
|
| ▲ | jmutex 2 hours ago | parent | prev | next [-] |
| Chunk size matters way more than the retrieval model in my experience. Get that wrong and nothing else helps. |
|
| ▲ | simianwords 3 hours ago | parent | prev | next [-] |
| OT but its interesting that none of the harnesses today use embeddings but just simple grep. I would not have predicted this |
| |
| ▲ | imtringued 2 hours ago | parent [-] | | Ok? I'm not seeing how that is interesting, you're exclusively focusing on coding which requires precise substring locations. Google is basically almost entirely driven by embedding models now. | | |
| ▲ | simianwords 2 hours ago | parent [-] | | And why do you think coding didn’t benefit from embeddings? It was attempted many times and the industry gave up. I find this interesting because practically no one is doing RAG on thier personal data which is something I wouldn’t have expected. |
|
|
|
| ▲ | KaseyKim 2 hours ago | parent | prev | next [-] |
| 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? |
|
| ▲ | ufocia an hour ago | parent | prev [-] |
| Wow! Terrible layout. Shouldn't fully justify on a small screen. |