<?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: Ilker Akbal</title>
    <description>The latest articles on DEV Community by Ilker Akbal (@ilker_akbal_7ffe2578cb745).</description>
    <link>https://dev.to/ilker_akbal_7ffe2578cb745</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4185277%2Fa82277a3-a22b-4793-85a8-6629fb616d3f.png</url>
      <title>DEV Community: Ilker Akbal</title>
      <link>https://dev.to/ilker_akbal_7ffe2578cb745</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ilker_akbal_7ffe2578cb745"/>
    <language>en</language>
    <item>
      <title>When RAG Retrieval Improves Overall but Breaks Critical Queries</title>
      <dc:creator>Ilker Akbal</dc:creator>
      <pubDate>Wed, 14 Oct 2026 18:14:47 +0000</pubDate>
      <link>https://dev.to/ilker_akbal_7ffe2578cb745/when-rag-retrieval-improves-overall-but-breaks-critical-queries-4cl3</link>
      <guid>https://dev.to/ilker_akbal_7ffe2578cb745/when-rag-retrieval-improves-overall-but-breaks-critical-queries-4cl3</guid>
      <description>&lt;h1&gt;
  
  
  When RAG Retrieval Improves Overall but Breaks Critical Queries
&lt;/h1&gt;

&lt;p&gt;When building a Retrieval-Augmented Generation (RAG) application, changing an embedding model, chunking strategy, or retriever can improve overall retrieval metrics.&lt;/p&gt;

&lt;p&gt;But does that mean every important query works better?&lt;/p&gt;

&lt;p&gt;Not necessarily.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Imagine a RAG application with three queries: privacy, installation, and warranty information.&lt;/p&gt;

&lt;p&gt;After updating the retrieval system, the following happens:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Query&lt;/th&gt;
&lt;th&gt;Baseline Hit@1&lt;/th&gt;
&lt;th&gt;Candidate Hit@1&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Privacy (critical)&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Installation&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Warranty&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Average&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.33&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.67&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The average retrieval score improves, but the privacy query loses its relevant document.&lt;/p&gt;

&lt;p&gt;A deployment decision based only on the aggregate metric could miss this regression.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing OpenRAG Bench
&lt;/h2&gt;

&lt;p&gt;I am developing &lt;a href="https://github.com/ilker-Akbal/openrag-bench" rel="noopener noreferrer"&gt;OpenRAG Bench&lt;/a&gt;, an open-source, MIT-licensed Python toolkit for evaluating and comparing RAG retrieval results.&lt;/p&gt;

&lt;p&gt;It provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retrieval metrics including Precision@k, Recall@k, MRR, MAP, and NDCG&lt;/li&gt;
&lt;li&gt;Baseline and candidate comparisons&lt;/li&gt;
&lt;li&gt;Configurable quality policies with OpenRAG Guard&lt;/li&gt;
&lt;li&gt;Golden Dataset Studio for human relevance labeling&lt;/li&gt;
&lt;li&gt;Capture &amp;amp; Replay for evaluating saved retrieval results&lt;/li&gt;
&lt;li&gt;Offline HTML and JSON reports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The core evaluation does not require an LLM API key or GPU.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it locally
&lt;/h2&gt;

&lt;p&gt;You can reproduce the critical-query regression example using the current GitHub source code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/ilker-Akbal/openrag-bench.git
&lt;span class="nb"&gt;cd &lt;/span&gt;openrag-bench

python &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;

python examples/quickstart_capture_replay.py &lt;span class="nt"&gt;--output-dir&lt;/span&gt; reports/first-demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then open:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reports/first-demo/guard.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The example performs actual keyword-based retrieval over a small synthetic document collection.&lt;/p&gt;

&lt;p&gt;The candidate improves average NDCG@1 while losing a critical privacy document.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Expected outcome: BLOCKED&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The example script exits successfully when it verifies that Guard correctly blocked the candidate. A direct blocked Replay command returns exit code 2.&lt;/p&gt;

&lt;p&gt;This demonstration is available in the current GitHub source checkout, not in the published v0.6.0 wheel alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-data evaluation
&lt;/h2&gt;

&lt;p&gt;I also evaluated lexical retrieval approaches using the BEIR SciFact test dataset, containing 5,183 documents and 300 judged queries.&lt;/p&gt;

&lt;p&gt;The measured NDCG@10 results were:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;NDCG@10&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;TF-IDF&lt;/td&gt;
&lt;td&gt;0.6329&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BM25&lt;/td&gt;
&lt;td&gt;0.6605&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These results demonstrate a difference on this particular dataset. They do not establish universal model superiority or statistical significance.&lt;/p&gt;

&lt;h2&gt;
  
  
  What comes next?
&lt;/h2&gt;

&lt;p&gt;OpenRAG Bench v0.6.0 is available as a public GitHub alpha release.&lt;/p&gt;

&lt;p&gt;The next priority is independent developer feedback, particularly from people using LangChain, LlamaIndex, FAISS, or custom retrieval pipelines.&lt;/p&gt;

&lt;p&gt;I would appreciate feedback about installation, stable document IDs, integration challenges, and confusing evaluation results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/ilker-Akbal/openrag-bench" rel="noopener noreferrer"&gt;https://github.com/ilker-Akbal/openrag-bench&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quickstart:&lt;/strong&gt; &lt;a href="https://github.com/ilker-Akbal/openrag-bench/blob/main/docs/DEMO_60_SECONDS.md" rel="noopener noreferrer"&gt;https://github.com/ilker-Akbal/openrag-bench/blob/main/docs/DEMO_60_SECONDS.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feedback:&lt;/strong&gt; &lt;a href="https://github.com/ilker-Akbal/openrag-bench/issues/4" rel="noopener noreferrer"&gt;https://github.com/ilker-Akbal/openrag-bench/issues/4&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OpenRAG Bench measures retrieval relevance. It does not directly evaluate generated answer factuality, hallucinations, or overall LLM safety.&lt;/p&gt;

</description>
      <category>python</category>
      <category>tutorial</category>
      <category>testing</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
