<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: chi lan</title>
    <description>The latest articles on DEV Community by chi lan (@chilan).</description>
    <link>https://dev.to/chilan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3701446%2Fa7293fdf-2633-4e1f-ba26-9b84913e3b34.png</url>
      <title>DEV Community: chi lan</title>
      <link>https://dev.to/chilan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chilan"/>
    <language>en</language>
    <item>
      <title>Benchmark: I replaced Gemini CLI's Vector RAG with Context Trees to stop the hallucinations (99% Token Reduction)</title>
      <dc:creator>chi lan</dc:creator>
      <pubDate>Fri, 09 Jan 2026 01:49:01 +0000</pubDate>
      <link>https://dev.to/chilan/benchmark-i-replaced-gemini-clis-vector-rag-with-context-trees-to-stop-the-hallucinations-99-kh1</link>
      <guid>https://dev.to/chilan/benchmark-i-replaced-gemini-clis-vector-rag-with-context-trees-to-stop-the-hallucinations-99-kh1</guid>
      <description>&lt;p&gt;If you’ve been following the recent debates here between Gemini CLI (Gemini 3/Flash) and Claude Code, you probably know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gemini CLI: Incredible value (free tier/high limits) but feels chaotic on large repos. It often hallucinates imports or gets lazy (refuses to code) when you load too many files.&lt;/li&gt;
&lt;li&gt;Claude Code: Smarter reasoning, but you hit the 5-hour Usage Limit extremely fast if you work with large contexts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I spent the last week testing a theory: The problem isn't that Gemini is dumb but Context Dumping makes it dumb.&lt;/p&gt;

&lt;p&gt;Most users (and tools like Cursor's Index) either:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Context Dump: Stuff 50 files into the window (Gemini Default). This causes Context Dilution - the model gets overwhelmed by noise and hallucinates.&lt;/li&gt;
&lt;li&gt;Vector RAG: Use embeddings to find similar code. This fails because it retrieves 10 versions of &lt;code&gt;Auth_v1.ts&lt;/code&gt; instead of the one &lt;code&gt;User.ts&lt;/code&gt; that you actually need.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;The Benchmark Results&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;(Tested on a ~1,300 file codebase, asking: "Refactor the User Auth Controller")&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flrwza4iis19wofsbluju.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flrwza4iis19wofsbluju.png" alt=" " width="719" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why this matters&lt;/strong&gt;&lt;br&gt;
We often blame the model for being lazy, but if you look at the logs, it's usually because the context window is polluted with 50 irrelevant files.&lt;br&gt;
By moving the retrieval logic client-side (building a dependency tree locally and pruning it before sending to the API), you achieve two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Unlimited Workflow:&lt;/strong&gt; You stop burning 10k tokens per query, so you stay under the radar for usage limits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smarter Code:&lt;/strong&gt; Gemini 3 actually performs &lt;em&gt;better&lt;/em&gt; than Claude 3.5 Sonnet when it isn't distracted by noise.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;The Code/ Reproduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you’re curious how this actually played out step by step, check out the &lt;a href="https://www.byterover.dev/blog/why-vector-rag-fails-for-code-we-tested-it-on-1-300-files?utm_source=rdgemini1&amp;amp;utm_medium=influencer&amp;amp;utm_campaign=blog_jan_26&amp;amp;utm_content=blog_post" rel="noopener noreferrer"&gt;&lt;strong&gt;full article&lt;/strong&gt;&lt;/a&gt; where I include the detailed results &amp;amp; analysis and reproduction guide.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>showdev</category>
      <category>gemini</category>
    </item>
  </channel>
</rss>
