HyperGraphRAG
[NeurIPS 2025] Official resources of "HyperGraphRAG: Retrieval-Augmented Generation via Hypergraph-Structured Knowledge Representation".
Install / Use
/learn @LHRLAB/HyperGraphRAGREADME
HyperGraphRAG
Official resources of "HyperGraphRAG: Retrieval-Augmented Generation via Hypergraph-Structured Knowledge Representation". Haoran Luo, Haihong E, Guanting Chen, Yandan Zheng, Xiaobao Wu, Yikai Guo, Qika Lin, Yu Feng, Zemin Kuang, Meina Song, Yifan Zhu, Luu Anh Tuan. NeurIPS 2025 [paper].
Overview

Environment Setup
conda create -n hypergraphrag python=3.11
conda activate hypergraphrag
pip install -r requirements.txt
Quick Start
Knowledge HyperGraph Construction
import os
import json
from hypergraphrag import HyperGraphRAG
os.environ["OPENAI_API_KEY"] = "your_openai_api_key"
rag = HyperGraphRAG(working_dir=f"expr/example")
with open(f"example_contexts.json", mode="r") as f:
unique_contexts = json.load(f)
rag.insert(unique_contexts)
Knowledge HyperGraph Query
import os
from hypergraphrag import HyperGraphRAG
os.environ["OPENAI_API_KEY"] = "your_openai_api_key"
rag = HyperGraphRAG(working_dir=f"expr/example")
query_text = 'How strong is the evidence supporting a systolic BP target of 120–129 mmHg in elderly or frail patients, considering potential risks like orthostatic hypotension, the balance between cardiovascular benefits and adverse effects, and the feasibility of implementation in diverse healthcare settings?'
result = rag.query(query_text)
print(result)
For evaluation, please refer to the evaluation folder.
BibTex
If you find this work is helpful for your research, please cite:
@misc{luo2025hypergraphrag,
title={HyperGraphRAG: Retrieval-Augmented Generation via Hypergraph-Structured Knowledge Representation},
author={Haoran Luo and Haihong E and Guanting Chen and Yandan Zheng and Xiaobao Wu and Yikai Guo and Qika Lin and Yu Feng and Zemin Kuang and Meina Song and Yifan Zhu and Luu Anh Tuan},
year={2025},
eprint={2503.21322},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2503.21322},
}
For further questions, please contact: haoran.luo@ieee.org.
Acknowledgement
This repo benefits from LightRAG, Text2NKG, and HAHE. Thanks for their wonderful works.
Related Skills
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
