Why Agent Caching Fails and How to Fix It: Structured Intent Canonicalization with Few-Shot Learning
–arXiv.org Artificial Intelligence
Personal AI agents executing repetitive tasks through LLMAPIs incur substantial cost and latency. We show that existing caching methods fail on personal agent tasks: GPTCache achieves only 3.3% cache hit rate on synthetic tasks and 37.9% accuracy when evaluated as clustering on real benchmarks, while Agentic Plan Caching (APC) achieves 0-12%. We identify the root cause: these methods optimize for the wrong property. Cache effectiveness depends not on classification accuracy but on key consistency (do equivalent queries always produce the same key?) and precision (are cache hits safe to execute?). We observe that cache-key evaluation reduces to clustering quality evaluation, and apply Vmeasure decomposition (Rosenberg and Hirschberg, 2007) to separate these properties on n=8,682 data points across three established benchmarks (MASSIVE, BANKING77, CLINC150) and an additional 1,193 English test examples from NyayaBench v2, our new real-world agentic dataset (8,514 entries, 528 intents 20 W5H2 classes, 63 languages). We introduce W5H2, a structured intent decomposition framework. Using few-shot contrastive classification (SetFit) with just 8 examples per class, W5H2 achieves 91.1% 1.7% accuracy (mean over 5 seeds) on MASSIVE (FitzGerald et al., 2023) (8 classes) in 2-5ms--compared to 37.9% for GPTCache on the same benchmark and 68.8% for a 20B-parameter LLM baseline at 3,447ms and $0.09/1K requests. On NyayaBench v2 (20 real agentic classes--a substantially harder task), SetFit achieves 55.3% 1.0%, rising to 62.6% with 16 examples per class; zero-shot cross-lingual transfer establishes a baseline across 30 languages (mean 37.7%, 5 languages above 50%) with no non-English training data. On 77-class fine-grained banking intents, SetFit achieves 77.9% (CI=[76.4%,
arXiv.org Artificial Intelligence
Mar-24-2026