<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[The Applied Stack]]></title><description><![CDATA[Applied AI for builders. Practical deep dives on RAG, AI agents, agent harnesses and forward-deployed AI: how it actually gets built and shipped.]]></description><link>https://appliedstack.ai</link><image><url>https://substackcdn.com/image/fetch/$s_!r4sP!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35d64384-e0e4-4a76-bfc0-c54efe5104d2_1024x1024.png</url><title>The Applied Stack</title><link>https://appliedstack.ai</link></image><generator>Substack</generator><lastBuildDate>Sat, 26 Sep 2026 20:43:54 GMT</lastBuildDate><atom:link href="https://appliedstack.ai/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Brij Pandey]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[theappliedstack@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[theappliedstack@substack.com]]></itunes:email><itunes:name><![CDATA[Brij Pandey]]></itunes:name></itunes:owner><itunes:author><![CDATA[Brij Pandey]]></itunes:author><googleplay:owner><![CDATA[theappliedstack@substack.com]]></googleplay:owner><googleplay:email><![CDATA[theappliedstack@substack.com]]></googleplay:email><googleplay:author><![CDATA[Brij Pandey]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[RAG in 2026: What Changed and What Still Breaks in Production]]></title><description><![CDATA[Million-token context windows didn't kill retrieval. They changed what good retrieval looks like.]]></description><link>https://appliedstack.ai/p/rag-in-2026</link><guid isPermaLink="false">https://appliedstack.ai/p/rag-in-2026</guid><dc:creator><![CDATA[Brij Pandey]]></dc:creator><pubDate>Fri, 25 Sep 2026 18:58:13 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OZoK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every few months someone asks the same question in a planning meeting: &#8220;Models can read a million tokens now. Why are we still running a vector database?&#8221;</p><p>It&#8217;s a fair question, and in 2026 we finally have data to answer it. The short answer is that the naive RAG of 2023 is dead: fixed chunks, one embedding model, top-k by similarity, and hope. Retrieval itself is not. It grew up, and the reasons we still need it are different from what most people assume.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://appliedstack.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading The Applied Stack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>This issue covers the four things that changed, the five places RAG still breaks in production, and a short audit you can run on your own system.</p><div><hr></div><h2>The Big Idea: Four things that changed</h2><h3>1. Long context is now a real alternative, and it can be more accurate</h3><p>The honest starting point is that stuffing documents into the prompt works, and often works better than a mediocre retriever.</p><p>In a June 2026 comparison on the same document-grounded task, <a href="https://arxiv.org/abs/2606.20898">Hamilton et al.</a> found that long-context prompting reached the highest correctness, 73.1% against 65.4% for semantic RAG, but at 26 times the per-query token cost.</p><p>That tells you what the real trade-off is. Retrieval doesn&#8217;t win on raw accuracy when everything fits in the window. You keep retrieval for four reasons: cost, corpus size, freshness and permissions.</p><p>A practical rule from <a href="https://www.anthropic.com/news/contextual-retrieval">Anthropic</a>: if your knowledge base is under about 200,000 tokens, roughly 500 pages, you can often put the whole thing in the prompt and skip RAG entirely.</p><h3>2. Bigger windows are not better windows</h3><p>The catch with long context is that &#8220;fits in the window&#8221; is not the same as &#8220;the model uses it well.&#8221;</p><p>Researchers at <a href="https://research.trychroma.com/context-rot">Chroma</a> call this &#8220;context rot.&#8221; Even on deliberately simple tasks, model performance degrades as input length increases, often in surprising and uneven ways. Earlier, the well-known <a href="https://arxiv.org/abs/2307.03172">Lost in the Middle</a> study showed that models use information at the start and end of a long input best, and do significantly worse when the relevant passage sits in the middle.</p><p>So the 2026 pattern is not &#8220;RAG or long context.&#8221; It&#8217;s retrieval to narrow the field, then a generous window to reason across what&#8217;s left.</p><h3>3. Hybrid retrieval with context became the baseline</h3><p>Pure vector search is no longer a serious production default. Embeddings are good at meaning and weak at exact matches: product codes, error IDs, names, clause numbers. Keyword search (BM25) is the opposite. Production systems run both and merge the results.</p><p>The biggest easy upgrade of the last two years is <a href="https://www.anthropic.com/news/contextual-retrieval">Contextual Retrieval</a>. Before indexing, you prepend a short, model-generated note to each chunk explaining where it sits in its document. A chunk that says &#8220;revenue grew 3%&#8221; becomes a chunk that says which company and which quarter. In Anthropic&#8217;s tests:</p><ul><li><p>Contextual embeddings cut retrieval failures by 35%</p></li><li><p>Adding contextual keyword search cut them by 49%</p></li><li><p>Adding a reranker on top cut them by 67%</p></li></ul><p>The one-time cost was about $1.02 per million document tokens, using prompt caching so each document is only paid for once.</p><h3>4. Retrieval became a tool the agent calls</h3><p>The newest shift is architectural. Instead of retrieving once before the model answers, agents now decide when to search, what to search for, and whether the results are good enough.</p><p>Anthropic&#8217;s guidance on <a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents">context engineering</a> describes this as &#8220;just in time&#8221; context: keep lightweight references such as file paths, IDs and links in the prompt, and let the agent load details when it needs them. The goal is &#8220;the smallest possible set of high-signal tokens&#8221; that gets the job done.</p><p>This is powerful for open-ended, multi-step questions. It is also slower, more expensive and harder to debug, so treat it as the last step up, not the first.</p><div><hr></div><h2>Where production RAG still breaks</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OZoK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OZoK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png 424w, https://substackcdn.com/image/fetch/$s_!OZoK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png 848w, https://substackcdn.com/image/fetch/$s_!OZoK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png 1272w, https://substackcdn.com/image/fetch/$s_!OZoK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OZoK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png" width="1456" height="816" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:816,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:83817,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://theappliedstack.substack.com/i/217440655?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OZoK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png 424w, https://substackcdn.com/image/fetch/$s_!OZoK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png 848w, https://substackcdn.com/image/fetch/$s_!OZoK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png 1272w, https://substackcdn.com/image/fetch/$s_!OZoK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe4a1cda-86eb-4453-9c9b-0627acd84332_1456x816.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Despite all of the progress above, many RAG failures still happen before the model writes a single word. They fall into five buckets.</p><p><strong>1. Parsing.</strong> Tables get flattened into word soup, scanned PDFs come through as nothing, and headings disappear, so chunks lose their structure. If a human can&#8217;t read your parsed text, the model can&#8217;t either. Use a layout-aware parser and keep tables as Markdown.</p><p><strong>2. Retrieval recall.</strong> Teams blame the model for wrong answers when the right document was never retrieved in the first place. If the correct chunk isn&#8217;t in the top results, no prompt will save you. Measure this directly (see the audit below) before touching the prompt.</p><p><strong>3. Permissions.</strong> Retrieval can surface documents the user isn&#8217;t allowed to see. Filtering after generation is too late, because the model has already read the text. Store access metadata with every chunk and filter before anything reaches the model.</p><p><strong>4. Freshness and conflicting sources.</strong> Old policies, outdated docs and duplicate versions compete with current ones. The model will cheerfully cite the 2023 version. Re-index incrementally, store dates, and prefer the newest source when two conflict.</p><p><strong>5. No evaluation.</strong> This is the root cause behind most of the others. Without a test set, every change is a guess, and every regression reaches users first.</p><p>The key point in the diagram: fix from left to right. A parsing failure caps retrieval quality, and a retrieval failure caps answer quality. Tuning the prompt while the parser is broken is wasted effort.</p><div><hr></div><h2>How to use it: a 30-minute RAG audit</h2><p>Run this on any RAG system you own or inherit.</p><ol><li><p><strong>Collect 20 real questions</strong> that users actually asked. For each one, note which document or chunk should answer it.</p></li><li><p><strong>Check retrieval alone.</strong> For each question, does the right chunk appear in the top 10 results? This single number tells you more than any answer-quality score.</p></li><li><p><strong>Read 5 parsed documents</strong> as plain text. Look for broken tables, missing headings and garbled numbers.</p></li><li><p><strong>Ask 3 questions your documents can&#8217;t answer.</strong> A healthy system says &#8220;not found.&#8221; An unhealthy one makes something up.</p></li><li><p><strong>Test one permission boundary.</strong> Log in as a restricted user and ask about restricted content.</p></li><li><p><strong>Write down your baseline</strong>, then change one thing at a time.</p></li></ol><p>Here&#8217;s a minimal way to measure step 2:</p><pre><code><code>def retrieval_hit_rate(eval_set, retrieve, k=10):
    """eval_set: [{"question": str, "relevant_ids": set[str]}, ...]
    retrieve: your search function, returning chunks with a "chunk_id"."""
    hits = 0
    for item in eval_set:
        results = retrieve(item["question"], k=k)
        found = {r["chunk_id"] for r in results}
        if found &amp; item["relevant_ids"]:
            hits += 1
    return hits / len(eval_set)

# Example: print(f"Hit rate @10: {retrieval_hit_rate(eval_set, search):.0%}")
</code></code></pre><p>As a rule of thumb, if your hit rate at 10 is below about 80%, fix retrieval before anything else. Add keyword search, contextualize your chunks, and add a reranker, in that order.</p><div><hr></div><h2>The Filter</h2><p>Four resources worth your time this week:</p><ul><li><p><strong><a href="https://arxiv.org/abs/2606.20898">The Token Tax of Epistemic Accuracy</a>:</strong> the clearest recent comparison of RAG against long context, framed as a cost and accuracy trade-off rather than a winner.</p></li><li><p><strong><a href="https://research.trychroma.com/context-rot">Context Rot</a>:</strong> why a million-token window doesn&#8217;t mean a million useful tokens.</p></li><li><p><strong><a href="https://www.anthropic.com/news/contextual-retrieval">Introducing Contextual Retrieval</a>:</strong> the highest-return retrieval upgrade most teams haven&#8217;t made yet, with the exact prompt.</p></li><li><p><strong><a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents">Effective context engineering for AI agents</a>:</strong> how retrieval changes when an agent, not a pipeline, decides what to load.</p></li></ul><div><hr></div><h2>One question</h2><p>What&#8217;s the most common failure in your RAG system right now: parsing, retrieval, permissions, stale data, or something I didn&#8217;t list? Reply and tell me. I read every response, and the best answers will shape a future Build Log.</p><div><hr></div><p><strong>New here?</strong> Subscribe free and get the <strong><a href="https://6161186426718.gumroad.com/l/rag-agents-cheat-sheet">RAG and AI Agents Cheat Sheet</a></strong>: a decision tree for choosing between RAG and long context, production defaults, real benchmark numbers and copy-paste prompt templates.</p><p>If this was useful, forward it to one person who is building with AI.</p><p><a href="https://appliedstack.ai">appliedstack.ai</a></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://appliedstack.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading The Applied Stack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>