Skip to content

Repository files navigation

CacheRAG

This is the repository for the CacheRAG: A Novel Approach to Enhance KG-based RAG Through Caching Mechanisms.

Install

$ git clone [link to repo]
$ cd CacheRAG-code
$ pip install -r requirements.txt 

If you are using Anaconda, you can create a virtual environment and install all the packages:

$ conda create --name CacheRAG python=3.9
$ conda activate CacheRAG
$ pip install -r requirements.txt

Dataset

Set up the mock api server for CRAG, according to the instructions here: https://github.com/ysunbp/CacheRAG-code/tree/main/mockapi

Unzip CacheRAG-20260705T031737Z-3-001.zip to get the data folder, results folder, and utils/CRAG_raw

Experiments

CRAG

Please follow the these steps to perform KBQA on CRAG

$ cd scripts
$ python crag-cacherag-deepseek-exp.py
$ python crag-cacherag-deepseek-eval.py

QALD-10-en / CWQ / WebQSP

Please set up the Wikisp model first in the sparql-based folder and then follow the following instructions.

$ cd sparql-based
$ python auto-gen-sparql.py
$ python -m torch.distributed.run --nproc_per_node 1 CacheRAG-QALD.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages