HyGRAG: A Unified Framework for Context-Aware and Relation-Aware Graph Retrieval-Augmented Generation
The official implementation of HyGRAG, accepted at WWW 2026. [Paper]
conda env create -f experiment.yml
conda activate RAGOr install dependencies via pip:
pip install -r requirements.txtSet up your LLM and embedding configuration in Option/Config2.yaml:
llm:
api_type: "openai"
model: "gpt-4o"
base_url: "https://api.openai.com/v1"
api_key: "YOUR_API_KEY"
embedding:
api_type: "hf"
model: "./Embedding_Model/bge-m3"
dimensions: 1024
max_token_size: 8192For local models (vLLM / Ollama / LLaMA-Factory):
llm:
api_type: "open_llm"
model: "YOUR_MODEL_NAME"
base_url: "http://localhost:8000/v1"
api_key: "not-needed"Download and place datasets under Data/<dataset_name>/ with the following structure:
Corpus.json— JSONL file withtitle,context, andidfieldsQuestion.json— JSONL file withquestion,answer, and optionaloptions/answer_idxfields
Refer to Data/datasets/README.md for detailed format specifications.
Run HyGRAG:
python main.py -opt Option/Ours/HKGraphTreeLSH.yaml -dataset_name multihop-ragIncremental update evaluation:
python main_incremental.py -opt Option/Ours/HKGraphTreeDynamic.yaml -dataset_name multihop-rag -mode incremental -incremental_ratio 0.2Resume with checkpoint:
python main_checkpoint.py -opt Option/Ours/HKGraphTreeLSH.yaml -dataset_name multihop-ragIf you use HyGRAG in your research, please cite our paper:
@inproceedings{10.1145/3774904.3792720,
author = {Zhong, Haoyang and Sun, Yifei and Zhang, Antong and Wang, Chunping and Chen, Lei and Yang, Yang},
title = {A Unified Framework for Context-Aware and Relation-Aware Graph Retrieval-Augmented Generation},
year = {2026},
doi = {10.1145/3774904.3792720},
booktitle = {Proceedings of the ACM Web Conference 2026},
pages = {2477--2488},
series = {WWW '26}
}This project is licensed under the MIT License.