EpiCache: Episodic KV Cache Management for Long-Term Conversation on Resource-Constrained Environments
Abstract
Lay Summary
AI assistants on smartphones could one day remember weeks of past conversations to give truly personalized responses — but storing that history requires memory that grows without limit, quickly exceeding what a phone can handle. Existing approaches either ignore this memory constraint entirely or compress memory so aggressively that the assistant forgets critical details from earlier in the conversation. We introduce EpiCache, a framework that organizes long conversation history into topically coherent "episodes" — much like chapters in a book — and builds a compact, compressed memory snapshot for each episode. When a user asks a question, EpiCache identifies the most relevant episode and retrieves only that snapshot for generating a response, keeping total memory usage flat no matter how long the conversation grows. EpiCache further improves accuracy by intelligently distributing the limited memory budget across the AI model's layers, allocating more memory to layers that are most sensitive to compression. Across multiple real-world benchmarks, EpiCache improves answer accuracy by up to 30% over existing methods, reduces peak memory usage by nearly 4x, and cuts response time by 2.4x — marking a practical step toward capable, long-term conversational AI on resource-constrained devices.