arXiv(opens in a new tab)cs.AIAug 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2608.22752

The Compaction Cliff in Long-Running AI Agent Memory

Saber Zerhoudi, Jelena Mitrovic, Michael Granitzer

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Saber Zerhoudi

University of Passau

Passau, Germany

szerhoudi@acm.org

Jelena Mitrović

University of Passau

Passau, Germany

jelena.mitrovic@uni-passau.de

Michael Granitzer

University of Passau

Passau, Germany

IT:U

Linz, Austria

michael.granitzer@uni-passau.de

SHORT-TERM / WORKING CONTEXT

CLASSIFIER τ\tau

Assigns each item one of five categories: Constraint, Procedural, Belief, Preference, Episodic

EXTERNAL STORAGE

TYPED KNOWLEDGE

VERIFIER

Confirms every constraint

survived compaction

Figure

Figure 1: Knowledge Triage. Classifier τ\tau assigns each working-set item one of five types; three deterministic operators apply per-type policies: TypeCompact compresses without dropping safety rules, TypeDecompose splits large topics and duplicates rules that span them, TypeRetrieve returns applicable rules first. A verifier checks that every constraint survived; if any are missing, the output is flagged UNSAFE, otherwise it becomes the next working set.

Abstract

A safety rule and an episodic log compete for the same tokens in an AI agent's context. When the budget overflows, both are summarized at the same rate; only the rule needs exact wording to remain enforceable. On 20 production agent configurations, Claude Code's /compact prompt on Sonnet 4.6 preserves 53% of safety rules after one compaction round and 10% after five. We name this the Compaction Cliff. We address it with Knowledge Triage, a framework that classifies each line of an agent's knowledge base by type and routes each type through its own retention policy. Three deterministic operators implement this triage across the three context-management operations: TypeCompact rewrites items in place under per-type fidelity, TypeDecompose partitions a topic too large to compact safely, replicating in-scope safety rules across partitions, and TypeRetrieve fetches items from external storage with in-scope rules pinned ahead of relevance. On five public corpora, TypeCompact preserves 2–4× more safety rules than the strongest single-shot LLM compactor at every ratio, with 96% recall over five rounds. TypeDecompose reaches 0% locality violations against 93% under uniform partitioning. TypeRetrieve reaches 100% recall@50 against 73% for the best single-shot LLM retriever. On three downstream behavioral benchmarks, we outperform the production Sonnet compactor on medical compliance (paired McNemar p<10−8p < 10^{-8} on preservation, N = 200), the full-policy and hierarchical baselines on retail task pass rate ( p<0.01p < 0.01, N = 115), and the hierarchical compaction on the airline domain ( p=0.024p = 0.024). We release AgentArtifactCorpus (396,934 agent configurations from 54,628 public GitHub repositories), the classifier, and the reference implementation.

CCS Concepts

• Computing methodologies → Knowledge representation and reasoning; Intelligent agents; • Information systems → Summarization.

References (27)