Distributed Semantic Cache Coordination for Retrieval-Augmented Generation Systems
摘要
Retrieval-Augmented Generation (RAG) systems enhance Large Language Models with external knowledge retrieval to produce more accurate responses. In practice, RAG services are often deployed in distributed, multi-tenant environments across geographically separated nodes to serve diverse user communities efficiently. Unfortunately, repeated or semantically similar queries issued by different tenants to different nodes can trigger redundant embedding, retrieval, and LLM inference—inflating both latency and cost. We introduce a Distributed Semantic Cache (DSC) coordination mechanism to mitigate this inefficiency. Every node keeps a local cache of query embeddings and answers and periodically exchanges a compact Bloom-filter summary of its keys with peers. On a miss, the node consults these summaries and forwards the query embedding only to peers that are likely to hold a semantically similar result, avoiding a central bottleneck and heavy network chatter. We prototype DSC in a discrete-event simulator built with SimPy, FastEmbed, and pybloom_live, modelling a four-node RAG cluster. Compared with a Centralised Exact-match Cache (CEC), DSC delivers up to 580% higher cache-hit rate and makes answers 3.4 \(\times \) faster on average, while adding only 3.6 MB per hour per node of coordination egress traffic per node. These results demonstrate that lightweight, embedding-aware coordination can substantially improve the efficiency and scalability of production-grade RAG deployments.