PathRAG: Pruning Graph-based Retrieval Augmented Generation with Relational Paths

Boyu Chen, Zirui Guo, Zidan Yang, Yuluo Chen, Junze Chen, Zhenghao Liu, Chuan Shi, Cheng Yang · OpenReview

Abstract

Retrieval-augmented generation (RAG) improves the response quality of large language models (LLMs) by retrieving knowledge from external databases. Typical RAG approaches split the text database into chunks, organizing them in a flat structure for efficient searches. To better capture the inherent dependencies and structured relationships across the text database, researchers propose to organize textual information into an indexing graph, known as graph-based RAG. However, we argue that the limitation of current graph-based RAG methods lies in the redundancy of the retrieved information, rather than its insufficiency. Moreover, previous methods use a flat structure to organize retrieved information within the prompts, leading to suboptimal performance. To overcome these limitations, we propose PathRAG, which retrieves key relational paths from the indexing graph, and converts these paths into textual form for prompting LLMs. Specifically, PathRAG effectively reduces redundant information with flow-based pruning, while guiding LLMs to generate more logical and coherent responses with path-based prompting. Experimental results show that PathRAG consistently outperforms state-of-the-art baselines across six datasets and five evaluation dimensions.

Introduction: The Challenge of Information Gluttony

While traditional RAG systems rely on flat text chunks, the evolution toward graph-based indexing (Graph-RAG) has allowed for capturing complex entity relationships. However, existing methods like GraphRAG and LightRAG often suffer from "information gluttony." These systems typically retrieve entire communities of nodes or exhaustive local neighborhoods, leading to significant redundancy and noise.

Comparison of retrieval strategies: (a) GraphRAG retrieves community-based clusters, (b) LightRAG retrieves local neighborhoods, and (c) PathRAG retrieves specific relational paths.

This redundancy creates three primary bottlenecks: high token costs, increased noise that distracts the LLM, and the "lost in the middle" phenomenon, where critical information is buried in disorganized prompts. PathRAG addresses these by shifting the focus from subgraphs to precise relational paths.

The PathRAG Methodology

PathRAG introduces a three-stage pipeline designed to extract the most relevant "connective tissue" from a knowledge base.

The PathRAG pipeline: from query keyword extraction to flow-based path retrieval and path-based prompting.

1. Node Retrieval

The system extracts keywords from a query and identifies the top-$N$ most relevant nodes in the indexing graph using dense vector embeddings.

2. Path Retrieval and Flow-Based Pruning

Instead of retrieving all neighboring nodes, PathRAG employs a flow-based pruning algorithm. This algorithm simulates "flow" between nodes to identify the most reliable connections. It incorporates a decay penalty ($\alpha$) to account for distance and an early stopping threshold ($\theta$) to eliminate paths with negligible information. This results in a set of ranked relational paths based on a calculated reliability score.

3. Path-Based Prompting

The retrieved paths are converted into a structured textual format (e.g., "Entity A -> Relationship -> Entity B"). To optimize LLM performance, PathRAG strategically orders these paths by reliability, placing the most critical information at the end of the prompt to leverage the natural prioritization of modern LLMs.

Experimental Evaluation

PathRAG was evaluated across six diverse datasets, including domain-specific fields (Legal, History, Biology) and long-context summarization tasks (SQuALITY, SummScreen). The model was compared against state-of-the-art baselines across five dimensions: Comprehensiveness, Diversity, Logicality, Relevance, and Coherence.

Key Results

  • Superior Performance: PathRAG achieved average win rates of 59.93% against GraphRAG and 57.09% against LightRAG.
  • Efficiency: A lightweight variant, PathRAG-lt, reduced token consumption by 40.41% compared to LightRAG while maintaining competitive performance.
  • Summarization Excellence: On the SQuALITY dataset, PathRAG demonstrated a 7.06% improvement over the best baseline in automated metrics like BLEU and ROUGE.
  • Robustness: The system remains effective even when the underlying graph is sparse, successfully finding alternative reasoning paths when up to 50% of edges are missing.

Conclusion

PathRAG demonstrates that in the context of graph-based retrieval, precision is more valuable than volume. By pruning redundant information and organizing retrieved data into logical relational paths, PathRAG significantly enhances the coherence and accuracy of LLM responses while reducing computational overhead. Future work will explore optimizing the initial graph construction phase and developing more human-centric evaluation metrics for graph-based RAG systems.

Summary updated

BibTeX
@misc{chen2025pathrag,
  author = {Boyu Chen and Zirui Guo and Zidan Yang and Yuluo Chen and Junze Chen and Zhenghao Liu and Chuan Shi and Cheng Yang},
  title = {{PathRAG: Pruning Graph-based Retrieval Augmented Generation with Relational Paths}},
  year = {2025},
  eprint = {2502.14902},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.14902},
}
Figure