48 comments

  • usernametaken296 hours ago
    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_p4 hours ago
      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 &quot;100 First Ave, NY&quot; or &quot;200 2nd St, MN&quot;.<p>It was one of the most fun projects I&#x27;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&#x27;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.<p>It was a lot more work to get it right for most of the use-cases our customers had than just &quot;throw it into ES and be done&quot;. That would probably have been fine for the 80&#x2F;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&#x27;re using.
      • oever4 hours ago
        What&#x27;s your opinion on nominatim? I find that it gives up quickly when there&#x27;s one or two typos in an address. It nails your examples.
    • jameshart5 hours ago
      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 <i>humans</i> 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&#x2F;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.<p>(Obviously this doesn’t apply to searching actual rich document data - for that, go all in on text search, embedding, etc)
    • _the_inflator1 hour ago
      RAG is art. I have a very straight forward setup that is highly modular.<p>RAG is routing and decision making.<p>I found so much joy in achieving the best results given the requirements than simply hoping for the best with the cool kid called vector db and embeddings.<p>I agree with you.<p>Depending on the context and required output I decide how to orchestrate a multitude of specialized modules that produce the best specific result to gain a universally usable system.<p>It maintains itself.<p>Also live updates need reruns and rebuilding certain indexes. Everything is highly dynamic but in a deterministic way.<p>I found my niche with RAG selling and I build them myself.<p>I take pride in them.<p>So many look at the technology but not on the required output. It takes hours of talking to people to get an idea of what they need.<p>And there are regulated businesses where certain information is required to be always factual correct - pricing for example.<p>Vector search becomes a liability for this use case.<p>So naturally you have to reconsider your system: mixing factual with probabilistic content and how to make sure, it hits always certain quality benchmarks and on the other hand doesn’t fail others.<p>I love this kind of stuff.<p>And there is personal information etc.<p>Using modules is the key. Orchestration is really fun but I have to admit, not for the faint of heart.<p>And ever changing parts: LLMs, or restrictions to be matched liked autonomously working - I love RAG.<p>It gave me back the joy of developing. In fact I never had so much phun before, because it is also “team work”: I am not programming, I am managing a product.<p>I was in Senior Management of a top tier international bank and besides that build the only ever working platform or IT transformation called dbCORE and overlooked 13 teams with 120 developers.<p>RAG gives me dbCORE vibes so to say.<p>Good luck and fun with your RAG systems.
    • andai3 hours ago
      Re: the rube goldberg machine of diminishing returns<p><a href="https:&#x2F;&#x2F;www.anthropic.com&#x2F;engineering&#x2F;contextual-retrieval" rel="nofollow">https:&#x2F;&#x2F;www.anthropic.com&#x2F;engineering&#x2F;contextual-retrieval</a><p>This is from two years ago, but I think it&#x27;s still SotA?
      • gardnr1 hour ago
        That is the approach I would take today. Late Interaction is worth a look. Evals are necessary.
    • IronyMan145 minutes ago
      I believe the second Suggestion solves 95% of my problems. I want a system where i can describe my search and the system generated 5-15 keywords for a query
    • lacedeconstruct6 hours ago
      I thought text search was always the first thing you try, then fuzzy search, then you go for RAG
      • EagnaIonat1 hour ago
        Even that is an oversimplification unless you are doing something very basic.<p>Volume of documents, size of documents, versioning, frequency of update, documents similar or overlapping information, how much or exactly what you need for the LLM to understand, AI friendly documents, who has access and at what level, blue teaming, red teaming, multi-lingual, does the LLM know the domain language of the user and documents.<p>I probably missed a few things even with that.
      • wongarsu5 hours ago
        It&#x27;s not like a simple embedding search takes that much longer to implement. Especially on short descriptions where you don&#x27;t have to deal with chunking. And if you let an LLM write the code it&#x27;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
      • j0selit02 hours ago
        I wish everyone thought like you, in my experience unfortunately it&#x27;s not the case
      • ozim5 hours ago
        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&#x27;t care.<p>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.
        • gwerbin4 hours ago
          Bandcamp has had legendarily bad semantic search for as long as they&#x27;ve been around. It&#x27;s often completely impossible to find an artist or album or song even when you type the exact name.
        • t_mahmood2 hours ago
          ahh now I realize why I get so much completely irrelevant search results in many sites recently. I mean I&#x27;m searching for betel and you&#x27;re giving me nuts. haha
        • a1o5 hours ago
          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.
    • mmargenot4 hours ago
      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.
    • piterrro1 hour ago
      RAG only makes sense if you have an LLM review the results, pick the most relevant ones and iterate further if there&#x27;s a need running another query and repeating the process. Raw dump of vector search (even with reranking) is asking for troubles (or rather weird user questions like &#x27;why this crap popped up in the results?&#x27;)
    • mdp20214 hours ago
      &gt; <i>people vastly underestimate full text search</i><p>It is not psychological, it is fully justified: substring search cannot find synonyms, periphrases and mistaken neighbours.
      • andy992 hours ago
        Maybe I’m interpreting this differently but to me modern LLM+full text search means “agentic” - LLM gets to pick the search terms and iterate on them. The underlying LLM does know synonyms etc, better and more flexibly than an embedding model, and gets explainable feedback from failed searches.
      • locknitpicker3 hours ago
        &gt; It is not psychological, it is fully justified: substring search cannot find synonyms, periphrases and mistaken neighbours.<p>It is, if people don&#x27;t even stop to think if they need synonyms, periphrases, or mistaken neighbours.<p>As the blog post points out, more often than not you don&#x27;t, particularly if your primary usecase is to search for technical keywords or codenames.
        • lopsotronic2 hours ago
          Precisely this. The people in charge of technical direction don&#x27;t understand the fundamentals of the technology. So you get the idea that LLMs can help make sense of parts data. Which . . . no, no it really can&#x27;t, not without ALSO plugging in basically every other hunk of natural language you might have laying around. Unless you think PLG HT HFI is just a natural synonym of HOT PLUG INJECTOR, in which case you&#x27;re just quantitatively wrong.<p>Vectors and LLMs are great, but there&#x27;s no magic pill here. If your parts data and config management[1] is all crazy, that&#x27;s an institutional problem. Buying a crapton of tokens isn&#x27;t fixing it, unless you&#x27;re using it to help build an actual formal solution based on good fundamentals.<p>[1] Such as it is.
        • dominotw2 hours ago
          &gt; particularly if your primary usecase is to search for technical keywords or codenames.<p>i dont believe ppl are building rag for this
    • shay_ker4 hours ago
      How long have &quot;large scale RAG systems&quot; really existed in the first place? I&#x27;m always surprised at this, given how new all this really is, relatively speaking.
    • kaon_26 hours ago
      Can you elaborate? We have technicians searching in different languages. Also our knowledge base is often in different languages. I just don&#x27;t see how full text search can work? Maybe in a problem space like a wiki where people always know what to search for?
      • tantalor5 hours ago
        FTS like Elasticsearch supports cross-language (also called multi-language) search.
      • jon-wood6 hours ago
        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-dev5 hours ago
          Why not create indexes for multiple languages, as that would also avoid double translation issues (e.g. <i>GER [query] → ENG [index] → GER [document]</i>)?
        • kaon_25 hours ago
          Yes we&#x27;ve tried. It works. But jargon is hard. RAG with embeddings works all the same. The LLM doesn&#x27;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
          • jameshart5 hours ago
            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.
    • quijoteuniv4 hours ago
      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
      • idontneedcoffee4 hours ago
        I would be really grateful if someone could battle-test my frankendb in a full-fledged RAG setup(lmdb + roaring bitmaps + to-be-removed lance with a bitmap-based virtual fs-like tree on top of your data) outside of its original narrow use-case (index for user data + workflows)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;canvas-ui&#x2F;canvas-synapsd" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;canvas-ui&#x2F;canvas-synapsd</a>
    • bensyverson4 hours ago
      Yes, and don’t forget, LLMs are very good at tagging, so it’s not even that painful to backfill the corpus.
    • clevergadget5 hours ago
      I don&#x27;t know what level of quality is required for this site but RAG is trash its just trash. its magic beans.
  • seamossfet8 minutes ago
    I notice a lot of these AI written articles share this pattern where they&#x27;ll present idea 1, then idea 2, and finally idea 3 which is some amalgamation of idea 1 and 2. Claude especially will present hybrid options and compromises to avoid having to make a choice then framing the hybrid option as the &quot;best of both worlds&quot; when they&#x27;re borderline nonsensical.<p>&quot;on the fly embedding&quot; and &quot;Sparse + dense reranking&quot; don&#x27;t really make sense how they&#x27;re presented and smell like they came from a long claude-driven conversation after multiple cycles of these hybrid compromises across many turns.
  • jillesvangurp5 hours ago
    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&#x27;t necessarily get good results.<p>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).<p>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 &amp; benchmarking search quality, etc. are all helpful.<p>The good news is that you don&#x27;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.
    • dmix2 hours ago
      &gt; With search, and by extension RAG, the principle of shit in, shit out applies<p>Similar to SEO on marketing pages, we started rewriting product docs around the idea that it will be consumed by a RAG. Mostly by putting a lot of focus on well structured headlines, thinking more carefully about technical terminology vs common human-language questions, occasionally using variations of keywords in the text, etc. This applies to pure LLM consumption too, not just hybrid search.<p>Once you start tracking what users are asking you learn to adapt the documentation around it. And LLMs can also suggest improvements by comparing questions vs search results vs LLM responses.
      • jillesvangurp41 minutes ago
        It&#x27;s a start. Where it gets tricky is companies with years&#x2F;decades of highly unstructured data, duplicated documents, obsolete or draft versions of those documents, etc. And where it gets more tricky if the data is spread all over the place in weird tools, databases, spreadsheets, etc. that has some structure but is maybe a bit inconsistent, incomplete, or not that well documented.<p>If you flatten all that into plain text and then create embeddings, you are effectively throwing out the baby with the bathwater. But on the other hand if you put some effort into normalizing and extracting some structured meta data, you gain a flexibility to do more sophisticated querying that get you more precise results.<p>You can of course try to fix things at the source, which is a valid thing but usually not that practical when you have a lot of data to worry about.
  • jrochkind16 hours ago
    More LLM-generated text about LLMs.<p>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.
    • Planktonne5 hours ago
      Your brain is incredibly adept at pattern recognition; it doesn&#x27;t focus on LLM-generated text for the same reason it doesn&#x27;t stare at wallpaper.<p>We&#x27;ve all learnt that it&#x27;s not really communication, and so can be dispensed with.
    • cpdomina3 hours ago
      the biggest giveway is actually not the writing style, but the content<p>&quot;using GPT-4o-mini for query rewriting&quot; -&gt; model from 2024, when RAG was trendy, and all the langchain, llama-index, etc, docs mentioned this specific model
      • timedude2 hours ago
        GPT-4o-mini is still very relevant. It is a very capable model and very very fast and dirt cheap. Excellent for this type of stuff
      • j0selit02 hours ago
        author here. at most companies I&#x27;ve worked for recently (F500) RAG is still quite trendy. this was what frustrated me a bit and motivated to write this article - along with other experiences that definitely relate with some of the folks in the comments above
        • cpdomina52 minutes ago
          what I implied is that in 2024 a lot was written about RAG, LLMs were trained on it, and that explains your gpt-4o-mini reference. the argument is that the article is ai slop, and that point is totally unrelated to name dropping fortune 500s references
    • inigyou4 hours ago
      I&#x27;m Becoming AI-Blind: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49386699">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49386699</a>
    • EGreg6 hours ago
      It’s largely because LLMs are reaching for many <i>different</i> 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.
      • allexander6 hours ago
        I have to agree with you. Yet it is tiring, people don&#x27;t even try anymore.
    • alerighi3 hours ago
      Everything that is generate from a LLM is shit, I don&#x27;t know why people continue using it. I&#x27;m waiting for this bubble to explode once for all so we can return doing things in the sane way.
    • allexander6 hours ago
      In the same boat here.
  • alansaber3 hours ago
    I have built systems using all of these approaches (all in tandem). For the most part, the juice is not worth the squeeze (in building a highly optimised corpus-specific information retrieval strategy) outside of a very few fringe cases. The amount of technical discussion far outstrips the use case for RAG.
  • Angostura7 hours ago
    I have a particular antipathy for articles too lazy to spell out acronyms on first use.<p>So: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Retrieval-augmented_generation" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Retrieval-augmented_generation</a>
    • dotancohen6 hours ago
      The audience for this piece is already very familiar with RAG. I don&#x27;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.
      • triceratops44 minutes ago
        There&#x27;s a middle-ground where you write out ambiguous acronyms (&quot;rag&quot; is an English word) and not unambiguous ones (&quot;oled&quot; only has one commonly-used meaning).
      • Angostura2 hours ago
        I found the piece interesting, once I worked out what it was about. I strongly disagree that taking time to spell out acronyms should be taken as a signal that an article is low level.
        • arjie1 hour ago
          For people familiar with the field, it would be like if you had every article about hardware read “Intel Central Processing Units (CPUs) with modern Double Data Rate 5 (DDR5) Random Access Memory (RAM) can be coupled with Nvidia Graphics Processing Units (GPUs) to run Large Language Models (LLMs) that are stored on Solid State Disks (SSDs)”. Just rapidly becomes unreadable.<p>The acronym constraint was valid in a pre-LLM world but now you are perhaps 3 clicks in a modern browser from learning.<p>If I read an article that spelled out Random Access Memory I would definitely treat that as a lay article.
      • vaylian6 hours ago
        A hyperlink to Wikipedia would have solved that issue.
        • Lorean16 hours ago
          Maybe if a person can&#x27;t even google RAG they are not the intended audience of that article.
          • ninkendo5 hours ago
            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”.<p>It’s not that I can’t or don’t know how, it’s rather that the expectation should be that a website should… <i>link</i> you to the information it believes to be relevant background. It’s why it’s called a “web”, linking is a core concept.
            • serf1 hour ago
              given the audience and the venue I think it&#x27;s more like going to a restaurant as a customer and then asking the waiter to explain what a sandwich is.
            • brazukadev4 hours ago
              &gt; 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”.<p>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.
              • AshleyGrant4 hours ago
                No. It isn&#x27;t. With acronyms, there&#x27;s often plenty of potential things it can stand for, and if the person doesn&#x27;t know enough to know which one is the correct acronym, Googling it isn&#x27;t going to help them.<p>As OP said, simply providing a link to a Wikipedia article, or a glossary, helps widen the audience beyond &quot;IFYKYK.&quot;<p>The NWS knows this and automatically links to their glossary for both acronyms as well as jargon in their discussions. &lt;-- 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&#x27;t.
                • serf1 hour ago
                  &gt;As OP said, simply providing a link to a Wikipedia article, or a glossary, helps widen the audience beyond &quot;IFYKYK.&quot;<p>it also serves as a minimum barrier to entry for the masses, which isn&#x27;t always a bad thing.<p>if you&#x27;re reading this stuff, and you can&#x27;t figure out what kind of RAG that the search engine mentioned is being talked about through context clues, or you aren&#x27;t clever enough to feed context into the search like &#x27;hackers , computers, rag&#x27; as a query -- there is a <i>very</i> high probability that the person will have absolutely nothing constructive to add to the conversation that is about the topics they haven&#x27;t even yet conceptualized or are aware of.<p>in that case that slight barrier to entry for the conversation will serve as a tool to produce less work for the moderators and derail less threads into uselessness.<p>(much like this stupid divergence.)
                  • AshleyGrant51 minutes ago
                    &gt; it also serves as a minimum barrier to entry for the masses, which isn&#x27;t always a bad thing.<p>No. Lowering the barrier of entry to those who are trying, in earnest, to learn about a new topic, to broaden their base of knowledge is NEVER a bad thing. None of us were born with the knowledge to read this (or similar) article. Trying to kick the ladder down after you have climbed it is terrible behavior and absolutely must be discouraged and stopped at all costs.<p>&gt; much like this stupid divergence<p>The only thing stupid in this conversation is the insistence that folks who might know less than the author of the linked article or the poster do not deserve to have access to the information.
          • inigyou4 hours ago
            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 &quot;rag&quot;
            • mdp20214 hours ago
              We can confirm, RAG has been a very big thing in the past few years. It&#x27;s actually bewildering that it be new to some now - but we are also getting the vibe that some are living an &quot;&quot;AI&quot;-nausea&quot; that may be shielding them from some trends.
          • Zambyte5 hours ago
            Eh, a healthy web is a web. I enjoy my preferred search engine, but surfing the web is becoming a lost medium.
            • tux35 hours ago
              Hypermedia? In my hypertext markup language?<p>That is <i>so</i> 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.
        • redsocksfan456 hours ago
          [dead]
    • _joel7 hours ago
      For those times you need to Red Amber Green your BM25
  • refactor_master7 hours ago
    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&#x2F;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.<p>Then, throw it all in BigQuery. Handles all the vector stuff natively.<p>Sprinkle an agentic bot UI thing on top to make it appear all-knowing and magical.<p>I assume other vendors than Google have a similar batteries-included approach you can just plug in.
    • usernametaken296 hours ago
      &gt; embed everything the first time<p>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”
      • robrorcroptrer5 hours ago
        What about splitting bigger content into chunks before embedding?
        • freakynit4 hours ago
          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.
          • gf0003 hours ago
            Absolutely a novice in this topic, but I would imagine that by simply having sufficiently big chunks it&#x27;s simply not a problem? You surely have enough information in like a couple of paragraphs to denote in vector space roughly what it is about. So that both chunks would get found by a vector search, and then whatever is the logic it may put the whole original text of those chunks into context, but in any case enough so that an LLM can &quot;reason&quot; about the references in-between the two.
            • harlanji2 hours ago
              Chunks can only be as large as the embedding model’s token limit, about 512-1024 tokens usually. Anything longer gets truncated.<p>Natural language processing could expanded references, but it starts to get tricky. Do you use Graph RAG, embed another version of the chunk that is distinct from the full text version, etc.. Another layer of processing and data to keep in sync if the source dan be updated.
              • gf0001 hour ago
                (assuming English text)<p>512 tokens ≈ 350–400 words ≈ a long paragraph or two. 1024 tokens ≈ 700–800 words ≈ about a page and a half to two pages.<p>I would be <i>very</i> surprised if that amount of text is not enough to encode a general topic into the embedding (otherwise, what would be the whole point of them?).<p>So if there is a meaningful reference in C referring to A (assuming A-B-C consecutive 1-2 paragraphs), I would expect that the content of the two at least superficially resemble each other, and a vector query for one would return both. (And also, if I am including A in the context after retrieval, then I better give some context before-after as well -- and references tend to be local).<p>But feel free to prove me wrong, I&#x27;m mostly just guessing, not even an educated (in the given topic) guess here.
          • refactor_master3 hours ago
            Humans usually have ways around that in longer documents eg page numbers, paragraphs, links.<p>If someone gave me a report, in my hands, that said “see ‘it’” I’d also be confused.
        • mdp20214 hours ago
          What member freakynit said nearby about chunks and relations between chunks, plus the storage and information efficiency problem: make some calculations about storing vectors - for paragraphs and for collections of paragraphs -, then compare the needed space with the original data...<p>Because you could have clever ideas about vectors related to more paragraphs related in the document structure - but that would multiply the vectors. The index can become much bigger than the corpus.
      • khalic4 hours ago
        you won&#x27;t get anything out of a whole book embedding anyway, even a structured page is too much
    • j0selit02 hours ago
      I&#x27;m sorry is this ironic or not? doesn&#x27;t sounds simple at all
    • cpursley6 hours ago
      Yep, lock into some vendor from day 1. Great idea!
      • orisho6 hours ago
        Vendor lock in is 2025. Porting became trivial with LLMs advancing like they have.
        • cpursley5 hours ago
          What I&#x27;m saying is pick transportable tech from day 1 so you can easily move if they shut down, hike prices, decide they don&#x27;t like you, etc.
  • waximabbax1 hour ago
    We removed retrieval from our coding agent a while back. What convinced us wasn’t a benchmark, we found that the retrieval path had been returning zero results for quite some time because of a technical bug, still nobody noticed, indeed it was working better than before.<p>After doing some rigorous A&#x2F;B testing, we dropped indexing. For coding, I think the reason is that a repo is already searchable. Imports, call sites, file and test names, grep gives you cheap yet reliable version of what indexing would do, and the agent can read around a hit to verify it. Chunked retrieval hands the model something that looks right, and it tends to trust that instead of going to look for the actual source. Another thing that I noticed was the most intelligent models like Opus 5 and Fable ignored chunks anyway most of the time for some reason. Possibly perhaps they are trained around not trusting similarity checks for codebases.<p>Extremely large codebases with docs feel different. You can’t grep for a concept you can’t name. That’s the case where I’d still use retrieval.<p>(I work on TheGitAI, for disclosure.)
  • 77341287 hours ago
    There have been many blogs like this over the last years.<p>Yes, embeddings are computationally heavy, but they are not at all complicated and they provide a lot of benefit.<p>90% of &quot;document&quot; based RAG projects should view semantic search with embeddings as their primary method.<p>It&#x27;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.
    • pantsforbirds2 hours ago
      I think it&#x27;s VERY project specific. If you are looking for anything technical at all, then keyword search almost always does better (in my experience). I&#x27;d actually recommend starting with keyword search, and then expanding with embeddings after you have a better idea of what your users are trying to determine.
    • petesergeant7 hours ago
      Embeddings are reasonably simple, but it’s a journey to get there, and I am very proud of the dog-heavy explainer I wrote on them: <a href="https:&#x2F;&#x2F;sgnt.ai&#x2F;p&#x2F;embeddings-explainer&#x2F;" rel="nofollow">https:&#x2F;&#x2F;sgnt.ai&#x2F;p&#x2F;embeddings-explainer&#x2F;</a>
      • dotancohen6 hours ago
        This is terrific, thank you! There&#x27;s a typo in the following sentence:<p><pre><code> &gt; we don’t especially want to say that books on forestry and similar to books on puppies </code></pre> ^and^are
      • rglover4 hours ago
        Started reading and will have to finish later but thank you for sharing. Very helpful post.
      • dizhn7 hours ago
        This is very good. Thanks.
  • klm1272 hours ago
    RAG stands for Retrieval Augmented Generation. The purpose is to search a corpus of text by meaning rather than exact match.<p>I had to look it up.
    • spunker54052 minutes ago
      That sounds more like semantic search and vector db.<p>RAG is simply fetching external data (retrieval) and adding it to LLM context (augmenting) prior to generating a final response.<p>Any time LLMs do a grep or a web search to answer the query, it’s RAG. Many people use vector db for their own RAG implementation bc of the semantic search benefits.
      • 0x4579 minutes ago
        Because people writing about RAG never explained what RAG is and exclusively wrote about embeddings and vector dbs, for most people RAG became &quot;embeddings + vector db&quot;.<p>People don&#x27;t understand that any sort of retrieval before generation is RAG.
  • bob10297 hours ago
    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.<p>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.
    • jrochkind16 hours ago
      [flagged]
      • pixelbro6 hours ago
        I&#x27;ve not seen such a clipped cadence out of an LLM. I would not automatically suspect the GP. Maybe there&#x27;s better ways to spend your time?
        • jrochkind15 hours ago
          Maybe people are just learning to write in that style LLMs learned to write from statistical people? &quot;is where the capabilities become unbounded&quot; is a weird thing to say and not really true. &quot;is the end game&quot;, &quot;add non determinism on top of non determinism&quot;, there are a lot of AI-isms in this short comment. But it&#x27;s possible people are just learning to write this way now, I am curious if that&#x27;s so too!<p>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!
          • bob10293 hours ago
            It would seem AI psychosis flows both ways.
  • jankovicsandras7 hours ago
    If someone has a Postgres db and want very simple RAG:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;jankovicsandras&#x2F;plpgsql_bm25" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jankovicsandras&#x2F;plpgsql_bm25</a> BM25 search implemented in PL&#x2F;pgSQL ( Unlicense &#x2F; Public domain )<p>The repo includes also plpgsql_bm25rrf.sql : PL&#x2F;pgSQL function for hybrid search ( plpgsql_bm25 + pgvector ) with Reciprocal Rank Fusion; and Jupyter notebook examples.
  • saltysalt3 hours ago
    If like me you run models locally, it&#x27;s pretty easy to run your own RAG locally also using a Vector Database like Qdrant for persistence, and a middle-layer like Mem0 for realtime retrial and updates. I documented the set-up steps here: <a href="https:&#x2F;&#x2F;leadprompt.sh&#x2F;a&#x2F;739-Building-an-Infinite-Memory-Local-AI-Stack-on-Fedora" rel="nofollow">https:&#x2F;&#x2F;leadprompt.sh&#x2F;a&#x2F;739-Building-an-Infinite-Memory-Loca...</a>
  • Otterly995 hours ago
    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.<p>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): <a href="https:&#x2F;&#x2F;towardsdatascience.com&#x2F;author&#x2F;angela.shi&#x2F;page&#x2F;4&#x2F;" rel="nofollow">https:&#x2F;&#x2F;towardsdatascience.com&#x2F;author&#x2F;angela.shi&#x2F;page&#x2F;4&#x2F;</a><p>Note: I am not the author, just got her article in my newsletter and found it useful.
  • jmutex6 hours ago
    Chunk size matters way more than the retrieval model in my experience. Get that wrong and nothing else helps.
    • esafak3 hours ago
      Don&#x27;t leave us hanging! How do you set it?
  • yipinwong2 hours ago
    Only those who mastered the craft makes their work look simple.<p>The AI that wrote this might be the master not the writer, as this looks written by AIs.<p>I will use the author&#x27;s agents, not read his articles or use him for the job.
    • j0selit02 hours ago
      author here - thanks, I&#x27;m honored you would use my agents :)
      • yipinwong34 minutes ago
        I&#x27;d still pay for your brain (expertise, experience for built them), which is separate from your agent :)
  • Tycho3 hours ago
    I don’t understand the 4th option, “on the fly”. It didn’t seem to be explained properly.
  • maxrumpf2 hours ago
    The easiest way to strip complexity is to expose simple tools to an agent model like SID-1 that can use them well. It makes more of an effort for hard questions, and little effort for easy ones.<p>(found of sid.ai so obv biased)
  • ivansavz4 hours ago
    Does anyone have experience using SMLs for RAG (either as query rewriter or as generator for the final answer)?<p>I&#x27;d like to work with a corpus offline (internal university research data) and I&#x27;m hoping I can get everything done without the data leaving the premises.<p>I guess the biggest bottleneck is going to be for the context window size which won&#x27;t be able to fit too many result &quot;hits.&quot;<p>Any info or advice would be appreciated.
  • gabosarmiento6 hours ago
    I would like to see how each recipe performs against its corresponding evals. Some sort of ranking would be useful.<p>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.
    • autogn0me5 hours ago
      It seems not many RAG compare themselves across the same benchmarks. <a href="https:&#x2F;&#x2F;ggozad.github.io&#x2F;haiku.rag&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ggozad.github.io&#x2F;haiku.rag&#x2F;</a> 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
    • j0selit02 hours ago
      author here - that&#x27;s an amazing idea. would be an insanely large article though - maybe will write up a series
  • seanspradlin04 hours ago
    But over-engineering things is fun.<p>RAG is one of those things where I can hyper optimize to an absolutely needless degree.
  • Silasdev3 hours ago
    Very little of this is RAG but rather just FTS with clever reformulation and re-ranking.<p>RAG is about providing an grounded response, given the actual data in the corpus.<p>Great article and content, nonetheless!!
    • j0selit02 hours ago
      author here - thank you!
  • Wren_ops4 hours ago
    Agreed, simpler is almost always better. The hard part is resisting the urge to over-engineer it.
  • khalic7 hours ago
    &gt; Why this is more flexible than embeddings<p>Oh boy...
  • trivet4 hours ago
    Start with BM25 and only add embeddings when keyword search actually fails you. Saves a lot of pain.
  • nilirl7 hours ago
    Maybe I&#x27;m old but where exactly are the &quot;dragons&quot;?<p>How is RAG any different from the search systems we&#x27;ve been building before LLMs? Is it the sudden need for everyone to design a search API and engine that&#x27;s driven this trend?<p>If so, I&#x27;d like to see more design patterns around existing search problems:<p>- Correcting or backtracking based on feedback.<p>- Measuring relevance.<p>- 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?
    • brabel7 hours ago
      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.
      • triangle6 hours ago
        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
        • ozim5 hours ago
          Unfortunately LLMs made vector search more popular so it seems like something LLM specific.<p>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&#x27;t have to copy&#x2F;paste feed it to the model manually like access to text files is RAG.
      • nilirl6 hours ago
        Sure and that&#x27;s a new technique for indexing and querying.<p>Where&#x27;s the new design tension? Indexes always had to be monitored for freshness and queries have always needed cleaning or parsing.
      • KaseyKim6 hours ago
        right, it is the foundation of machine learning.
      • ewidar6 hours ago
        not really, vectorising text&#x2F;books is old school ML by this point.<p>at least to me that seems the same as <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Word2vec" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Word2vec</a> for e.g.
        • Foobar85685 hours ago
          Well... Everything new is old &quot;A vector space model for automatic indexing&quot; 1975 - <a href="https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;10.1145&#x2F;361219.361220" rel="nofollow">https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;10.1145&#x2F;361219.361220</a>
          • esafak3 hours ago
            I wonder who was doing doing semantic search in the last century!<p>&quot;The future is already here—It&#x27;s just not very evenly distributed...&quot;
        • vintermann5 hours ago
          Sure, the idea of making a vector embedding for words, sentences, documents etc. is old, but the meat is in how you construct this embedding. I think embeddings have gotten quite a bit better since word2vec.
    • TudorAndrei7 hours ago
      It&#x27;s just information retrieval packaged as something new.
      • mdp20213 hours ago
        It&#x27;s just information retrieval through a new NN based technology that allows to map concepts and ideas as the compression of long text into points in a multidimensional space that manages to compress even more dimensions than the given ones, through non-transparent engines that give different mappings and results, and still (the information retrieval) requires many more clever tricks than the simple idea of vector distance ordering because things do not quite work as they should.<p>Let&#x27;s say it&#x27;s just &quot;computation packaged as something new&quot;. &quot;Trivial things&quot;.
      • kachnuv_ocasek7 hours ago
        And you can&#x27;t fundraise on some old &quot;information retrieval&quot;.
    • MacketSWE6 hours ago
      [flagged]
  • apavlinovic7 hours ago
    The article sounds like AI slop with some predictable tells like short punctual sentences, bizarre jargon, and titles like &quot;Recipe 4: On-The-Fly Embedding (The Fresh Data Play)&quot;<p>Can we not reward junk like this? Most of the sentences are incomprehensible and provide zero actual argumentation, it&#x27;s just a list of &quot;whats&quot; with no &quot;whys&quot;
    • dsego6 hours ago
      You are right, now I noticed &quot;Real talk&quot; and &quot;Why this is underrated&quot; and I can&#x27;t unsee it.
      • 77341285 hours ago
        They&#x27;re absolutely right – and this is is why it&#x27;s a load bearing observation that cuts to the heart of the issue.
  • respectattentio4 hours ago
    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&#x27;s much more accurate and extensive covering every topic.<p>Still need ~2 years to be replaced.
    • inigyou4 hours ago
      How would you use a big LLM for retrieval?
      • respectattentio1 hour ago
        As simple as a prompting it with structural output or restrictions for your criteria.<p>With agents, the prompting could be dynamic for maximum accuracy for every retrieval.<p>This absolutely would beat the best of the best embedding-based RAG models.<p>Nobody uses this now mainly due to speed. An llm retrieval would be 10x or more slower than embedding.<p>You can try that now<p>Take some failing cases or bad retrieval from your current system Prompt an llm wisely like a perfect prompt to get what you want and provide it the context to it. And see the results.<p>For context, you are limited now by models contexts (1m), so mostly you would need to split what you have and prompt twice....or more...and so on
        • inigyou29 minutes ago
          So uh ... Where&#x27;s the retrieval part? You know RAG is used to implement that, right? You&#x27;re basically saying &quot;we don&#x27;t need an ALU, we can just use the Windows calculator&quot;
  • pioneerjeff5 hours ago
    What RAG means for AI is what a library means for human beings.<p>It&#x27;s necessary and would be good for you if you want to learn something systematically.<p>But for most of the normal issues, we can not rely a lot on it.
  • hn58622tsf2 hours ago
    Bookmarked, thanks again
  • sangwook5 hours ago
    Im curious whether the $10,000 figure includes unstated migration costs, since the raw embedding API cost under the earlier assumptions comes to $10.
  • KaseyKim6 hours ago
    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?
    • timedude2 hours ago
      Text search is not ideal for that. I such cases embedding works better
  • simianwords6 hours ago
    OT but its interesting that none of the harnesses today use embeddings but just simple grep. I would not have predicted this
    • anthonypasq56 minutes ago
      cursor still uses embeddings and theyve found it works better than just grep<p><a href="https:&#x2F;&#x2F;cursor.com&#x2F;blog&#x2F;semsearch" rel="nofollow">https:&#x2F;&#x2F;cursor.com&#x2F;blog&#x2F;semsearch</a>
    • imtringued6 hours ago
      Ok? I&#x27;m not seeing how that is interesting, you&#x27;re exclusively focusing on coding which requires precise substring locations. Google is basically almost entirely driven by embedding models now.
      • marginalia_nu2 hours ago
        A lot of this is due the size of the corpus.<p>Grep falls apart for severely underspecified queries, which is the difficult part of web search. For any given query in web search there can be several millions of candidate results. You can get good results with FTS as well, but just finding phrase matches is inadequate, you need more ranking signals to find relevant results.<p>When Claude is looking for a function in your code base, it needs to sift through dozens of matches. This is not hard, and anything beyond grep is likely not worth the effort.
      • simianwords6 hours ago
        And why do you think coding didn’t benefit from embeddings? It was attempted many times and the industry gave up.<p>I find this interesting because practically no one is doing RAG on thier personal data which is something I wouldn’t have expected.
      • owen-hill5 hours ago
        [flagged]
  • bewareofscams4 hours ago
    RAG is so 2024.
  • ufocia5 hours ago
    Wow! Terrible layout. Shouldn&#x27;t fully justify on a small screen.
  • entaroadun1231 hour ago
    [flagged]
  • alankritxghoshx2 hours ago
    [flagged]
  • 136393666684 hours ago
    [flagged]
  • LowTechHN3 hours ago
    [dead]
  • sonnykk194 hours ago
    [flagged]
  • manganate065 hours ago
    [flagged]
  • hizyyo5 hours ago
    [flagged]
  • luciana1u5 hours ago
    [flagged]
  • eugenehizyyo4 hours ago
    [flagged]
  • cloudoora7 hours ago
    [dead]
  • unicorn_platfor5 hours ago
    [dead]
  • tobin19945 hours ago
    [dead]