This repository contains the source code for the paper:
MA-RAG: Multi-Agent Retrieval-Augmented Generation via Collaborative Chain-of-Thought Reasoning.
To set up the environment, install the required dependencies using the requirements.txt file:
pip install -r requirements.txtBefore running any experiments, set up your OpenAI API key and model name in a .env file:
OPENAI_API_KEY=your_openai_api_key_here
MODEL_NAME=gpt-4oYou can either export them manually or use a .env loader.
Run the following command to embed the corpus:
python corpus/embed_corpus.pyExecute the main experiment with the following command:
python main.py --model gpt4omini --dataset hotpotqa --exp plan_rag_extract --gpus 0 1If you use this code, please cite the paper:
@article{marag2025,
title={MA-RAG: Multi-Agent Retrieval-Augmented Generation via Collaborative Chain-of-Thought Reasoning},
author={Thang Nguyen, Peter Chin, Yu-Wing Tai},
year={2025},
journal={arXiv preprint arXiv:2505.20096},
}