QAFD-RAG

Query-Aware Framework
First principled flow diffusion for graph-based RAG with online query-aware edge weighting.
Provable Guarantees
Exponential convergence and recovery guarantees under mild signal-to-noise conditions.
State-of-the-Art Results
Leads in 96% of UltraDomain comparisons. Best F1 on HotpotQA & MuSiQue.

Approach Comparison

Query: “Introduce Steve Jobs’s products in Apple.”

GraphRAG
GraphRAG
Community Detection
LightRAG
LightRAG
One-Hop Entity-Centric
QAFD-RAG
QAFD-RAG (Ours)
Query-Aware Flow Diffusion

GraphRAG retrieves entire communities, mixing relevant and irrelevant nodes. LightRAG extracts 1-hop neighborhoods without semantic alignment. QAFD-RAG reweights edges by query meaning, suppressing irrelevant clusters (Amazon River, Apple fruit) and reinforcing reasoning paths (Apple → Mac → macOS). Edge thickness reflects weight; node color indicates importance.

Benchmarks

Evaluated on multi-hop QA, UltraDomain QA (11 domains), text-to-SQL, and long-document summarization. Full results in the paper.

Multi-hop QA

F1 on HotpotQA

Quick Start

Get running in minutes with pre-built knowledge graphs

# Option 1: Clone from HuggingFace (code + pre-built KGs)
git clone https://huggingface.co/tarzanagh/QAFD-RAG
cd QAFD-RAG

# Option 2: Clone from GitHub (code only) + download KGs
git clone https://github.com/Tarzanagh/QAFD-RAG.git
cd QAFD-RAG
huggingface-cli download tarzanagh/QAFD-RAG --include "kg/multihop/*" --local-dir .

# Install and run
pip install -r requirements.txt
export OPENAI_API_KEY="sk-..."
python benchmarks/run.py --task multihop --dataset musique --questions 10

BibTeX

@inproceedings{zhou2026qafd,
  title={Query-Aware Flow Diffusion for Graph-Based RAG with Retrieval Guarantees},
  author={Zhou, Zhuoping and Ataee Tarzanagh, Davoud and Didari, Sima and Hu, Wenjun
          and Gutow, Baruch and Verkholyak, Oxana and Faraki, Masoud and Hao, Heng
          and Moon, Hankyu and Min, Seungjai},
  booktitle={International Conference on Learning Representations (ICLR)},
  year={2026}
}