XRAG: eXamining the Core - Benchmarking Foundational Component Modules in Advanced Retrieval-Augmented Generation
305
stars
177
commits
Python
primary language
Sep 11, 2026
updated
Welcome developers, researchers, and enthusiasts to join the XRAG open-source project!
🙌 Your contributions—code, data, ideas, or feedback—are the heartbeat of XRAG!
Repository: https://github.com/DocAILab/XRAG
XRAG is a benchmarking framework designed to evaluate the foundational components of advanced Retrieval-Augmented Generation (RAG) systems. By dissecting and analyzing each core module, XRAG provides insights into how different configurations and components impact the overall performance of RAG systems.
🔍 Comprehensive Evaluation Framework:
⚙️ Flexible Architecture:
🤖 Multiple LLM Support:
📊 Rich Evaluation Metrics:
🎯 Advanced Retrieval Methods:
💻 User-Friendly Interface:
Orchestrators are used to organize and manage the execution logic and workflow of RAG components, thereby achieving agentic RAG methods in XRAG. As illustrated in figure, the XRAG framework includes five types of orchestrators: sequential, conditional, iterative, parallel, and hybrid.
XRAG provides an intuitive web interface for interactive evaluation and visualization. Launch it with:
xrag-cli webui
The WebUI guides you through the following workflow:
Upload and configure your datasets:
Configure system parameters and build indices:
Define your RAG pipeline components:
Test your RAG system interactively:
Before installing XRAG, ensure that you have Python 3.11 or later installed.
# Create a new conda environment
conda create -n xrag python=3.11
# Activate the environment
conda activate xrag
You can install XRAG directly using pip:
# Install XRAG
pip install examinationrag
# Install 'jury' without dependencies to avoid conflicts
pip install jury --no-deps
# Adjust some package versions
pip install requests==2.27.1
pip install urllib3==1.25.11
pip install jiwer<4.0.0
Here's how you can get started with XRAG:
Modify the config.toml file to set up your desired configurations.
xrag-cliAfter installing XRAG, the xrag-cli command becomes available in your environment. This command provides a convenient way to interact with XRAG without needing to call Python scripts directly.
xrag-cli [command] [options]
run: Runs the benchmarking process.
xrag-cli run [--override key=value ...]
webui: Launches the web-based user interface.
xrag-cli webui
ver: Displays the current version of XRAG.
xrag-cli version
help: Displays help information.
xrag-cli help
generate: Generate QA pairs from a folder.
xrag-cli generate -i <input_file> -o <output_file> -n <num_questions> -s <sentence_length>
api: Launch the API server for XRAG services.
xrag-cli api [--host <host>] [--port <port>] [--json_path <json_path>] [--dataset_folder <dataset_folder>]
Options:
--host: API server host address (default: 0.0.0.0)--port: API server port number (default: 8000)--json_path: Path to the JSON configuration file--dataset_folder: Path to the dataset folderOnce the API server is running, you can interact with it using HTTP requests. Here are the available endpoints:
Send a POST request to /query to get answers based on your documents:
curl -X POST "http://localhost:8000/query" \
-H "Content-Type: application/json" \
-d '{
"query": "your question here",
"top_k": 3
}'
Response format:
{
"answer": "Generated answer to your question",
"sources": [
{
"content": "Source document content",
"id": "document_id",
"score": 0.85
}
]
}
Check the API server status with a GET request to /health:
curl "http://localhost:8000/health"
Response format:
{
"status": "healthy",
"engine_status": "initialized"
}
The API service supports both custom JSON datasets and folder-based documents:
--json_path for JSON format QA datasets--dataset_folder for document folders--json_path and --dataset_folder at the same time.Use the --override flag followed by key-value pairs to override configuration settings:
xrag-cli run --override embeddings="new-embedding-model"
xrag-cli generate -i <input_file> -o <output_file> -n <num_questions> -s <sentence_length>
Automatically generate QA pairs from a folder.
XRAG uses a config.toml file for configuration management. Here's a detailed explanation of the configuration options:
[api_keys]
api_key = "sk-xxxx" # Your API key for LLM service
api_base = "https://xxx" # API base URL
api_name = "gpt-4o" # Model name
auth_token = "hf_xxx" # Hugging Face auth token
[settings]
llm = "openai" # openai, huggingface, ollama
ollama_model = "llama2:7b" # ollama model name
huggingface_model = "llama" # huggingface model name
embeddings = "BAAI/bge-large-en-v1.5"
split_type = "sentence"
chunk_size = 128
dataset = "hotpot_qa"
persist_dir = "storage"
# ... additional settings ...
Dependency Conflicts: If you encounter dependency issues, ensure that you have the correct versions specified in requirements.txt and consider using a virtual environment.
Invalid Configuration Keys: Ensure that the keys you override match exactly with those in the config.toml file.
Data Type Mismatches: When overriding configurations, make sure the values are of the correct data type (e.g., integers, booleans).
xrag-cli command-line tool.We value feedback from our users. If you have suggestions, feature requests, or encounter issues:
Organizers: Qianren Mao, Yangyifei Luo (罗杨一飞), Qili Zhang (张启立), Yashuo Luo (罗亚硕), Zhilong Cao(曹之龙), Jinlong Zhang (张金龙), Hanwen Hao (郝瀚文), Zhenting Huang (黄振庭), Feng Yan(闫丰), Weifeng Jiang (蒋为峰).
This project is inspired by RAGLAB, FlashRAG, FastRAG, AutoRAG, LocalRAG.
We are deeply grateful for the following external libraries, which have been pivotal to the development and functionality of our project: LlamaIndex, Hugging Face Transformers.
If you find this work helpful, please cite our paper:
@article{mao2025xragexaminingcore,
title={XRAG: eXamining the Core -- Benchmarking Foundational Components in Advanced Retrieval-Augmented Generation},
author={Qianren Mao and Yangyifei Luo and Qili Zhang and Yashuo Luo and Zhilong Cao and Jinlong Zhang and HanWen Hao and Zhijun Chen and Weifeng Jiang and Junnan Liu and Xiaolong Wang and Zhenting Huang and Zhixing Tan and Sun Jie and Bo Li and Xudong Liu and Richong Zhang and Jianxin Li},
year={2025},
eprint={2412.15529},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2412.15529},
}
Thank you for using XRAG! We hope it proves valuable in your research and development efforts in the field of Retrieval-Augmented Generation.
Python
100.0%
XRAG: eXamining the Core - Benchmarking Foundational Component Modules in Advanced Retrieval-Augmented Generation
305
stars
177
commits
Python
primary language
Sep 11, 2026
updated
Welcome developers, researchers, and enthusiasts to join the XRAG open-source project!
🙌 Your contributions—code, data, ideas, or feedback—are the heartbeat of XRAG!
Repository: https://github.com/DocAILab/XRAG
XRAG is a benchmarking framework designed to evaluate the foundational components of advanced Retrieval-Augmented Generation (RAG) systems. By dissecting and analyzing each core module, XRAG provides insights into how different configurations and components impact the overall performance of RAG systems.
🔍 Comprehensive Evaluation Framework:
⚙️ Flexible Architecture:
🤖 Multiple LLM Support:
📊 Rich Evaluation Metrics:
🎯 Advanced Retrieval Methods:
💻 User-Friendly Interface:
Orchestrators are used to organize and manage the execution logic and workflow of RAG components, thereby achieving agentic RAG methods in XRAG. As illustrated in figure, the XRAG framework includes five types of orchestrators: sequential, conditional, iterative, parallel, and hybrid.
XRAG provides an intuitive web interface for interactive evaluation and visualization. Launch it with:
xrag-cli webui
The WebUI guides you through the following workflow:
Upload and configure your datasets:
Configure system parameters and build indices:
Define your RAG pipeline components:
Test your RAG system interactively:
Before installing XRAG, ensure that you have Python 3.11 or later installed.
# Create a new conda environment
conda create -n xrag python=3.11
# Activate the environment
conda activate xrag
You can install XRAG directly using pip:
# Install XRAG
pip install examinationrag
# Install 'jury' without dependencies to avoid conflicts
pip install jury --no-deps
# Adjust some package versions
pip install requests==2.27.1
pip install urllib3==1.25.11
pip install jiwer<4.0.0
Here's how you can get started with XRAG:
Modify the config.toml file to set up your desired configurations.
xrag-cliAfter installing XRAG, the xrag-cli command becomes available in your environment. This command provides a convenient way to interact with XRAG without needing to call Python scripts directly.
xrag-cli [command] [options]
run: Runs the benchmarking process.
xrag-cli run [--override key=value ...]
webui: Launches the web-based user interface.
xrag-cli webui
ver: Displays the current version of XRAG.
xrag-cli version
help: Displays help information.
xrag-cli help
generate: Generate QA pairs from a folder.
xrag-cli generate -i <input_file> -o <output_file> -n <num_questions> -s <sentence_length>
api: Launch the API server for XRAG services.
xrag-cli api [--host <host>] [--port <port>] [--json_path <json_path>] [--dataset_folder <dataset_folder>]
Options:
--host: API server host address (default: 0.0.0.0)--port: API server port number (default: 8000)--json_path: Path to the JSON configuration file--dataset_folder: Path to the dataset folderOnce the API server is running, you can interact with it using HTTP requests. Here are the available endpoints:
Send a POST request to /query to get answers based on your documents:
curl -X POST "http://localhost:8000/query" \
-H "Content-Type: application/json" \
-d '{
"query": "your question here",
"top_k": 3
}'
Response format:
{
"answer": "Generated answer to your question",
"sources": [
{
"content": "Source document content",
"id": "document_id",
"score": 0.85
}
]
}
Check the API server status with a GET request to /health:
curl "http://localhost:8000/health"
Response format:
{
"status": "healthy",
"engine_status": "initialized"
}
The API service supports both custom JSON datasets and folder-based documents:
--json_path for JSON format QA datasets--dataset_folder for document folders--json_path and --dataset_folder at the same time.Use the --override flag followed by key-value pairs to override configuration settings:
xrag-cli run --override embeddings="new-embedding-model"
xrag-cli generate -i <input_file> -o <output_file> -n <num_questions> -s <sentence_length>
Automatically generate QA pairs from a folder.
XRAG uses a config.toml file for configuration management. Here's a detailed explanation of the configuration options:
[api_keys]
api_key = "sk-xxxx" # Your API key for LLM service
api_base = "https://xxx" # API base URL
api_name = "gpt-4o" # Model name
auth_token = "hf_xxx" # Hugging Face auth token
[settings]
llm = "openai" # openai, huggingface, ollama
ollama_model = "llama2:7b" # ollama model name
huggingface_model = "llama" # huggingface model name
embeddings = "BAAI/bge-large-en-v1.5"
split_type = "sentence"
chunk_size = 128
dataset = "hotpot_qa"
persist_dir = "storage"
# ... additional settings ...
Dependency Conflicts: If you encounter dependency issues, ensure that you have the correct versions specified in requirements.txt and consider using a virtual environment.
Invalid Configuration Keys: Ensure that the keys you override match exactly with those in the config.toml file.
Data Type Mismatches: When overriding configurations, make sure the values are of the correct data type (e.g., integers, booleans).
xrag-cli command-line tool.We value feedback from our users. If you have suggestions, feature requests, or encounter issues:
Organizers: Qianren Mao, Yangyifei Luo (罗杨一飞), Qili Zhang (张启立), Yashuo Luo (罗亚硕), Zhilong Cao(曹之龙), Jinlong Zhang (张金龙), Hanwen Hao (郝瀚文), Zhenting Huang (黄振庭), Feng Yan(闫丰), Weifeng Jiang (蒋为峰).
This project is inspired by RAGLAB, FlashRAG, FastRAG, AutoRAG, LocalRAG.
We are deeply grateful for the following external libraries, which have been pivotal to the development and functionality of our project: LlamaIndex, Hugging Face Transformers.
If you find this work helpful, please cite our paper:
@article{mao2025xragexaminingcore,
title={XRAG: eXamining the Core -- Benchmarking Foundational Components in Advanced Retrieval-Augmented Generation},
author={Qianren Mao and Yangyifei Luo and Qili Zhang and Yashuo Luo and Zhilong Cao and Jinlong Zhang and HanWen Hao and Zhijun Chen and Weifeng Jiang and Junnan Liu and Xiaolong Wang and Zhenting Huang and Zhixing Tan and Sun Jie and Bo Li and Xudong Liu and Richong Zhang and Jianxin Li},
year={2025},
eprint={2412.15529},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2412.15529},
}
Thank you for using XRAG! We hope it proves valuable in your research and development efforts in the field of Retrieval-Augmented Generation.
Python
100.0%