Hyper-RAG  by iMoonLab

RAG framework combating LLM hallucinations

Created 1 year ago
263 stars

Top 96.8% on SourcePulse

GitHubView on GitHub
Project Summary

Hyper-RAG addresses the critical issue of Large Language Model (LLM) hallucinations, particularly in high-stakes domains like medicine, by employing a novel hypergraph-driven Retrieval-Augmented Generation (RAG) approach. It aims to enhance LLM accuracy and reliability by comprehensively modeling complex relationships within domain-specific knowledge, benefiting researchers and developers building robust AI applications.

How It Works

Hyper-RAG utilizes hypergraphs to model relationships among entities in a knowledge base, capturing not only pairwise but also higher-order, "beyond-pairwise" correlations. This approach is advantageous as it avoids the information loss inherent in traditional graph models that only consider pairwise connections. By integrating natively with Hypergraph-DB, it enables rapid retrieval of these complex associations, feeding richer context into LLMs to generate more factually grounded responses and mitigate hallucinations.

Quick Start & Requirements

  • Installation: Clone the repository and install dependencies via pip install -r requirements.txt.
  • Prerequisites: Requires configuration of LLM and embedding model API URLs and keys (e.g., gpt-4o-mini, text-embedding-3-small). Data download and preprocessing steps are necessary. Docker is available for Web UI deployment.
  • Links: GitHub Repository, Paper, Docker Deployment Guide.

Highlighted Details

  • Achieves an average accuracy improvement of 12.3% over direct LLM use on the NeurologyCorp dataset.
  • Outperforms Graph RAG and Light RAG by 6.3% and 6.0% respectively, with a 35.5% improvement over Light RAG on nine diverse datasets via selection-based assessment.
  • Maintains stable performance with increasing query complexity, unlike existing methods.
  • Hyper-RAG-Lite offers twice the retrieval speed of Light RAG with a 3.3% performance boost.

Maintenance & Community

The project is maintained by iMoon-Lab at Tsinghua University. Key contributors are listed, and the project acknowledges its reliance on LightRAG and Hypergraph-DB. Contact is available via email for inquiries. No specific community channels (e.g., Discord, Slack) are listed.

Licensing & Compatibility

Licensed under the Apache 2.0 license, which is permissive for commercial use and integration into closed-source projects.

Limitations & Caveats

The scoring-based evaluation method requires reference answers, leveraging source chunks as references. The selection-based evaluation is comparative, suitable only for evaluating two models at a time.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
13 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.