Skip to content

Repository files navigation

HyGRAG: A Unified Framework for Context-Aware and Relation-Aware Graph Retrieval-Augmented Generation

DOI License

The official implementation of HyGRAG, accepted at WWW 2026. [Paper]

Quick Start

Installation

conda env create -f experiment.yml
conda activate RAG

Or install dependencies via pip:

pip install -r requirements.txt

Configuration

Set 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: 8192

For 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"

Prepare Datasets

Download and place datasets under Data/<dataset_name>/ with the following structure:

  • Corpus.json — JSONL file with title, context, and id fields
  • Question.json — JSONL file with question, answer, and optional options / answer_idx fields

Refer to Data/datasets/README.md for detailed format specifications.

Run Methods

Run HyGRAG:

python main.py -opt Option/Ours/HKGraphTreeLSH.yaml -dataset_name multihop-rag

Incremental update evaluation:

python main_incremental.py -opt Option/Ours/HKGraphTreeDynamic.yaml -dataset_name multihop-rag -mode incremental -incremental_ratio 0.2

Resume with checkpoint:

python main_checkpoint.py -opt Option/Ours/HKGraphTreeLSH.yaml -dataset_name multihop-rag

Citation

If 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}
}

License

This project is licensed under the MIT License.

About

The code implementation of HyGRAG, accepted by WWW'26.

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages