GRAG: Graph Retrieval-Augmented Generation

Yuntong Hu, Zhihan Lei, Zheng Zhang, Bo Pan, Chen Ling +1 more
5/26/2024
cs.LG

Official code: HuieL/GRAG (63 stars, MIT, last commit 2025-07-10). 1 more implementation below.

Abstract

Naive Retrieval-Augmented Generation (RAG) focuses on individual documents during retrieval and, as a result, falls short in handling networked documents which are very popular in many applications such as citation graphs, social media, and knowledge graphs. To overcome this limitation, we introduce Graph Retrieval-Augmented Generation (GRAG), which tackles the fundamental challenges in retrieving textual subgraphs and integrating the joint textual and topological information into Large Language Models (LLMs) to enhance its generation. To enable efficient textual subgraph retrieval, we propose a novel divide-and-conquer strategy that retrieves the optimal subgraph structure in linear time. To achieve graph context-aware generation, incorporate textual graphs into LLMs through two complementary views-the text view and the graph view-enabling LLMs to more effectively comprehend and utilize the graph context. Extensive experiments on graph reasoning benchmarks demonstrate that in scenarios requiring multi-hop reasoning on textual graphs, our GRAG approach significantly outperforms current state-of-the-art RAG methods. Our datasets as well as codes of GRAG are available at https://github.com/HuieL/GRAG.

View on arXivView PDF

Code Implementations(2)

HuieL/GRAGOfficial100%
MIT
6310Shell, PythonMay 22, 20241 years agoMIT
microsoft/graphragCommunity72%
MIT

A modular graph-based Retrieval-Augmented Generation (RAG) system

34,7243,657HTML, JinjaMar 27, 20245 months agoMIT
gptgpt-4gpt4graphragllm+2 more

Similar Papers

Cite this paper

@article{hu2024grag,
  title  = {GRAG: Graph Retrieval-Augmented Generation},
  author = {Yuntong Hu and Zhihan Lei and Zheng Zhang and Bo Pan and Chen Ling and Liang Zhao},
  year   = {2024},
  eprint = {2405.16506},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.16506v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.16506.svg)](https://codeofpaper.com/paper/2405.16506)

Discussion