Graph-RAG: Database Beats Wiki and PDFs — 44% Fewer Hallucinations on Average
At 11 p.m., an assistant names the on-call engineer for the payments service from a wiki page nobody has edited in four months, even though the database already lists someone else. Graph-RAG is retrieval in which facts from the database, the wiki and PDFs are ranked by trust, and the rule "in a conflict, believe the database" is written into the prompt. According to an IDC estimate for Neo4j, graph context cuts hallucinations by 44% on average. The practical takeaway: give every source a priority and a provenance label.
AI-processed from Machine Learning Mastery; edited by Hamidun News
Picture this: at 11 p.m., an engineer asks an internal AI assistant who is on call for the payments service.
The assistant has read the wiki, indexed every PDF on the shared drive and connected to the service registry. The question is trivial, but the wiki was last edited four months ago, the on-call schedule has changed twice since then, and the current answer sits in a single database row. If retrieval treats all sources as equally reliable text, the assistant may name a person who left the rotation long ago.
This is the problem Graph-RAG addresses. The term refers to RAG (retrieval over documents, with the retrieved material inserted into the model's prompt) in which facts are stored as relationships and split into trust tiers. Shittu Olumide, the author of the write-up on Machine Learning Mastery, also cites an estimate: according to an IDC study sponsored by Neo4j, organizations that rely on graph context cut their hallucination rate (made-up answers) by 44% on average.
In practice, this means that when sources conflict, the assistant should believe the database, not the wiki.
Why plain vector search gets it wrong
The idea comes from the author's previous article on deterministic three-tier Graph-RAG. In that piece, purely vector-based RAG could not keep track of which team a basketball player currently plays for: team names sit close together in embedding space, and search cannot tell which one is current. The fix is three retrieval tiers: a graph of absolute facts, a graph of background statistics and a vector database. Their results are merged into a single answer using explicit priority rules that are written directly in the prompt rather than built into a routing algorithm.
Three sources, three trust tiers
The scenario is a teaching example: a fictional platform team, Northwind, runs three services — payments-service, checkout-service and notifications-service.
- Priority 1 — the service registry (CMDB). In the example it is SQLite; in production it would be Postgres. It stores the owner, the on-call engineer, status, version, deploy date and SLA tier. The data is queried on every request, so by construction it never goes stale.
- Priority 2 — wiki runbooks. Detailed, but they go out of date as soon as nobody updates them after an on-call rotation change. They are useful as long as they do not contradict a fresher source.
- Priority 3 — PDFs. An SLA document and an incident postmortem. They contain no clear-cut facts, but they do tell the story of what happened, so this tier serves as the vector fallback.
The example deliberately includes a conflict: the wiki runbook for payments names Jordan Blake as on-call, while the database names Amara Chen. The whole architecture exists for discrepancies like this. Another service, notifications-service, is marked in the database as deprecated (being retired), which becomes useful later.
How it is built
Facts from the database and the wiki go into a simple store of "quadruples": subject, predicate, object and context (SPOC). The context is a source label, either "cmdb" or the name of a wiki page, so any discrepancy can be traced to a specific document. The author wrote this store from scratch, and it works by brute-force scan. The original library indexes fields for fast lookup, which matters with millions of facts, but a scan is enough for one team's catalog.
The wiki is parsed with regular expressions on lines like "On-call engineer: …". The author warns that an export from a real Confluence will not look this tidy, so in production you would have to extend the patterns for each page type, or add a lightweight LLM pass for pages with a nonstandard layout.
For PDFs, the example uses pdfplumber, which extracts text more reliably than many lightweight alternatives, and the Chroma vector database. The spaCy library recognizes named entities to pull service names out of the question. The model in the example is local: llama3.2 via Ollama. Switching to a cloud API only changes the function that sends the final request.
What to do with this
The main lesson is not about choosing a vector database but about ranking sources. A registry row that a system updates is more reliable than a wiki page, and a wiki is more reliable than a paragraph from an old PDF. A source label on every fact also lets you show users where an answer came from.
The numbers should be read with a caveat: the IDC study was sponsored by Neo4j, a graph database vendor. The author also gives an example: one life sciences company cut its hallucination rate from 20–40% to 2–5%. This is a benchmark, not a guarantee; the outcome depends on the quality of your data.
There are limitations too. A priority rule in the prompt is only an instruction to the model, and a small local model can break it. If a conflict can be resolved in code (for example, by not returning a wiki fact for the same predicate when a CMDB fact exists), that is more reliable. Regular expressions work only for templated pages, and the teaching example has just three services, so load and quality on a real corpus will have to be tested separately. The source text breaks off at the PDF step, so details of prompt assembly are not covered here.
- Nov 18, 2026sd.cpp instead of Forge Neo: nine models on a 16 GB GPU draw in 5–68 seconds
- Nov 18, 2026JetBrains' Mellum Runs Locally in an IDE: 5 Out of 10 on a MacBook M3 Pro
- Nov 18, 2026One Slider Lets a Mini PC Run 26B LLMs: Generation on the iGPU Is 21–39% Faster
- Nov 18, 2026LLMs on a GPU-less VPS: 4B models sort support tickets with 90% accuracy in 3–5 seconds
Key Questions Answered
Why plain vector search gets it wrong?
The idea comes from the author's previous article on deterministic three-tier Graph-RAG. In that piece, purely vector-based RAG could not keep track of which team a basketball player currently plays for: team names sit close together in embedding space, and search cannot tell which one is current. The fix is three retrieval tiers: a graph of absolute facts, a graph of background statistics and a vector database.
What are the key details on Three sources, three trust tiers?
The scenario is a teaching example: a fictional platform team, Northwind, runs three services — payments-service, checkout-service and notifications-service. Priority 1 — the service registry (CMDB). In the example it is SQLite; in production it would be Postgres. It stores the owner, the on-call engineer, status, version, deploy date and SLA tier. The data is queried on every request, so by construction it never goes stale. Priority 2 — wiki runbooks.
How it is built?
Facts from the database and the wiki go into a simple store of "quadruples": subject, predicate, object and context (SPOC). The context is a source label, either "cmdb" or the name of a wiki page, so any discrepancy can be traced to a specific document. The author wrote this store from scratch, and it works by brute-force scan. The original library indexes fields for fast lookup, which matters with millions of facts, but a scan is enough for one team's catalog.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.