The Compaction Cliff in Long-Running AI Agent Memory

AuthorsSaber Zerhoudi, Jelena Mitrovic, Michael Granitzer

arXiv 20262026

TL;DR

Knowledge Triage uses typed operators TypeCompact, TypeDecompose, and TypeRetrieve to eliminate the Compaction Cliff, preserving up to 1.00 constraint recall vs 0.53 for Sonnet 4.6 /compact at 50% compression.

SharePost on XLinkedIn

Read our summary here, or open the publisher PDF on the next tab.

THE PROBLEM

The Compaction Cliff: Safety Rules Collapse From 53% to 10%

Under Claude Code’s /compact prompt on Sonnet 4.6, safety-rule recall is 53% after one compaction round and only 10% after five.

This failure in long-running AI agents lets critical constraints like drug allergies vanish, causing unsafe recommendations and broken safety guarantees over extended sessions.

HOW IT WORKS

Knowledge Triage: Typed Compaction, Decomposition, and Retrieval

Knowledge Triage centers on a five-type classifier SafetyMargin, plus three deterministic operators TypeCompact, TypeDecompose, and TypeRetrieve over a typed knowledge base.

Like triage in a hospital separating critical from stable patients, Knowledge Triage separates constraints, procedures, and softer items before deciding how to compress or move them.

This KEY_MECHANISM of per-type distortion lets Knowledge Triage preserve safety rules exactly while still shrinking or partitioning other memory, something a plain context window or uniform compactor cannot do.

DIAGRAM

Knowledge Triage Context-Management Cycle

This diagram shows how Knowledge Triage composes TypeCompact, TypeDecompose, and TypeRetrieve into a single context-management loop.

DIAGRAM

Evaluation Pipeline Across Corpora and Operators

This diagram shows how Knowledge Triage is evaluated on compaction, decomposition, retrieval, and behavioral benchmarks using six corpora.

PROCESS

How Knowledge Triage Handles a Long-Running Agent Session

  1. 01

    Typed Knowledge Model Construction

    Knowledge Triage builds the tuple K = (I, τ, T, π, σ), assigning each item a type and scope so TypeCompact, TypeDecompose, and TypeRetrieve can reason over constraints.

  2. 02

    Per-item Type Classification

    SafetyMargin and the selective cascade classify items into Constraint, Procedural, Belief, Preference, and Episodic, providing the labels that drive Knowledge Triage’s per-type retention.

  3. 03

    TypeCompact With Guard Verifier

    TypeCompact routes constraints and procedures into a hard lane, compresses softer items, then runs the guard verifier to ensure every constraint survives or flags Unsafe.

  4. 04

    TypeDecompose and TypeRetrieve

    When budgets are tight, TypeDecompose replicates scoped constraints into partitions, and TypeRetrieve pins in-scope constraints ahead of relevance for queries during the session.

KEY CONTRIBUTIONS

Key Contributions

  • 01

    The Compaction Cliff

    Knowledge Triage identifies the Compaction Cliff where Sonnet 4.6 /compact drops safety-rule recall from 53% after one round to 10% after five on 20 agent configurations.

  • 02

    Five-type Knowledge Model and SafetyMargin

    Knowledge Triage defines five operational types covering 97% of AgentArtifactCorpus and introduces SafetyMargin, lifting declarative constraint recall from 0.62 to 0.90 across phrasing forms.

  • 03

    Typed Operators With Formal Guarantees

    Knowledge Triage’s TypeCompact, TypeDecompose, and TypeRetrieve achieve 2–4× higher constraint recall than single-shot compactors, 0% locality violations vs 93%, and 100% recall@50 vs 73% for Sonnet 4.6.

RESULTS

By the Numbers

Constraint preservation at 50%

1.00 recall

+0.47 over Sonnet 4.6 (/compact) which has 0.53 recall

Constraint preservation at 25%

0.95 recall

+0.56 over LLMLingua-2 which has 0.39 recall

Locality violations in decomposition

0% violations

-93 percentage points vs chunk_by_paragraph which has 93% configs with violations

Retrieval recall@50

100% recall@50

+27 percentage points over Sonnet 4.6 one-shot which has 73% recall@50

On AgentArtifactCorpus compaction experiments, Knowledge Triage’s TypeCompact preserves all classifier-flagged constraints at 50% compression, while Sonnet 4.6 /compact preserves only 0.53.

On BEIR scifact plus τ-bench retail policies, TypeRetrieve reaches 100% in-scope constraint recall@50, proving that Knowledge Triage can maintain safety rules under aggressive retrieval budgets.

BENCHMARK

By the Numbers

On AgentArtifactCorpus compaction experiments, Knowledge Triage’s TypeCompact preserves all classifier-flagged constraints at 50% compression, while Sonnet 4.6 /compact preserves only 0.53. On BEIR scifact plus τ-bench retail policies, TypeRetrieve reaches 100% in-scope constraint recall@50, proving that Knowledge Triage can maintain safety rules under aggressive retrieval budgets.

BENCHMARK

Constraint Preservation vs Compression Ratio on AgentArtifactCorpus

Constraint recall at 50% compression across prompt compactors on 20 AAC configurations.

BENCHMARK

Tau Bench Retail Pass Rate Across Policies

Pass rate on τ-bench retail tasks comparing full policy, hierarchical truncation, and TypeCompact.

KEY INSIGHT

The Counterintuitive Finding

Despite compressing aggressively, Knowledge Triage’s TypeCompact maintains 1.00 constraint recall at 50% compression, while Sonnet 4.6 /compact collapses to 0.10 after five rounds.

This is surprising because production prompts explicitly say “keep every safety rule,” yet type-blind summarization still deletes rules, showing that natural-language instructions alone cannot enforce safety preservation.

WHY IT MATTERS

What this unlocks for the field

Knowledge Triage unlocks long-running agents whose safety rules survive repeated compaction, decomposition, and retrieval without being paraphrased away.

Builders can now deploy agents with bounded context that still obey critical constraints over hours of interaction, using typed memory operators instead of hoping the context window and prompts are enough.

~14 min read← Back to papers

Related papers

BenchmarkAgent Memory

Active Context Compression: Autonomous Memory Management in LLM Agents

Nikhil Verma

· 2026

Focus Agent adds start_focus, complete_focus, a persistent Knowledge block, and an optimized Persistent Bash plus String-Replace Editor scaffold to actively compress context during long software-engineering tasks. On five hard SWE-bench Lite instances against a Baseline ReAct agent, Focus Agent achieves 22.7% token reduction (14.9M → 11.5M) while matching 3/5 = 60% task success.

Agent Memory

ActMem: Bridging the Gap Between Memory Retrieval and Reasoning in LLM Agents

Xiaohui Zhang, Zequn Sun et al.

· 2026

ActMem transforms dialogue history into atomic facts via Memory Fact Extraction, groups them with Fact Clustering, links them through a Memory KG Construction module, and uses Counterfactual-based Retrieval and Reasoning for action-aware answers. On ActMemEval, ActMem reaches 76.52% QA accuracy with DeepSeek-V3, beating LightMem’s 63.97% by 12.55 points and NaiveRAG’s 61.54%.

Questions about this paper?

Paper: The Compaction Cliff in Long-Running AI Agent Memory

Answers use this explainer on Memory Papers.

Checking…