<?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: Hardcore Engineer</title>
    <description>The latest articles on DEV Community by Hardcore Engineer (@kaziava).</description>
    <link>https://dev.to/kaziava</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%2F4120551%2Fc4b02a5c-476e-4df2-a30d-a6a1c02d6bd6.png</url>
      <title>DEV Community: Hardcore Engineer</title>
      <link>https://dev.to/kaziava</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kaziava"/>
    <language>en</language>
    <item>
      <title>Why your RAG hallucinates on tables (and a minimal local GraphRAG starter to fix it)</title>
      <dc:creator>Hardcore Engineer</dc:creator>
      <pubDate>Fri, 11 Sep 2026 09:42:03 +0000</pubDate>
      <link>https://dev.to/kaziava/why-your-rag-hallucinates-on-tables-and-a-minimal-local-graphrag-starter-to-fix-it-2e24</link>
      <guid>https://dev.to/kaziava/why-your-rag-hallucinates-on-tables-and-a-minimal-local-graphrag-starter-to-fix-it-2e24</guid>
      <description>&lt;p&gt;If you've ever built a RAG system for corporate documents, you've probably hit this wall: you ask "What was the revenue in Q3?", and the LLM confidently hallucinates a number with three extra zeros.&lt;/p&gt;

&lt;p&gt;This isn't a model bug. It's an architectural blind spot. As recent research from Microsoft points out, naive 500-token chunking destroys table structures. Cosine similarity over embeddings just doesn't understand rows and columns.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix: GraphRAG
&lt;/h2&gt;

&lt;p&gt;Instead of flat vector search, we extract entities and relationships into a Knowledge Graph. When a user asks about numbers, the LLM translates the question into a Cypher query, and the graph returns exact data. Zero hallucinated digits.&lt;/p&gt;

&lt;h2&gt;
  
  
  I open-sourced a minimal local starter
&lt;/h2&gt;

&lt;p&gt;To prove this works without sending sensitive corporate data to cloud APIs, I packaged my local GraphRAG stack into a minimal, production-oriented starter repo:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://github.com/kaziava/local-graphrag-starter" rel="noopener noreferrer"&gt;github.com/kaziava/local-graphrag-starter&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Stack:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PyMuPDF&lt;/strong&gt; for local PDF parsing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LangChain&lt;/strong&gt; (&lt;code&gt;LLMGraphTransformer&lt;/code&gt;) to extract the graph&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Neo4j&lt;/strong&gt; (via docker-compose) as the graph DB&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ollama&lt;/strong&gt; (running &lt;code&gt;llama3.1:8b&lt;/code&gt; or &lt;code&gt;qwen2.5:3b&lt;/code&gt;) for local inference&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Start Neo4j&lt;/span&gt;
docker compose up &lt;span class="nt"&gt;-d&lt;/span&gt;

&lt;span class="c"&gt;# 2. Build the graph from your PDF&lt;/span&gt;
python main.py ingest data/report.pdf

&lt;span class="c"&gt;# 3. Ask a question (NL -&amp;gt; Cypher -&amp;gt; Exact Answer)&lt;/span&gt;
python main.py ask &lt;span class="s2"&gt;"What was Apple's revenue in Q3 2024?"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Benchmarks (MacBook M2, 16GB RAM)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Parse 50-page PDF: ~45s&lt;/li&gt;
&lt;li&gt;Load graph: ~10s&lt;/li&gt;
&lt;li&gt;Answer a question: 3–5s&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost per query: $0&lt;/strong&gt; (compared to ~$15–20 for the same volume via GPT-4 API)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Honest Limitations &amp;amp; Early Stage Status
&lt;/h2&gt;

&lt;p&gt;🚧 This is an early-stage reference architecture. Local 8B models are weaker than frontier LLMs on complex multi-hop reasoning, and complex tables might still need parser tuning.&lt;/p&gt;

&lt;p&gt;If you try running it on your machine and hit any OS-specific bugs, &lt;strong&gt;please open an Issue&lt;/strong&gt; on GitHub! I'm actively maintaining it and will fix things fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  Want to dive deeper into the code?
&lt;/h2&gt;

&lt;p&gt;I regularly share raw benchmark scripts, Docker configs, and architectural diagrams from my production LLMOps experience. I document this primarily in Russian on my Telegram channel (&lt;strong&gt;&lt;a href="https://t.me/llmops_engineering" rel="noopener noreferrer"&gt;@llmops_engineering&lt;/a&gt;&lt;/strong&gt;), but the code snippets, schematics, and engineering discussions are universal. Feel free to join the engineer chat there or reach out.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What graph DB are you using for your RAG setups? Let me know in the comments!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>machinelearning</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
