LLM-based agents show strong potential for long-horizon reasoning, yet their context size is limited by deployment factors (e.g., memory, latency, and cost), yielding a constrained context budget. As interaction histories grow, this induces a trade-off between retaining past information and staying within the context limit. To address this challenge, we propose Budget-Aware Context Management (BACM), which formulates context management as a sequential decision problem with a context budget constraint. It enables agents to assess the available budget before incorporating new observations and decide when and how much of the interaction history to compress. We further develop BACM-RL, an end-to-end curriculum-based reinforcement learning approach that learns compression strategies under varying context budgets. Experiments on compositional multi-objective QA and long-horizon web browsing benchmarks show that BACM-RL consistently outperforms prior methods across model scales and task complexities, achieving over $1.6\times$ gains over strong baselines in high-complexity settings, while maintaining strong advantages as budgets shrink, where most methods exhibit a downward performance trend.
Learning Agent-Compatible Context Management for Long-Horizon Tasks
Renmin University of China(中国人民大学);Tongyi Lab, Alibaba Group(阿里云实验室);Beijing University of Posts and Telecommunications(北京邮电大学);Université de Montréal(蒙特利尔大学)
Memory as Action: Autonomous Context Curation for Long-Horizon Agentic Tasks
School of Computer Science and Technology, Beijing Jiaotong University(北京交通大学计算机科学与技术学院);Hithink Research(慧思科技);The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));Huawei Noah’s Ark Lab(华为诺亚实验室);Peng Cheng Lab(鹏城实验室)
Fudan University(复旦大学);Shanghai Key Laboratory of Data Science(上海市数据科学重点实验室);College of Computer Science and Artificial Intelligence, Fudan University(复旦大学计算机科学与人工智能学院)
HyMem: Hierarchical Context Management for Long-Horizon Agents via Information Isolation
Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);University of Chinese Academy of Sciences(中国科学院大学);Nanjing Artificial Intelligence Research of IA(IA南京人工智能研究院)
SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agents
The Chinese University of Hong Kong, China(香港中文大学);Shanghai Jiao Tong University, China(上海交通大学);Tsinghua University, China(清华大学);ByteDance, China(字节跳动)
ActKV: Efficient LLM Agents through Action-Guided KV Cache Management
University of Science and Technology of China(中国科学技术大学);Suzhou Institute for Advanced Research, University of Science and Technology of China(中国科学技术大学苏州高等研究院)
Crystal-KV: Efficient KV Cache Management for Chain-of-Thought LLMs via Answer-First Principle
School of Computer Science and Technology, University of Science and Technology of China(计算机科学与技术学院,中国科学技术大学);University of Science and Technology of China(中国科学技术大学);Institute of Artificial Intelligence, Hefei Comprehensive National Science Center(人工智能研究所,合肥综合性国家科学中心);Suzhou Institute for Advanced Research, University of Science and Technology of China(苏州先进研究院,中国科学技术大学)