Skip to main content

Knowledge Graphs Are Back: Why RAG Teams Are Adding Structure to Their Retrieval

· 8 min read
Tian Pan
Software Engineer

Your RAG pipeline answers single-fact questions beautifully. Ask it "What is our refund policy?" and it nails it every time. But ask "Which customers on the enterprise plan filed support tickets about the billing API within 30 days of their contract renewal?" and it falls apart. The answer exists in your data — scattered across three different document types, connected by relationships that cosine similarity cannot see.

This is the multi-hop reasoning problem, and it's the reason a growing number of production RAG teams are grafting knowledge graphs onto their vector retrieval pipelines. Not because graphs are trendy again, but because they've hit a concrete accuracy ceiling that no amount of chunk-size tuning or reranking can fix.

The Multi-Hop Wall

Vector search works by embedding text into high-dimensional space and finding the chunks closest to your query. For single-hop questions — "What does feature X do?" — this is remarkably effective. The relevant chunk sits in a predictable neighborhood of the embedding space.

Multi-hop questions break this model. Consider: "What scientific work influenced the mentor of the person who discovered the double helix structure of DNA?" Answering this requires three separate retrieval steps:

  1. Watson and Crick discovered the double helix
  2. Their mentor was Lawrence Bragg
  3. Bragg was influenced by X-ray crystallography work

Each fact lives in a different chunk, and none of them are semantically similar to the original question. The bridging facts — the ones connecting person to mentor to influence — score low on cosine similarity because they don't share surface-level vocabulary with the question.

Microsoft's research quantified this gap: baseline RAG captures only 22–32% of comprehensive answers on multi-hop questions. GraphRAG, by contrast, achieves 72–83% — a 3x improvement that comes from preserving the relational structure that vectors discard.

How Graph-Enhanced Retrieval Actually Works

The architecture is simpler than most teams expect. You're not replacing your vector database — you're adding a layer that captures entity relationships your embeddings miss.

Graph construction starts with entity extraction. An LLM (or a lighter NLP pipeline) reads your documents and pulls out entities and their relationships: (Watson) --[MENTORED_BY]--> (Bragg), (Bragg) --[INFLUENCED_BY]--> (X-ray Crystallography). These triples form a knowledge graph that sits alongside your vector index.

At query time, the system runs a dual retrieval path:

  • Vector path: standard semantic search for chunks relevant to the query
  • Graph path: entity recognition on the query, followed by graph traversal to find connected entities and their associated text

The results merge before being sent to the LLM for generation. The vector path handles straightforward factual retrieval. The graph path handles the relational reasoning — following edges between entities to assemble multi-hop evidence chains.

Recent benchmarks on the Babilong dataset showed graph-RAG with personalized PageRank significantly outperformed GPT-4o's 128k context window on multi-hop questions. The advantage comes from filtering: RAG retrieves only the relevant subgraph, while long-context models struggle with distraction from irrelevant noise.

Three Construction Patterns That Work Without a PhD in Ontology

The biggest objection to knowledge graphs has always been construction cost. Traditional knowledge graph projects required months of schema design, domain expert interviews, and manual curation. LLMs have compressed this timeline from months to hours — but you still need to pick the right construction pattern for your use case.

Pattern 1: LLM-Driven Extraction. Feed your documents through an LLM with a prompt like "Extract all entities and relationships from this text as (subject, predicate, object) triples." GPT-4 or Claude achieves roughly 65.8% accuracy on entity-relation extraction. This is the highest-quality option but also the most expensive — you're making an LLM call for every document in your corpus.

Pattern 2: Dependency Parsing. Use traditional NLP (spaCy, Stanford NLP) to extract entities via named entity recognition and relationships via dependency parsing. Recent research shows this achieves 94% of LLM-based quality (61.9% vs 65.8%) at a fraction of the cost. For most production use cases, this is the sweet spot — good enough accuracy with predictable, low per-document cost.

Pattern 3: LazyGraphRAG. Microsoft's approach skips upfront graph construction entirely. Instead of pre-building a full knowledge graph, LazyGraphRAG uses lightweight NLP to extract noun co-occurrences and builds graph structure on-the-fly during queries. Indexing cost drops to 0.1% of full GraphRAG while maintaining comparable answer quality. The tradeoff: query latency increases because construction happens at retrieval time, making it best suited for exploratory or one-off queries rather than high-throughput production serving.

When the Schema Overhead Isn't Worth It

Knowledge graphs are not universally better than vector-only RAG. The overhead — construction cost, storage, maintenance, query complexity — only pays for itself in specific scenarios.

Add a graph when:

  • Your questions regularly require connecting facts across 2+ documents
  • Your domain has strong entity relationships (people → organizations → projects → outcomes)
  • Accuracy on complex queries directly impacts business outcomes (legal research, compliance, medical decision support)
  • Your corpus is relatively stable and doesn't require constant re-indexing

Stick with vector-only when:

  • Most queries are single-hop factual lookups
  • Your corpus changes frequently and re-extraction would be prohibitively expensive
  • Latency requirements are strict (sub-200ms) and you can't afford the graph traversal overhead
  • Your documents lack clear entity-relationship structure (creative writing, opinion pieces, chat logs)

The hybrid approach — routing simple queries to vector search and complex queries to graph retrieval — is becoming the standard pattern. A lightweight query classifier determines whether a question requires multi-hop reasoning, and routes accordingly. This gives you the speed of vector search for the 80% of queries that don't need graph structure, and the accuracy of graph retrieval for the 20% that do.

The Production Reality: Cost, Latency, and Maintenance

Teams adopting GraphRAG in production face three recurring challenges that benchmarks don't capture.

Indexing cost scales with corpus size. Full GraphRAG indexing is 100–1000x more expensive than vector indexing because every document needs entity extraction. For a 10M document corpus, this means the difference between a few hundred dollars and tens of thousands. KET-RAG and LazyGraphRAG address this with multi-granular indexing and deferred construction, but you need to plan for this cost upfront.

Graph maintenance is a new operational burden. When documents update, the corresponding graph nodes and edges need updating too. Unlike vector indexes where you just re-embed the changed document, graph updates can cascade — changing one entity might invalidate relationships across dozens of connected nodes. Teams that don't automate this maintenance end up with stale graphs that silently degrade answer quality.

Query complexity increases. Your retrieval pipeline goes from "embed query, find nearest neighbors, done" to "embed query, extract entities, traverse graph, merge results, deduplicate, rerank." Each step adds latency and potential failure modes. Production systems need fallback logic: if graph traversal times out or returns empty, fall back to vector-only results rather than returning nothing.

The teams succeeding with GraphRAG in production share a common trait: they started with a specific, measurable failure mode in their vector-only pipeline, built a graph to address that specific failure, and expanded the graph's scope only after proving ROI on the initial use case. Teams that tried to build a comprehensive knowledge graph upfront — covering every entity and relationship in their corpus — invariably stalled under the weight of schema design decisions and extraction quality issues.

Where This Goes Next

The trajectory is clear: hybrid retrieval becomes the default architecture, with vector search handling breadth and graph structure handling depth. The construction cost problem is being solved from multiple directions — LazyGraphRAG's deferred construction, dependency-parsing approaches that avoid LLM costs, and KET-RAG's multi-granular indexing that builds different levels of graph detail for different document types.

The more interesting development is the convergence with agentic RAG. When an agent can decompose a complex question into sub-queries, route each sub-query to the appropriate retrieval method, and assemble the results — that's when graph-enhanced retrieval moves from "accuracy improvement on benchmarks" to "qualitatively new capabilities." An agent that understands it needs to traverse a graph for one sub-query and do a vector search for another can answer questions that neither method handles alone.

For teams evaluating this today: start with your hardest queries. Find the questions your current RAG pipeline gets wrong, classify them by failure mode, and check whether multi-hop reasoning is the bottleneck. If it is, a lightweight graph overlay — even just entity co-occurrence extraction — will likely give you a measurable accuracy boost with manageable engineering effort. If your failures are about chunk quality, context window, or prompt engineering, a knowledge graph won't help and you should look elsewhere.

References:Let's stay in touch and Follow me for more thoughts and updates