Cache Mechanism for Agent RAG Systems

Shuhang Lin, Zhencan Peng, Lingyao Li, Xiao Lin, Xi Zhu, Yongfeng ZhangarXiv 2025 · OpenReview

Abstract

Recent advances in Large Language Model (LLM)-based agents have been propelled by Retrieval-Augmented Generation (RAG), which grants the models access to vast external knowledge bases. Despite RAG's success in improving agent performance, agent-level cache management, particularly constructing, maintaining, and updating a compact, relevant corpus dynamically tailored to each agent's need, remains underexplored. Therefore, we introduce ARC (Agent RAG Cache Mechanism), a novel, annotation-free caching framework that dynamically manages small, high-value corpora for each agent. By synthesizing historical query distribution patterns with the intrinsic geometry of cached items in the embedding space, ARC automatically maintains a high-relevance cache. With comprehensive experiments on three retrieval datasets, our experimental results demonstrate that ARC reduces storage requirements to 0.015% of the original corpus while offering up to 79.8% has-answer rate and reducing average retrieval latency by 80%. Our results demonstrate that ARC can drastically enhance efficiency and effectiveness in RAG-powered LLM agents.

1. Introduction

Retrieval-Augmented Generation (RAG) has become the gold standard for grounding Large Language Model (LLM) agents in factual data. However, as knowledge bases grow to terabyte scales, they become "heavy." Storing and searching millions of document embeddings requires high-performance disks and significant compute power, making it nearly impossible to deploy sophisticated agents on mobile phones or edge devices.

Existing caching solutions often rely on simple key-value pairs or basic frequency metrics (like LFU/FIFO). These methods ignore the rich semantic relationships inherent in vector embeddings. The Agent RAG Cache Mechanism (ARC) addresses this by building a compact, "high-value" local cache that understands which pieces of information are most likely to be useful based on both user behavior and the geometric structure of the data itself.

2. The ARC Framework

ARC manages a small local corpus for each agent using a "Combined Priority" score. This score is built from two innovative components:

  1. Distance–Rank Frequency (DRF) Score: Unlike traditional caches that just count how often an item is accessed, DRF considers how well it matched the query. It weights items higher if they appear at the top of retrieval results (rank) and are semantically close to the query (distance).
  2. Hubness Score: This is a query-agnostic metric based on high-dimensional geometry. In embedding spaces, certain points ("hubs") naturally appear as neighbors to many other points. ARC identifies these "semantically central" passages, assuming they contain more general knowledge relevant to the agent's domain.

2.1 The Escalation Mechanism

When a query arrives, the agent first checks its local ARC cache. If the average distance of the top results exceeds a "drift tolerance" (meaning the cache doesn't have a good match), the system "escalates" the request to the full external knowledge base, then updates the local cache with the new, high-value results.

The ARC Framework: Comparison of traditional vs. cached designs and the multi-agent ARCM schema.

3. Experimental Evaluation

To test the cache's effectiveness, the researchers simulated a massive environment using the 2023 Wikipedia Dump, consisting of over 6.4 million documents segmented into 14 million passages. Evaluation was conducted across three diverse question-answering datasets: SQuAD, MMLU, and AdversarialQA.

4. Key Results and Insights

  • Extreme Storage Efficiency: ARC reduced storage requirements to a mere 0.015% of the original corpus size. This suggests that for specific agent domains, the vast majority of a general knowledge base is essentially "distractor noise."
  • High Performance: Despite the tiny footprint, it achieved a 79.8% has-answer rate (the probability that the cache contains the information needed to answer the query).
  • Latency Reduction: The "Average Memory Access Time" (AMAT) was reduced by 80%. On the SQuAD dataset, retrieving from the full index took ~1.313s, while ARC took only 0.269s.
  • Geometry Matters: The use of Hubness demonstrates that the physical structure of the embedding space can predict which documents are "central" to a topic before a single user even asks a question.
  • Rank vs. Frequency: By incorporating retrieval rank, ARC ensures that a document only stays in the cache if it is consistently the best answer, outperforming standard policies like LFU, FIFO, and GPTCache.

5. Conclusion and Future Work

ARC provides a feasible path for deploying RAG-powered agents on resource-constrained devices. While the current evaluation focuses on single-turn QA, future work will explore multi-turn dialogues where context evolves and investigate cross-domain transferability to see how caches built for one domain (e.g., medicine) adapt to others (e.g., law).

Summary updated

BibTeX
@misc{lin2025cache,
  author = {Shuhang Lin and Zhencan Peng and Lingyao Li and Xiao Lin and Xi Zhu and Yongfeng Zhang},
  title = {{Cache Mechanism for Agent RAG Systems}},
  year = {2025},
  eprint = {2511.02919},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.02919},
}
Figure