GraphRAG
GraphRAG is an advanced paradigm of Retrieval-Augmented Generation (RAG) that utilizes a knowledge graph (Knowledge Graph, KG) instead of traditional search over disconnected text fragments (chunks)[1]. The graph structure explicitly represents the connections between entities and the hierarchy of domain concepts, allowing LLMs to perform multi-step logical knowledge retrieval and generate more context-aware and explainable answers[2].
The GraphRAG approach demonstrates a significant advantage over classic RAG when dealing with complex, multi-hop queries where the answer depends on a combination of multiple facts scattered across different documents[3].
Limitations of Classic RAG and the Advantages of a Graph
Classic RAG, based on vector search over unstructured text, faces several fundamental limitations that become critical in complex enterprise scenarios:
- Lack of Structural Connections: Traditional RAG treats text chunks as isolated units and does not see the explicit relationships between them. This makes it inefficient for multi‑hop queries where answering requires traversing a chain of facts (A→B→C), but the search only finds the start and end links (A and C), missing the intermediate steps[1].
- Semantic Ambiguity: In highly specialized domains (medicine, law, engineering), terms have specific meanings. Vector search, while capturing the general topic, may misinterpret the role of a particular entity, leading to the retrieval of irrelevant context.
- Limited Explainability: Classic RAG provides document snippets but not explicit evidence of how these fragments are logically connected. GraphRAG, in contrast, makes this process transparent by providing the path in the graph as evidence and requiring that claims be tied to their sources (citation)[4].
GraphRAG addresses these problems by representing knowledge as a network of connected entities and relationships, which allows the system not just to find similar text but to perform logical inference based on a formalized model of the subject domain.
GraphRAG Architecture
The general GraphRAG pipeline extends classic RAG by adding stages for building and using a knowledge graph. It is divided into two main phases: offline preparation and online query processing.
Stage 1: Ingestion and Indexing (Offline)
In this stage, source data (documents, databases) is transformed into two complementary representations: a graph and a vector index.
- Knowledge Extraction: Structured facts are extracted from texts using an NLP pipeline:
- Named Entity Recognition (NER): Finding mentions of entities (people, organizations, products).
- Entity Linking (EL): Linking mentions to canonical identifiers in the graph to resolve ambiguity (e.g., "John Smith" and "J. Smith" become the same node)[5].
- Relation Extraction (RE): Identifying relationships between entities (e.g., Company X −acquired→ Startup Y).
- Graph Modeling and Storage: The extracted triples (subject-predicate-object) are loaded into a graph database. The choice of model (Property Graph or RDF) depends on the task. It is critical to store the provenance of each fact—a link to the source document and text fragment[3]. Metadata about time (valid_from/valid_to) and confidence can also be added to the graph.
- Hybrid Indexing: In parallel with the graph, a vector index is created for the original text fragments. This allows combining structural search on the graph with semantic search on the text.
Stage 2: Query Processing and Response Generation (Online)
- Query Parsing: The user's query is analyzed to identify key entities, which serve as "entry points" into the graph.
- Subgraph Retrieval: Instead of searching for individual chunks, GraphRAG finds a relevant subgraph—a connected portion of the graph around the "entry points" that contains information needed for the answer. Algorithms such as k-hop traversal or Personalized PageRank (PPR) are used for this purpose[6].
- Hybrid Search and Result Fusion: In parallel with subgraph retrieval, a search is performed on the vector and/or lexical (BM25) index. The results from the graph and the text are combined and passed to the next stage.
- Re-ranking: The combined list of candidates (graph nodes and text chunks) is re-ranked using a more precise model (e.g., a cross-encoder) to select the most relevant information. This helps filter out noise and improve accuracy[7].
- Context Packaging and Generation: The selected and ranked context (subgraph and texts) is converted into a format that the LLM can understand (e.g., a list of statements with source citations). This enriched context is fed into the prompt to generate the final answer.
- Traceability and Citation: Thanks to the "fact ↔ source" link in the graph, the generated answer contains precise references to the documents that support each claim. This ensures high groundedness and transparency.
Comparative Table of Components
| Component/Aspect | Implementation Options | Pros | Cons/Risks | When Preferred |
|---|---|---|---|---|
| Knowledge Graph Model | RDF/OWL | Strict ontology, logical reasoning, compatibility with Linked Open Data. | Difficult to store attributes of relationships (time, source) without additional entities (reification). | Semantically rich domains with existing ontologies; when deduction is required. |
| Property Graph (Neo4j, etc.) | Flexibility, arbitrary properties on nodes/edges, high performance. | Requires a clear schema manually or risks becoming disorganized; no single standard. | Quick start with unstructured data; integration with documents (multi-model DB). | |
| Subgraph Retrieval | k‑hop BFS / DFS | Covers all nodes up to depth k, simple to implement. | Graph "explosion": exponential growth in the number of nodes; can return a lot of noise. | Small graphs or traversal to a depth of 1–2; hierarchical structures. |
| Personalized PageRank (PPR) | Focuses on truly relevant nodes, filtering out noise[6]. | May miss a distant but important node (if there are few paths, but it is critical). | Complex networks with many paths (social graphs, citation graphs). | |
| Hybrid Search | Combined list (scalar fusion with weight λ) | Adjusting weights λ allows balancing precision/recall for the task[8]. | A fixed λ is not optimal for all query types. | During the prototyping phase; when one source is known to be significantly more important. |
| Cross‑encoder rerank | Significant accuracy boost; ability to consider complex interdependencies. | Increases latency; requires data for training or the use of pre-trained models[7]. | High-precision scenarios (law, medicine) where the most relevant context is crucial. | |
| Data Security | Subgraph filtering (RBAC/ABAC) | Granular control (down to the node level) prevents leaks. | "Blind spots": if an important node is filtered out, the answer may become incomplete. | In enterprise environments with strict access requirements (PII, GDPR, trade secrets). |
Traceability, Trust, and Security
One of the main advantages of GraphRAG is the ability to present transparent chains of evidence. Instead of a "black box" answer, the system can show its reasoning path: "Fact A is mentioned in [doc1]. It is related to fact B [doc2], and B, according to [doc3], leads to C." This increases user trust and simplifies debugging.
Furthermore, the graph structure allows for the implementation of granular access control (RBAC/ABAC). Each node or edge in the graph can have an access label. When retrieving a subgraph, the system automatically filters out data that the user is not authorized to see, ensuring security in sensitive areas (finance, HR, medicine).
Quality Evaluation
Evaluating a GraphRAG system is a multi-stage process that includes metrics for each component:
- Knowledge Extraction Metrics: F1-score for NER and RE to assess the quality of the graph construction.
- Subgraph Retrieval Metrics: Subgraph Recall@K (the proportion of cases where the nodes/edges needed for the answer are included in the retrieved subgraph) and Path Precision/Recall for multi-hop questions.
- LLM Response Metrics:
- Faithfulness / Groundedness: How strictly the answer is based on the provided context.
- Human evaluation: Assessment by experts based on criteria of correctness, completeness, and coherence.
To automate evaluation, specialized benchmarks (e.g., WebQuestionsSP, GrailQA) and frameworks (e.g., RAGAS) are used[9].
External links
See also
Literature
- Zhang, Q. et al. (2025). A Survey of Graph Retrieval‑Augmented Generation for Customized Large Language Models. arXiv:2501.13958.
- Xu, Z. et al. (2024). Retrieval‑Augmented Generation with Knowledge Graphs for Customer Service Question Answering. arXiv:2404.17723.
- Hu, Y. et al. (2024). GRAG: Graph Retrieval‑Augmented Generation. arXiv:2405.16506.
- Nakano, R. et al. (2021). WebGPT: Browser‑assisted Question‑Answering with Human Feedback. arXiv:2112.09332.
- Yang, R. et al. (2025). KG‑IRAG: A Knowledge Graph‑Based Iterative Retrieval‑Augmented Generation Framework for Temporal Reasoning. arXiv:2503.14234.
- Song, Y. et al. (2023). Advancements in Complex Knowledge Graph Question Answering: A Survey. DOI:10.3390/electronics12214395.
- Nogueira, R.; Cho, K. (2019). Passage Re‑ranking with BERT. arXiv:1901.04085.
- Hsu, H.‑L.; Tzeng, J. (2025). DAT: Dynamic Alpha Tuning for Hybrid Retrieval in Retrieval‑Augmented Generation. arXiv:2503.23013.
- Lewis, P. et al. (2020). Retrieval‑Augmented Generation for Knowledge‑Intensive NLP Tasks. arXiv:2005.11401.
- Karpukhin, V. et al. (2020). Dense Passage Retrieval for Open‑Domain Question Answering. arXiv:2004.04906.
- Sun, H. et al. (2018). Open‑Domain Question Answering Using Early Fusion of Knowledge Bases and Text (GRAFT‑Net). arXiv:1809.00782.
- Sun, H.; Bedrax‑Weiss, T.; Cohen, W. W. (2019). PullNet: Open‑Domain Question Answering with Iterative Retrieval on Knowledge Bases and Text. arXiv:1904.09537.
- He, X. et al. (2024). G‑Retriever: Retrieval‑Augmented Generation for Textual Graph Understanding and Question Answering. arXiv:2402.07630.
- Es, S.; James, J.; Espinosa‑Anke, L.; Schockaert, S. (2024). RAGAs: Automated Evaluation of Retrieval Augmented Generation. ACL:2024.eacl-demo.16.
References
- ↑ 1.0 1.1 Zhang, Q., et al. A Survey of Graph Retrieval-Augmented Generation for Customized Large Language Models. arXiv, 2025. arXiv:2501.13958.
- ↑ Xu, Z., et al. Retrieval-Augmented Generation with Knowledge Graphs for Customer Service Question Answering. SIGIR, 2024. arXiv:2404.17723; DOI: 10.1145/3626772.3661370.
- ↑ 3.0 3.1 Hu, Y., et al. GRAG: Graph Retrieval‑Augmented Generation. arXiv, 2024. arXiv:2405.16506; also in Findings of NAACL 2025: ACL Anthology.
- ↑ Nakano, R., et al. WebGPT: Browser‑assisted question‑answering with human feedback. arXiv, 2021. arXiv:2112.09332.
- ↑ Yang, R., et al. KG‑IRAG: A Knowledge Graph‑Based Iterative Retrieval‑Augmented Generation Framework for Temporal Reasoning. arXiv, 2025. arXiv:2503.14234.
- ↑ 6.0 6.1 Song, Y., Li, W., Dai, G., Shang, X. Advancements in Complex Knowledge Graph Question Answering: A Survey. Electronics, 2023. DOI: 10.3390/electronics12214395.
- ↑ 7.0 7.1 Nogueira, R., Cho, K. Passage Re‑ranking with BERT. arXiv, 2019. arXiv:1901.04085.
- ↑ Hsu, H.‑L.; Tzeng, J. DAT: Dynamic Alpha Tuning for Hybrid Retrieval in Retrieval‑Augmented Generation. arXiv, 2025. arXiv:2503.23013.
- ↑ Es, S.; James, J.; Espinosa Anke, L.; Schockaert, S. RAGAs: Automated Evaluation of Retrieval Augmented Generation. EACL (System Demonstrations), 2024. ACL:2024.eacl-demo.16; also preprint: arXiv:2309.15217.