<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>RAG on Tyler Collins</title>
    <link>https://www.tk11br.ca/tags/rag/</link>
    <description>Recent content in RAG on Tyler Collins</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>2022-2026 Tyler Collins. Content licensed under CC BY-NC 4.0.</copyright>
    <lastBuildDate>Tue, 15 Sep 2026 10:40:34 -0400</lastBuildDate>
    <atom:link href="https://www.tk11br.ca/tags/rag/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Before You Rebuild Your RAG Pipeline, Try an Agent</title>
      <link>https://www.tk11br.ca/posts/rag-hard-part-knowledge-base/</link>
      <pubDate>Tue, 15 Sep 2026 10:40:34 -0400</pubDate>
      <guid>https://www.tk11br.ca/posts/rag-hard-part-knowledge-base/</guid>
      <description>If RAG is returning incomplete answers from dense technical documentation, try letting an agent search and read the source material directly.</description>
      <content:encoded><![CDATA[<p>If your RAG system keeps giving incomplete answers, try going fully agentic.</p>
<p>I&rsquo;m not saying retrieval-augmented generation is useless. It can make a large collection of documents cheap and fast enough to query. But if you have some tokens to burn and your corpus isn&rsquo;t massive, it may be better to let an agent search the original documents itself.</p>
<p>I ran into this with a public-facing technical wiki. The articles are dense. They have long tables, code samples, configuration details, and links to many related pages. A useful answer might depend on a warning above a table, one row in the table, and an example farther down the page.</p>
<p>Chunking pretty much destroys this on average as the length of documents grows.</p>
<h2 id="retrieval-commits-too-early">Retrieval commits too early</h2>
<p>A typical RAG pipeline splits documents into chunks, creates embeddings for them, and retrieves a small set that appears relevant to the question. The model answers using those chunks.</p>
<p>That works when each chunk still makes sense on its own. A paragraph from a straightforward policy document might survive the process just fine. Technical documentation is less cooperative.</p>
<p>A chunk can contain half a table without its heading. A code sample can lose the paragraph that explains when to use it. Two adjacent chunks can look unrelated to an embedding search even though a human reading the page would clearly use them together.</p>
<p>You can improve the pipeline. You can change the chunk size, preserve more document structure, add overlapping context, retrieve more candidates, or rerank the results. Those techniques are useful. They also keep the same basic constraint: the system decides which pieces matter before the model has understood the problem. Sometimes the model needs to investigate first.</p>
<h2 id="give-the-agent-the-source">Give the agent the source</h2>
<p>Instead of retrieving a handful of chunks, agents can use standard tools to explore the wiki. It can run searches via <code>grep</code>, open complete pages, follow links, inspect examples, and search again when the first result wasn&rsquo;t enough.</p>
<p>That changed the job. The agent wasn&rsquo;t forced to answer from whatever fragments happened to rank highest. It could start with a broad search, learn the terminology used by the documentation, and then narrow its search. If a page referred to another procedure or configuration option, it could go read that too.</p>
<p>In my experiments, this produced much better results. The agent could create complete GROMACS scripts customized for our clusters. The RAG approach was more likely to produce a generic guess because it didn&rsquo;t retrieve enough of the cluster-specific instructions together.</p>
<p>The difference wasn&rsquo;t that the agent knew more about GROMACS. It had a better way to find and assemble the relevant local information.</p>
<h2 id="this-isnt-free">This isn&rsquo;t free</h2>
<p>Direct exploration spends more tokens. It takes longer than looking up a few precomputed chunks, and it won&rsquo;t make sense for every collection of documents. It also requires a model strong enough to do proper tool calling.</p>
<p>If you have millions of pages, tight response-time requirements, or thousands of simultaneous users, you probably need retrieval to narrow the search. Access controls and source filtering may also require more deliberate infrastructure than handing an agent a directory and letting it roam around.</p>
<p>But many internal knowledge bases and technical documentation sites aren&rsquo;t that large. The agent doesn&rsquo;t need to read everything. Search tools let it reduce the corpus as it works, much like a person looking through unfamiliar documentation.</p>
<p>That makes corpus size and token cost practical limits, not reasons to assume RAG should always come first.</p>
<h2 id="run-the-comparison">Run the comparison</h2>
<p>If your current RAG system works, keep it. If it keeps missing context, returning generic answers, or falling apart around tables and code samples, don&rsquo;t immediately build a more complicated retrieval pipeline.</p>
<p>Give an agent access to the same source documents. Let it search them, read full pages, and follow links. Then ask both systems the questions your users actually care about and compare the answers.</p>
<p>Maybe the agent will be too slow or expensive. Maybe the corpus really is too large. That&rsquo;s useful to know. You now have a concrete reason to improve retrieval and a better result to compare it against.</p>
<p>But if the agent gives you a complete, locally correct answer while the RAG system keeps returning polished fragments, you may not need better chunking. You may need to stop deciding what context matters before the agent has had a chance to look around.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
