AgentKV: Phase-Aware KV Eviction for Agentic LLMs

Taowen Tony Liu, Jeffrey T. H. Wong, Can Xiao, Bowen Yang, Hao Mark Chen +1 more
9/14/2026
cs.LGcs.CL

Official code: LiuTaowen-Tony/agentkv (0 stars, Apache-2.0, last commit 2026-07-28).

Abstract

Agentic serving can consume orders of magnitude more tokens than chatbot workloads, stressing both KV-cache capacity and decode-time bandwidth. Most KV-eviction methods score cached keys against representative queries drawn from the most recent tokens, assuming future attention resembles recent attention. We show that agentic generation violates this assumption: future queries form a mixture over think, act, tool, and others phases, and principal-angle analysis shows these components occupy measurably different query subspaces, so recency representatives systematically undervalue keys that upcoming phases will need. We propose AGENTKV, which maintains a small query buffer per phase and scores cached keys against their union. We further implement AGENTKV in a persistent multi-turn serving path that carries compressed KV state across turns and compacts retained KV pages online. Across two models, six task domains, and three KV budgets each, AGENTKV improves task score by 5.5 points on average over R-KV and 5.3 over Tri-attention. Relative to upstream full-KV SGLang, AGENTKV improves output-token throughput by up to 1.80x. Code: https://github.com/LiuTaowen-Tony/agentkv.

View on arXivView PDF

Code Implementations(1)

Apache-2.0
00Shell, PythonJul 23, 20262 months agoApache-2.0

Similar Papers

Cite this paper

@article{liu2026agentkv,
  title  = {AgentKV: Phase-Aware KV Eviction for Agentic LLMs},
  author = {Taowen Tony Liu and Jeffrey T. H. Wong and Can Xiao and Bowen Yang and Hao Mark Chen and Yiren Zhao},
  year   = {2026},
  eprint = {2609.14872},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.14872v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.14872.svg)](https://codeofpaper.com/paper/2609.14872)

Discussion