{"componentChunkName":"component---src-templates-post-js","path":"/pensieve/graphrag-production","result":{"data":{"markdownRemark":{"html":"<h2>Why plain RAG fails on financial documents</h2>\n<p>Vector-only RAG is great at “find something that sounds like this.” Due diligence and compliance need something sharper: <strong>who owns what</strong>, <strong>which clause constrains which entity</strong>, and <strong>why</strong> an answer is grounded in a specific filing.</p>\n<p>Embeddings alone blur those edges. Entities collapse into similar neighborhoods; cross-document relationships disappear; citations become soft suggestions instead of audit trails. That is the gap GraphRAG is meant to close.</p>\n<h2>The production shape: graph + hybrid retrieval + LLM reasoning</h2>\n<p>A practical GraphRAG stack for financial and compliance corpora looks like this:</p>\n<ol>\n<li><strong>Ingest</strong> multi-format documents (filings, policies, contracts).</li>\n<li><strong>Chunk and embed</strong> for semantic recall.</li>\n<li><strong>Extract entities and relations</strong> into a <strong>Neo4j</strong> knowledge graph.</li>\n<li><strong>Retrieve with hybrid fusion</strong> — vector similarity <strong>and</strong> full-text / lexical search, then graph expansion around the hit set.</li>\n<li><strong>Reason with an LLM</strong> over a structured context pack (passages + graph neighborhood + provenance).</li>\n<li><strong>Return an answer with citations</strong> that map back to nodes, chunks, and source files.</li>\n</ol>\n<p>The graph is not decoration. It is the index that makes “explainable” possible: you can show the path from claim → entity → document span.</p>\n<h2>Hybrid retrieval beats single-channel retrieval</h2>\n<p>In practice, three channels complement each other:</p>\n<table>\n<thead>\n<tr>\n<th>Channel</th>\n<th>Strength</th>\n<th>Failure mode</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Vector</td>\n<td>Paraphrase and conceptual match</td>\n<td>Misses exact identifiers, clauses, ticker symbols</td>\n</tr>\n<tr>\n<td>Full-text / lexical</td>\n<td>Exact terms, IDs, regulation codes</td>\n<td>Brittle to wording changes</td>\n</tr>\n<tr>\n<td>Graph expansion</td>\n<td>Multi-hop ownership, parties, obligations</td>\n<td>Needs decent extraction quality</td>\n</tr>\n</tbody>\n</table>\n<p>A solid fusion strategy ranks candidates from vector + FT, then expands 1–2 hops in Neo4j (related entities, linked clauses, prior filings). Rerank before the LLM so the context window stays dense and cheap.</p>\n<h2>Designing for explainability</h2>\n<p>Production buyers in finance care less about flashy demos and more about:</p>\n<ul>\n<li><strong>Provenance</strong> — every sentence tied to chunk IDs and graph node IDs</li>\n<li><strong>Faithfulness</strong> — refuse or hedge when retrieval is thin</li>\n<li><strong>Deterministic scaffolding</strong> — schema-enforced extraction (e.g. Pydantic models) so the graph does not rot</li>\n<li><strong>Evaluation</strong> — faithfulness / relevance scores, plus human review loops on high-stakes queries</li>\n</ul>\n<p>Treat the LLM as a reasoner over evidence, not as the system of record.</p>\n<h2>Operational notes that matter more than model choice</h2>\n<ul>\n<li><strong>Chunking</strong> should respect document structure (sections, tables, footnotes), not only token count.</li>\n<li><strong>Entity resolution</strong> (same company across filings) is where quality is won or lost.</li>\n<li><strong>Observability</strong> on retrieval (hit rates per channel, empty-result rate, citation coverage) catches regressions before users do.</li>\n<li><strong>Cost</strong> drops when hybrid retrieval shrinks the context you send to the model — fewer tokens, better answers.</li>\n</ul>\n<h2>What I am shipping next</h2>\n<p>These patterns underpin the <strong>GraphRAG Knowledge Engine</strong> featured on this site: Neo4j knowledge graphs, hybrid vector and full-text retrieval, and LLM reasoning aimed at due diligence and risk analysis. Client-facing deployment details stay private until the customer environment is public; the architecture above is the portable part.</p>\n<p>If you are evaluating GraphRAG vs “bigger context window,” start with retrieval quality and provenance. Model upgrades are easy to swap. A trustworthy evidence layer is not.</p>","frontmatter":{"title":"GraphRAG in Production — Hybrid Retrieval That Auditors Can Trust","description":"How Neo4j knowledge graphs plus vector and full-text retrieval produce explainable answers for financial due diligence — patterns from building a GraphRAG knowledge engine.","date":"2026-03-01","slug":"/pensieve/graphrag-production","tags":["GraphRAG","Neo4j","RAG","LLM","Production"]}}},"pageContext":{}},"staticQueryHashes":["1064330971","1994492073","2009693873","3298314076"]}