CaGR-RAG: Context-aware Query Grouping for Disk-based Vector Search in RAG Systems
Yeonwoo Jeong, Kyuli Park, Hyunji Cho, Sungyong Park
TL;DR
This work targets inefficiencies in disk-based vector search for Retrieval Augmented Generation (RAG) systems by addressing non-uniform cluster access patterns of queries. It introduces CaGR-RAG, a context-aware query grouping mechanism that uses the Jaccard similarity $J(q_i,q_j) = \frac{|C(q_i)\cap C(q_j)|}{|C(q_i)\cup C(q_j)|}$ with a threshold $\theta$ to cluster queries by shared cluster access and an opportunistic prefetch module to preload the next group’s clusters. Evaluations on BEIR-derived datasets with IVF FAISS show substantial improvements in tail latency (up to 51.55% at the 99th percentile) and higher, more stable cache hit ratios compared with the EdgeRAG baseline. The approach offers practical gains in retrieval latency for large-scale RAG deployments and is compatible with existing cache replacement strategies, providing a principled way to exploit query context for disk-based vector search.
Abstract
Modern embedding models capture both semantic and syntactic structures of queries, often mapping different queries to similar regions in vector space. This results in non-uniform cluster access patterns in disk-based vector search systems, particularly in Retrieval Augmented Generation (RAG) framework. While existing approaches optimize individual queries, they overlook the impact of cluster access patterns, failing to account for the locality effects of queries that access similar clusters. This oversight reduces cache efficiency and increases search latency due to excessive disk I/O. To address this, we introduce CaGR-RAG, a context-aware query grouping mechanism that organizes queries based on shared cluster access patterns. Additionally, it incorporates opportunistic cluster prefetching to minimize cache misses during transitions between query groups, further optimizing retrieval performance. Experimental results show that CaGR-RAG reduces 99th percentile tail latency by up to 51.55% while consistently maintaining a higher cache hit ratio than the baseline.
