Compact-Memory LLM Agents via Online Max-Member Clustering and Atom-Aware Packing
Abstract
Many long-horizon LLM deployments face tight prompt budgets: latency, cost, and context limits make full-context prompting impractical as interaction length grows. The key question is then not raw recall alone, but which memory design gives the best quality--token trade-off in the compact-memory regime. We present \textbf{RSM-full}, an online clustered-memory pipeline designed for a strong quality--token Pareto point. RSM-full combines two design choices: a cosine-gated \emph{max-member merge} write rule and an atom-aware grouped context packer. On AMA-Bench, our primary compact-memory benchmark, it reaches of Full-Context quality at of the token cost at a k budget; under four-seed averaging it beats the closest streaming-clustered baseline (Online K-Means) by --,pp () across the whole k--k regime. Three-seed ablations show most of this gain comes from the merge rule (,pp over Online K-Means and matched- DP-means) and the grouped packer (,pp over flat concatenation). The pattern reproduces on RealMem, an independent long-horizon persona-memory benchmark: RSM-full improves on Budget-RAG (,pp, ), is on par with BM25-RAG (paired ,pp, ; we do \emph{not} claim BM25 equivalence in the equivalence-test sense), and significantly outperforms Streaming-Proto (,pp) and the closest reproduced 2025 agentic-memory baseline A-MEM (,pp, ). Across benchmarks the message is consistent: under tight budgets, compact-memory performance is driven mainly by how streaming memories are merged and how retrieved content is assembled. Overall, RSM-full is most useful when answeroughly -- prompt tokens, where itdefines a strong compact-memory Pareto point; higher-token baselines remain stronger outside this regime.
Create a lesson
Related papers
Do Dynamic Routers Need Memory? HeRo: History-Aware Routing for Efficient LLM Inference
Shared title terminologycs.AIHongjin Lin, Wentao Wan, Keze Wang
FrogNano: Training a 4B Coding Agent via Online Task Synthesis
Shared title terminologycs.AIMinseon Kim, Zhengyan Shi, Emiliano Penaloza et al.
Agentic Algorithm Engineering: Improving Shared-Memory Exact Minimum Cuts
Shared title terminologycs.AIDavid A. Bader, Adil Chhabra, Ernestine Großmann et al.
EmoMed: An Emotionally-Aware Agent for Multimodal Medical Support with Real-Time Information Retrieval
Shared title terminologycs.AIIvan Nasonov, Nikita Glazkov, Ivan Makovetskiy et al.
OmniStepBench: Deployment-Aware Agent Evaluation across Modalities and Task Complexity
Shared title terminologycs.AIYu Liu, Zhilin Liu, Zhiwei Yang et al.
Beyond Top-k Skill Retrieval: Diversity-Aware Skill Routing for LLM Agents
Shared title terminologycs.AIWang Wei, Tiankai Yang, Samyadeep Basu et al.