Index-RAG: Storing Text Locations in Vector Databases for Question-Answering Tasks
This paper introduces Index-RAG (i-RAG), a novel approach to retrieval-augmented generation (RAG) that addresses the significant limitation of citation accuracy in existing RAG systems. Traditional RAG implementations struggle to provide precise source locations for retrieved information, commonly resulting in imprecise, unreliable, or nonexistent citations. I-RAG addresses this limitation by storing document location metadata, including filename, page number, and line number, directly within vector databases alongside content embeddings. The system processes documents at the paragraph level and stores embeddings for both document chunks and associated query expansions coupled with fine-grained location metadata. A multi-vector storage strategy creates multiple semantic entry points per document without duplicating raw text, thereby preserving storage efficiency. Through systematic evaluation, i-RAG achieves a 25.0% relative improvement in Precision@1 and an 11.86% improvement in MRR over a conventional RAG baseline, while also improving Precision@5 and nDCG@10, demonstrating consistent retrieval gains across all measured metrics. The source code is available at github.com/Pro-GenAI/Index-RAG.