Codes for the paper titled "ProgRAG: Hallucination-Resistant Progressive Retrieval and Reasoning over Knowledge Graphs", published in the 40th Annual AAAI Conference on Artificial Intelligence (AAAI'2026).

# 1. Create and activate a new conda environment
conda create -n ProgRAG python=3.8 -y
conda activate ProgRAG
# 2. Install PyTorch with CUDA 11.8 support
conda install pytorch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 pytorch-cuda=11.8 -c pytorch -c nvidia
# 3. Install PyTorch Geometric and related packages
pip install torch-scatter==2.1.1 torch-sparse==0.6.17 torch-cluster==1.6.1 torch-spline-conv==1.2.1 -f https://data.pyg.org/whl/torch-2.2.1+cu118.html
pip install torch-geometric==2.3.0
# 4. Install additional dependencies
conda install ninja easydict pyyaml -c conda-forge
# 5. Install compatible Hugging Face packages
# These versions are tested for Python 3.8
pip install transformers==4.46.3 tokenizers==0.20.0 huggingface_hub==0.36.0 safetensors==0.5.3
# 6. Install Sentence Transformers and Datasets
pip install "sentence-transformers[train]==3.0.1" datasets==2.14.7
To run experiments, download the required Knowledge Graph datasets and checkpoints for:
You can download all necessary files from the following Google Drive link: https://drive.google.com/drive/folders/1BVvQRNTaLdONEeFauZfxPYQXQSpCVuNm?usp=drive_link
After downloading, the files should be placed as follows:
data/
βββ webqsp/
βββ total_graph_webqsp.jsonl
βββ webqsp_topic_graph.pkl
βββ train_goldenpath.jsonl
βββ relation.pth
βββ webqsp_triple2id.pkl
βββ cwq/
βββ total_graph_cwq.jsonl
βββ cwq_topic_graph.pkl
βββ train_goldenpath.jsonl
βββ relation.pth
βββ cwq_triple2id.pkl
ckpt/
βββ GNN/
β βββ webqsp_GNN.pth
β βββ cwq_GNN.pth
βββ mpnet/
β βββ webqsp.mdl
β βββ cwq.mdl
βββ sbert/
Alternatively, you can preprocess the datasets using the following commands:
python3 graph_preprocess.py
python3 GNN/get_emb.py
You can train the GNN and MPNet (Triple Retrievers) using the following commands:
python3 GNN/gnn_train.py
python3 MPNet/[dataset].sh
python main.py --dataset [DATASET_NAME]
Replace [DATASET_NAME] with the name of the dataset you want to use (e.g., webqsp, cwq, etc.).
68 commits
44 commits
Python
85.2%
C++
7.2%
Cuda
7.2%
Codes for the paper titled "ProgRAG: Hallucination-Resistant Progressive Retrieval and Reasoning over Knowledge Graphs", published in the 40th Annual AAAI Conference on Artificial Intelligence (AAAI'2026).

# 1. Create and activate a new conda environment
conda create -n ProgRAG python=3.8 -y
conda activate ProgRAG
# 2. Install PyTorch with CUDA 11.8 support
conda install pytorch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 pytorch-cuda=11.8 -c pytorch -c nvidia
# 3. Install PyTorch Geometric and related packages
pip install torch-scatter==2.1.1 torch-sparse==0.6.17 torch-cluster==1.6.1 torch-spline-conv==1.2.1 -f https://data.pyg.org/whl/torch-2.2.1+cu118.html
pip install torch-geometric==2.3.0
# 4. Install additional dependencies
conda install ninja easydict pyyaml -c conda-forge
# 5. Install compatible Hugging Face packages
# These versions are tested for Python 3.8
pip install transformers==4.46.3 tokenizers==0.20.0 huggingface_hub==0.36.0 safetensors==0.5.3
# 6. Install Sentence Transformers and Datasets
pip install "sentence-transformers[train]==3.0.1" datasets==2.14.7
To run experiments, download the required Knowledge Graph datasets and checkpoints for:
You can download all necessary files from the following Google Drive link: https://drive.google.com/drive/folders/1BVvQRNTaLdONEeFauZfxPYQXQSpCVuNm?usp=drive_link
After downloading, the files should be placed as follows:
data/
βββ webqsp/
βββ total_graph_webqsp.jsonl
βββ webqsp_topic_graph.pkl
βββ train_goldenpath.jsonl
βββ relation.pth
βββ webqsp_triple2id.pkl
βββ cwq/
βββ total_graph_cwq.jsonl
βββ cwq_topic_graph.pkl
βββ train_goldenpath.jsonl
βββ relation.pth
βββ cwq_triple2id.pkl
ckpt/
βββ GNN/
β βββ webqsp_GNN.pth
β βββ cwq_GNN.pth
βββ mpnet/
β βββ webqsp.mdl
β βββ cwq.mdl
βββ sbert/
Alternatively, you can preprocess the datasets using the following commands:
python3 graph_preprocess.py
python3 GNN/get_emb.py
You can train the GNN and MPNet (Triple Retrievers) using the following commands:
python3 GNN/gnn_train.py
python3 MPNet/[dataset].sh
python main.py --dataset [DATASET_NAME]
Replace [DATASET_NAME] with the name of the dataset you want to use (e.g., webqsp, cwq, etc.).
68 commits
44 commits
Python
85.2%
C++
7.2%
Cuda
7.2%