Cortex: Achieving Low-Latency, Cost-Efficient Remote Data Access For LLM via Semantic-Aware Knowledge Caching
Chaoyi Ruan (National University of Singapore), Chao Bi (University of Science and Technology of China), Kaiwen Zheng (University of Toronto), Ziji Shi (National University of Singapore), Xinyi Wan (Sea AI Lab and National University of Singapore), Jialin Li (National University of Singapore)
23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26) · Day 3 · Hot Data, Cold Data
Overview
Modern AI applications have evolved beyond single-turn prompt-response paradigms into autonomous AI agents that execute iterative reasoning and tool-calling loops. In these workflows, an agent alternates between a "thinking" phase on a GPU and an external tool-execution phase—such as a web search or remote database query—over the network. This architectural shift introduces a severe bottleneck: GPUs sit idle for 40% to 50% of wall-clock time simply waiting for remote data, incurring high financial costs (e.g., $1.49 per H100 hour spent idling) and running headfirst into strict API rate limits imposed by external data providers.

Key moments
- 0:00 Introduction and motivation: why LLM agents bottleneck on remote data
- 2:08 Analyzing cost, latency, and rate limits of remote tool calls
- 3:21 Evaluating Google search traces and cache-friendly query patterns
- 4:24 Four key requirements for agentic semantic caching
- 6:33 Introducing Cortex and straw man limitations with ANN search
- 9:55 Cortex design: key-value unit cells and multi-stage retrieval pipeline
- 12:00 Cache policies: LCFU eviction, prefetch, and GPU resource sharing
- 14:14 Evaluation results, throughput gains, cost efficiency, and conclusion
Cortex: Achieving Low-Latency, Cost-Efficient Remote Data Access For LLM via Semantic-Aware Knowledge Caching
Speakers: Chaoyi Ruan (National University of Singapore); Chao Bi (University of Science and Technology of China); Kaiwen Zheng (University of Toronto); Ziji Shi (National University of Singapore); Xinyi Wan (Sea AI Lab and National University of Singapore); Jialin Li (National University of Singapore)
Conference: USENIX NSDI
YouTube: https://www.youtube.com/watch?v=QVm8eRfAxSY
Overview
Modern AI applications have evolved beyond single-turn prompt-response paradigms into autonomous AI agents that execute iterative reasoning and tool-calling loops. In these workflows, an agent alternates between a "thinking" phase on a GPU and an external tool-execution phase—such as a web search or remote database query—over the network. This architectural shift introduces a severe bottleneck: GPUs sit idle for 40% to 50% of wall-clock time simply waiting for remote data, incurring high financial costs (e.g., $1.49 per H100 hour spent idling) and running headfirst into strict API rate limits imposed by external data providers.
This talk introduces Cortex, a system designed to achieve low-latency, cost-efficient remote data access for large language models (LLMs) via semantic-aware knowledge caching. Developed by a multi-institutional research team from the National University of Singapore, the University of Science and Technology of China, the University of Toronto, and Sea AI Lab, Cortex addresses the unique caching challenges posed by agentic workflows. By integrating lightweight semantic filtering, a small LLM-based judge, and a custom eviction and prefetching policy, Cortex bypasses slow remote round trips while maintaining high accuracy.
The research demonstrates that remote data fetching is rapidly becoming a primary systems bottleneck alongside raw GPU compute. By intercepting repetitive and bursty agent queries with a local semantic cache, Cortex delivers up to a 3.6x throughput boost, slashes query latency, and improves overall cost-efficiency by up to six times without sacrificing task accuracy.
Background
▶ Watch: Introduction and motivation: why LLM agents bottleneck on remote data (0:00)
To understand why traditional caching solutions fail in the era of AI agents, one must examine the execution loop of an agentic workflow. A typical multi-hop user request forces an agent to execute four to six sequential tool calls—such as Google Search or OpenAI web search APIs—before emitting a final answer. Each tool call involves a network operation and a remote data service sitting directly in the critical path of generation.
In systems deployment, this creates two major pain points:
- GPU Starvation: With H100 GPU hours costing real money and idle times reaching 40–50%, waiting on external APIs burns capital while compute resources sit underutilized.
- API Rate Limiting & Cost: Commercial search APIs charge significant fees (e.g., $5 to $25 per thousand requests) and enforce rigid rate limits (such as one request per minute per user), capping system throughput regardless of underlying GPU cluster size.
Existing caching families fall short of solving these problems:
- Key-Value (KV) Caches: Systems like vLLM accelerate inference by caching token states, but they operate at the transformer layer and cannot cache external tool responses or bridge cross-region data dependencies.
- Prompt Caches (e.g., GPTCache): These systems use embedding models to compute vector similarity between incoming queries and historical entries, returning cached results if similarity exceeds a threshold. However, text embedding similarity does not equate to semantic similarity (e.g., "tell me one joke" versus "tell me two jokes" share high vector overlap but demand entirely different outputs), leading to incorrect responses.
- Traditional Caches (e.g., Redis, RocksDB): In-memory and SSD key-value stores rely on byte-identical exact matching, making them entirely blind to the paraphrased, natural language queries generated by LLM agents.
Key Findings
▶ Watch: Evaluating Google search traces and cache-friendly query patterns (3:21)
Analyzing real-world search traces—including Google search logs and public benchmark datasets—reveals that agent workloads are exceptionally cache-friendly. Query volume follows a long-tail distribution where top queries receive roughly 10 times the volume of rank-five queries, and tail entries repeat frequently. Furthermore, temporal analysis demonstrates that workloads exhibit sharp, correlated bursts driven by major news events or product launches.
Deploying Cortex on top of open-source search agents (built on top of models like Qwen-2.5 and Qwen-3.8) yields significant performance improvements across diverse benchmarks (News, GPT data, HotpotQA, and Wikipedia datasets):
- Throughput Improvements: Cortex achieves up to a 3.6x throughput boost on news datasets and a 3.8x throughput boost under bursty Google Trends workloads.
- Hit Rates: The custom eviction policy sustains high cache hit rates, reaching up to 95% on bursty real-world traces.
- Cost and Accuracy Preservation: Naive embedding-only caching drops task accuracy by 10 points due to semantic mismatches. Cortex maintains baseline task accuracy while improving cost-efficiency by up to six times, primarily by avoiding expensive remote API calls and optimizing local GPU utilization.
- Rate Limit Mitigation: Localizing repetitive data access successfully insulates the agent cluster from external provider rate limits.
Technical Deep Dive
▶ Watch: Introducing Cortex and straw man limitations with ANN search (6:33)
Cortex is architected around a semantic-aware caching pipeline designed specifically for natural language agent queries. Its design departs from traditional systems across four dimensions: key representation, retrieval pipelines, eviction policies, and hardware-software co-design.
The Key-Value Unit Cell
Cortex introduces a structured data unit cell that wraps a query-response pair alongside five critical metadata fields: cost, statistic, frequency, size, and latency. By embedding these operational metrics directly into the cache entry, every item becomes independently rankable and comparable, enabling advanced data-driven eviction and prefetching decisions.
Two-Stage Semantic Retrieval Pipeline
To solve the mismatch between vector similarity and true semantic intent, Cortex implements a multi-stage retrieval architecture:
- Coarse Filter: Incoming natural language queries are embedded and matched against an Approximate Nearest Neighbor (ANN) index (such as HNSW) to retrieve top-K candidates based on cosine similarity above a coarse threshold.
- Fine Judge: Rather than blindly trusting vector distance, Cortex employs a small, highly efficient judge model (Qwen-2.5 0.6B) to act as a binary classifier and ranker. This small language model evaluates whether the candidate query truly matches the intent of the incoming agent query.
- Dynamic Recalibration: The system dynamically tunes the thresholds for both Stage 1 and Stage 2 based on runtime performance and accuracy feedback.
Caching Policies: LCFU and Prefetching
Cortex implements strict ordering guarantees (ensuring premature or malformed search results are never returned) paired with a custom eviction policy called LCFU (Latency-Cost-Frequency-Utility). The LCFU score combines frequency, retrieval cost, latency, and operational statistics divided by item size:
$$\text{Score} = \frac{\text{Frequency} \times \text{Cost} \times \text{Latency} \times \text{Statistics}}{\text{Size}}$$
Under this policy, expensive, frequently accessed, and slowly changing items (such as historical or reference data) are retained, while cheap, rare, or ephemeral data (such as rapidly changing stock prices or weather reports) are evicted. Additionally, Cortex integrates a lightweight Markov model for background prefetching, predicting likely subsequent queries to warm the cache and preemptively counter diversity in agent tool calls.
Hardware-Software Co-Design and MPS
Running a secondary LLM judge alongside the primary agentic model typically demands dedicated GPU resources. To avoid hardware bloat, Cortex leverages Multi-Process Service (MPS) mechanisms on NVIDIA H100 class GPUs. This allows the agentic model and the 0.6B judge model to share a single GPU safely. Cortex introduces priority-scheduling mechanisms that grant high priority to the agentic model, ensuring that background judging tasks do not introduce latency jitter or degrade agent performance.
Experimental Setup & Results
▶ Watch: Cortex design: key-value unit cells and multi-stage retrieval pipeline (9:55)
The evaluation of Cortex was conducted using a hardware cluster equipped with NVIDIA H100 GPUs connected to live commercial APIs (specifically Google Search APIs).
Datasets and Baselines
Evaluations spanned multiple standard and real-world datasets:
- News Datasets
- GPT-generated interaction traces
- HotpotQA
- Wikipedia subsets
- Google Trends workloads (used specifically to test temporal burstiness)
The system was benchmarked against two primary baselines:
- Uncached Agents: Real agent execution relying entirely on live remote search APIs.
- Exact Cache: A traditional cache relying on byte-identical key matching.
Headline Numbers
- Throughput Gains: A consistent 3.6x to 3.8x throughput increase across news, GPT, and Wikipedia workloads.
- Hit Rate: Up to 95% hit rate on bursty Google Trends workloads, proving the efficacy of the LCFU eviction policy.
- Cost Efficiency: Up to a 6x improvement in cost-efficiency, driven by GPU cycle savings on the judge model and elimination of redundant paid API calls.
- Accuracy Retention: Unlike embedding-only caches that suffer a 10-point drop in accuracy due to semantic false positives, Cortex preserves baseline agent task accuracy.
Practical Implications
▶ Watch: Evaluation results, throughput gains, cost efficiency, and conclusion (14:14)
For infrastructure teams, MLOps engineers, and model deployers building autonomous agent systems, Cortex signals a vital architectural shift: remote data access is the new memory wall for AI agents.
- Infrastructure Planning: Deploying agents at scale requires treating remote data fetching with the same architectural rigor historically reserved for memory hierarchies and disk paging. Systems teams must budget for semantic caching infrastructure alongside GPU clusters.
- Cost and Rate-Limit Control: By localizing semantic hits, organizations can bypass restrictive third-party API rate limits and drastically cut operational expenditure on commercial search and data services.
- Hardware Co-Design: Utilizing lightweight models (such as sub-1B parameter judges) via MPS proves that auxiliary cognitive tasks can be integrated into serving nodes without sacrificing primary GPU generation throughput.
- Limitations: Data freshness remains a core challenge. Ephemeral data—such as real-time stock prices or minute-by-minute weather updates—cannot be cached indefinitely without stale data penalties. Cortex partially addresses this via cost-latency-frequency metrics, but deployment teams must configure staleness TTLs carefully based on domain specifics.
Key Takeaways
- The Agent Data Bottleneck: In multi-step agentic workflows, GPUs sit idle for 40% to 50% of wall-clock time waiting on remote network data, making data access a critical systems bottleneck.
- Semantic Mismatch in Caching: Traditional exact-match caches and raw vector embedding similarity fail for LLM agents because vector proximity does not guarantee semantic equivalence.
- Two-Stage Retrieval Architecture: Cortex pairs a coarse Approximate Nearest Neighbor (ANN) vector filter with a small, specialized LLM judge (Qwen-2.5 0.6B) to ensure high semantic accuracy.
- LCFU Eviction Policy: By factoring in cost, latency, frequency, and size, Cortex retains expensive, slow-changing data while aggressively evicting ephemeral entries.
- GPU Resource Sharing via MPS: Multi-Process Service allows the agent model and the judge model to share a single H100 GPU efficiently without impacting primary generation latency.
- Substantial Gains: Cortex delivers up to a 3.6x–3.8x throughput increase, a 95% cache hit rate on bursty workloads, and a 6x improvement in overall cost-efficiency.
About the Speaker(s)
Chaoyi Ruan is a researcher at the National University of Singapore (NUS), presenting this work on behalf of a collaborative research team spanning NUS, the University of Science and Technology of China (USTC), the University of Toronto, and Sea AI Lab. His research focuses on systems optimization, distributed architectures, and efficient systems support for modern machine learning applications and AI agents.
Reviews
→ Top-rated talks at 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)
All talks from 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)