Entity + relationship extraction
LLM passes over the corpus extracting named entities (people, organisations, drugs, regulations, transactions) and the relationships between them. Output is a typed graph schema.
Microsoft's GraphRAG and its descendants build a knowledge graph over entities and relationships in the corpus. Retrieval is graph traversal; reasoning is path-following. For domains where the answer hops across linked facts, hits 81%+ accuracy in published benchmarks, a 6.8% lift over Advanced RAG on the same tasks.
Best for: Clinical research, regulatory analysis, legal case files, complex multi-document compliance, fraud investigation, intelligence work. Anything where the answer is a path across linked entities, not a quote from one passage.
GraphRAG splits cleanly into two halves. Offline: extract entities and relationships from the corpus, cluster into communities, summarise each community. Online: route the query to the right community, traverse the graph for relevant context, generate with the path as evidence.
LLM passes over the corpus extracting named entities (people, organisations, drugs, regulations, transactions) and the relationships between them. Output is a typed graph schema.
Entities and edges loaded into a graph store. Hierarchical Leiden or similar clusters the graph into communities at multiple resolutions.
LLM writes a summary per community at each resolution. These summaries become the global retrieval surface; the underlying graph is the local one.
Incoming query routed to the relevant community summaries via vector search over the summaries themselves. Picks the resolution that matches query specificity.
Selected communities expanded to the underlying entities and relationships. Synthesizer LLM writes the answer with explicit path evidence (entity A linked to entity B linked to entity C).
GraphRAG is the most stack-heavy pattern in the list. You operate a graph store, a vector store, and substantial LLM compute for the offline build. The deploy is worth the build cost only in domains where the multi-hop accuracy gain is the product.
Neo4j for graph-first workloads; pgrouting for Postgres-first teams who want to keep the graph in the same DB. Both support the community detection and traversal we need.
Community summaries are the global retrieval surface. They live in pgvector for cheap routing. Underlying entity graph lives in the graph store.
Mid-tier model for entity and relationship extraction. Run in batch on the corpus, output validated against a typed schema. Cheap per token, large bill across a real corpus.
Final-answer model is the higher tier. Synthesises across the traversal path, maintains citation discipline.
Standard 2026 default. Produces communities at multiple resolutions so query routing can pick specificity per question.
Entity and relationship types tuned to the domain (Drug, Trial, Adverse Event, Approval for clinical; Party, Contract, Clause, Obligation for legal). Generic schemas rarely earn the build.
GraphRAG deploys as a 12-16 week first build because graph construction over a real corpus is non-trivial. We size it as two phases: extract and validate the graph (slow), then build the retrieval layer (relatively fast once the graph is right).
Define the entity and relationship types with domain experts. The schema is the most expensive thing to change later; we get it right before any extraction runs.
LLM batch extraction over the corpus, structured output validated against the schema. Failed extractions logged and re-run with refined prompts; the bottom 5% of extractions usually need human review.
Load into the graph store. Validate against domain expert sample queries before going further. Adjustments to schema or extraction happen here, not later.
Hierarchical Leiden produces clusters from very local to global. Each level becomes a retrieval surface for different query specificity.
LLM summarises each community. Summaries embedded into pgvector. Manual review of a sample to catch bad summaries before production.
Vector search over summaries with resolution-aware ranking. Routes to the level of community detail that matches the question.
Expand selected communities, retrieve entities + relationships, synthesize with path-aware prompts. Output cites both passages and traversal paths.
Domain-expert golden set, accuracy gated in CI. Corpus updates trigger graph rebuilds (full or incremental) on a schedule the eval set defines.
Microsoft's published GraphRAG paper and its open-source implementation report consistent accuracy lifts on multi-hop benchmarks. Independent reproductions confirm the win in domains where multi-hop reasoning is the question.
We eval GraphRAG with a domain-expert curated golden set of multi-hop questions, where the expected answer cites a traversal path. Path correctness graded separately from final-answer faithfulness; both gate ship. Single-hop questions are kept in the set as a control to make sure we have not regressed on the easy cases.
GraphRAG went from research to production fast. Microsoft's open-source release set the reference shape; LangChain, LlamaIndex, and Neo4j ship native variants. Gartner lists it in the 2026 top data and analytics trends.
Practitioners report the same trade. The accuracy gain is real on multi-hop and regulated domains, sometimes dramatic. The build cost is also real: graph construction takes time, the LLM bill for extraction over a meaningful corpus is meaningful, and corpus updates require either incremental updates or periodic full rebuilds. Teams that ship GraphRAG successfully treat it as an offline-heavy / online-light split, where the expensive work happens during build and refresh, not at query time.
We reach for GraphRAG when the eval set demonstrably requires multi-hop reasoning, the corpus has strong entity structure, and the buyer cares about path-evidence in answers. All three need to be true.
The compounding effect we keep seeing: a domain that has clear entity structure (regulations, clinical, legal) also tends to be one where path-evidence matters in the answer (a compliance auditor wants the chain of regulations, not a paraphrase). That alignment is what makes the build cost pay off. In domains where entities exist but path-evidence does not matter, Advanced RAG with good metadata filters usually wins on cost.
Advanced RAG with strong metadata filtering when the corpus has entity structure but the queries do not actually require multi-hop. Agentic RAG when the corpus is heterogeneous and the question is which source rather than which path.
Most GraphRAG builds run Advanced RAG inside the community summaries layer.
Read playbookRelated patternOften a sub-tool of agents: 'use GraphRAG when the question is multi-hop'.
Read playbookRelated patternPost-check loop on top of GraphRAG for highest-stakes regulated work.
Read playbook