Preprint
Review

This version is not peer-reviewed.

Context Compression for Long-Horizon AI Agents: Lifecycle Management, Token Economics, and Production Patterns

Submitted:

11 July 2026

Posted:

14 July 2026

You are already at the latest version

Abstract
Large language model agents are not merely long-prompt applications: they repeatedly prefill growing transcripts that mix instructions, tool schemas, tool observations, persistent memory, scratchpads, and sub-agent outputs, re-submitting the accumulated context on every turn. This creates a full-session optimization problem in which compression ratio alone is insufficient: practical designs must also preserve cacheable prefixes, recover omitted evidence when it is later needed, maintain provenance across privilege boundaries, and avoid delayed-relevance failures where prematurely discarded detail turns out to matter. This survey reframes context compression as lifecycle management for long-horizon agents rather than one-shot prompt shortening. We organize methods by where information is admitted, placed, compacted, recovered, reused, and governed across a session, then map four method families—natural-language, retrieval and offloading, soft-token, and KV-cache compression—together with learned policy-based methods into this lifecycle, rather than treating them as parallel silos. We analyze how production general-purpose agents instantiate these choices in practice, exposing the triggers, protected regions, and recovery sources that determine whether an agent survives a long run, and we synthesize the fast-moving 2025-2026 frontier in which compression becomes a learned action rather than an external scaffold. Finally, we propose an evaluation protocol that jointly reports task success, peak and total tokens, latency, cache behavior, recoverability, and security-relevant provenance, rather than compression ratio in isolation.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  ;  

1. Introduction

1.1. Why Token Consumption Matters for Agents

A conversational LLM application typically issues a small number of calls per user turn. An autonomous agent, by contrast, executes a loop: it receives a goal, emits a tool call, observes the (often large) result, appends it to the running transcript, and re-submits the entire transcript to the model—repeating until a terminal response is produced. Anthropic reports that single-agent workflows “use about 4× more tokens than chat interactions, and multi-agent systems use about 15× more tokens than chats” Hadfield et al. (2025). Production agents can span hundreds of conversational turns, so context length—and therefore cost and latency—grows monotonically across a session.
Four forces make this growth painful:
1.
Cost. Because the full transcript is re-sent each turn, cumulative input spend can grow quadratically in the number of turns absent caching (a sum of monotonically growing per-turn contexts; Figure 1b); prompt caching softens the constant but not the trend. Unaudited community telemetry for OpenClaw attributes an estimated 40–50% of typical token usage to context accumulation alone, and a single user reported that session context occupied 56–58% of a 400K-token window—roughly 230,000 tokens re-sent with every message LaoZhang AI (2026).
2.
Latency. Prefill compute scales with context length; OpenHands measured average response latency rising to 16 s at iteration 100 without condensation Smith (2025).
3.
Finite context windows. Even with 200K–1M-token windows, long-horizon tasks exceed the window, forcing some form of eviction or summarization Anthropic (2025c).
4.
Accuracy degradation (“context rot”). Performance falls as inputs grow. Liu et al. (2024a) show a U-shaped accuracy curve in which performance “degrades significantly” when relevant information sits in the middle of long inputs (multi-document QA fell from ∼75% when the gold document was first to ∼55% when it was tenth of twenty, across GPT-3.5-Turbo, GPT-4, Claude-1.3, MPT-30B, and LongChat-13B). Chroma’s 2025 Context Rot report extends this to 18 frontier models (including GPT-4.1, Claude 4, Gemini 2.5, and Qwen3), finding that every model degrades as input length grows, even at 50K tokens within a 1M-token window Hong et al. (2025). Controlled probes sharpen the diagnosis: on NoLiMa, which removes literal needle–question lexical overlap, 11 of 13 models advertising ≥128K context fall below half their short-context accuracy at just 32K tokens (GPT-4o drops from 99.3% to 69.7%) Modarressi et al. (2025); RULER finds only about half of 17 evaluated long-context LMs sustain acceptable accuracy at 32K despite claiming 32K+ windows Hsieh et al. (2024); and BABILong reports that models effectively use only 10–20% of their context on facts scattered across long inputs Kuratov et al. (2024). The effective window is thus far smaller than the advertised one—keeping context small often preserves more usable signal than filling it, though the degradation is highly task- and model-dependent (some models and tasks stay near-flat), a heterogeneity we revisit when discussing evaluation in Section 7.
For persistent general-purpose agents the problem is acute because they run even when idle. OpenClaw’s “heartbeat” fires scheduled background turns; a 5-minute heartbeat carrying 50K tokens of context consumes roughly 600,000 input tokens per hour—about $3/hour on a frontier model purely to “stay awake.” This per-hour figure is an arithmetic illustration rather than a measurement; a single misconfigured email-check loop has separately been reported to burn $50 in one day Wu (2026); Hayes (2026). Figure 2 summarizes both sides of this economics: the token multipliers that make agents expensive relative to a chat turn, and the individual levers (caching, tool-surface offloading, condensation) that claw the cost back.

1.2. Scope and Named Systems

This survey foregrounds context compression: methods that reduce the token footprint of the information the model must attend to, while preserving task-relevant content. We use as recurring case studies a cohort of general-purpose agents—domain-agnostic, tool-using, and long-running—rather than narrow task pipelines, and throughout we return to OpenClaw, Hermes, Manus, Claude Code, and OpenHands as the recurring named systems, with MemGPT/Letta and the earlier AutoGPT/BabyAGI lineage as comparison points OpenClaw (2026a); Nous Research (2026a). We defer the detailed per-system mechanisms—bootstrap layouts, condensers, dual context engines, and filesystem offloading—to Section 5, where they are compared side by side. Because our sources span very different levels of scrutiny, we tier evidence explicitly and hold to that tiering throughout: (i) peer-reviewed papers and arXiv preprints are treated as primary evidence; (ii) first-party vendor engineering blogs and product documentation are documented but non-archival, reporting real deployments under settings we cannot independently verify; and (iii) community write-ups, third-party telemetry, and forum reports are unaudited signals, flagged inline at every use and never the sole basis for the survey’s conclusions or recommendations. Cited URLs were checked against their live primary sources at the time of writing (June 2026), and non-archival sources carry access dates in the references. We further caution that the 2025–2026 frontier synthesis (Section 6) rests largely on preprints not yet peer-reviewed, so those particular conclusions may shift as the record matures.
Figure 3 previews the terrain the survey covers: it places the great majority of the methods discussed in the sections that follow at their first public appearance, organized into the four method families developed in Section 3 and Section 4. The plotted set is representative rather than an exhaustive census: a handful of frameworks, vendor engineering features, and methods named only as lead-ins are omitted for legibility. Two trends visible in the figure shape our emphasis throughout: the field’s marked acceleration over 2024–2025, and the 2025–2026 surge of learned, agent-native (RL-trained) compression—the dense bottom lane—whose synthesis (Section 6) is a central contribution of this survey.
Out of scope. We focus on reducing the token footprint of the textual and representational context a tool-using agent repeatedly re-prefills, and deliberately set aside four adjacent problems. (i) Multimodal context—compressing vision or audio tokens for computer-use and GUI agents—is an important but distinct token sink we do not treat. (ii) Output-side reasoning compression—shortening chain-of-thought or tool-call traces as they are generated—is complementary to the input-side compaction studied here. (iii) Alternative long-context architectures—linear-attention and state-space models that lower the per-token cost of long inputs rather than shortening them—substitute for, rather than instantiate, compression. (iv) Information-theoretic limits of lossy context compression remain largely uncharted; our treatment is empirical throughout. We note these to delimit the survey, not to diminish them.
Relation to existing surveys. Prior surveys cover adjacent but narrower scopes. Li et al. (2025b) survey prompt compression (hard and soft methods) for LLMs; the KV-cache management survey of Li et al. (2025a) organizes that single family into token-, model-, and system-level optimizations; the agent-memory survey of Zhang et al. (2024d) catalogs memory mechanisms; Mei et al. (2025) cast compression as one component of a broad “context engineering” pipeline (acquisition, processing, management); and the contemporary memory survey of Du (2026) organizes agent memory as a write–manage–read loop across five mechanism families. None is simultaneously agent-centric, cross-family, and token-efficiency-centric. Our contribution is a lifecycle taxonomy—organized around admission, placement, compaction, recovery, reuse, and governance—into which the four method families nest, oriented to the operating constraints of long-running, tool-using agents (repeated re-prefill, prompt-cache economics, irreversibility, and provenance); and we give particular weight to the 2025–2026 shift toward learned, agent-native compression (Section 6).
Contributions. This survey makes five contributions:
1.
A unified agent-context lifecycle model—admission, placement, compaction, recovery, reuse, and governance—that frames context compression as full-session management rather than one-shot prompt shortening (Section 3); governance is included as a normative stage—motivated by compression–security interactions but not yet instantiated in any surveyed production system.
2.
A taxonomy by intervention point and reversibility that nests the four method families (hard/natural-language, soft/embedding, KV-cache, and complementary) inside the lifecycle, rather than treating them as parallel silos (Section 3 and Section 4).
3.
A production-agent comparison of how deployed general-purpose agents (OpenClaw, Hermes, Manus, Claude Code, OpenHands) instantiate these choices in practice (Section 5).
4.
A synthesis of the 2025–2026 shift from compression-as-scaffold to compression-as-policy, where the compaction step becomes a reinforcement-learned action (Section 6).
5.
An evaluation agenda that jointly measures task success, peak and total tokens, latency, cache hit rate, and recovery/provenance, rather than compression ratio alone (Section 7).
Table 1. How this survey differs from adjacent survey families. Prior surveys each isolate one framing of the problem; this survey targets full-session token economics and the compression decisions a tool-using agent must make over an entire run.
Table 1. How this survey differs from adjacent survey families. Prior surveys each isolate one framing of the problem; this survey targets full-session token economics and the compression decisions a tool-using agent must make over an entire run.
Survey family Primary focus
Prompt compression Li et al. (2025b) Prompt representation and hard/soft compression mechanisms for a single call.
KV-cache / serving Li et al. (2025a) Serving-time memory, throughput, eviction, and quantization of the attention cache.
Agent memory Zhang et al. (2024d); Du (2026) Persistent memory mechanisms as a write–manage–read loop.
Context engineering Mei et al. (2025) The broad acquisition–processing–management pipeline, with compression as one component.
This survey Full-session token economics and compression decisions in tool-using agents.

2. What Makes Agent Compression Different

Compressing an agent’s context is not the same problem as compressing a long prompt. An agent does not read its input once; it accumulates a transcript over many turns, re-feeds that transcript to the model on every step, and pays for tools, schemas, and provenance that a one-shot prompt never carries. Five properties separate the agent setting from the static long-context setting these methods were originally designed for, and they motivate the lifecycle view we adopt in Section 3.
Repeated re-prefill and quadratic session cost. An agent transcript is not a long prompt that the model consumes once: the full history is re-sent to the model on every turn. Because each per-turn context is itself monotonically growing, cumulative input spend can grow quadratically in the number of turns absent caching—a sum of per-turn contexts, not a single pass over a fixed input. Prompt caching softens the constant but not the trend. The effect is large in production—unaudited community telemetry attributes an estimated 40–50% of typical token usage to context accumulation alone (the OpenClaw figures of Section 1). This is why context that merely exists is a recurring cost, and why multi-agent architectures that fan work out across isolated sub-agents can burn far more tokens than a single conversation Hadfield et al. (2025). A method that shaves a fixed number of tokens once is worth little; what matters is bending the per-turn growth curve.
Tool observations and schemas as hidden token sinks. A static prompt is a single block of text; an agent context is a heterogeneous mix of messages, tool definitions, tool outputs, scratchpads, memory files, and sub-agent summaries, and these components have very different cost profiles. Tool observations—the environment outputs returned after each action—dominate: JetBrains’ Complexity Trap study finds observations make up roughly 84% of an average SWE-agent turn, so the bulk of compressible mass lives there rather than in the model’s own reasoning Lindenbauer et al. (2025). This 84% is a single-scaffold, single-study measurement—indicative of where the mass sits rather than a universal constant. Tool definitions and inter-tool data are a separate, often overlooked sink: exposing MCP tool servers as code APIs reduced a representative workflow from 150,000 to 2,000 tokens Anthropic (2025b), and on-demand tool discovery cut tool-definition overhead by ∼85% Anthropic (2025a) (Section 4.4 details both). A compression scheme that treats the context as undifferentiated text misses that these sinks have distinct origins and distinct, often cheaper, remedies.
Prompt caching changes the optimization target. In the static setting, fewer tokens is unambiguously cheaper. For agents that reuse a stable prefix across turns, the optimization target is no longer raw length: a shorter prompt can be more expensive if it destroys a cached prefix. The economics are concrete. Anthropic cache writes cost 1.25× (5-min TTL) or 2.0× (1-hour TTL) base input while cache reads cost only 0.1×—a 90% discount, break-even at ∼2 hits Anthropic (2024); OpenAI applies an automatic 50% discount on cached prefixes over 1,024 tokens OpenAI (2024). A compaction event that rewrites the cached prefix forfeits these savings, so naive condensation can be a net cost increase. Production agents lean heavily on this discount—Hermes reports prompt caching reduces input token costs by ∼75% on multi-turn conversations Nous Research (2026a), and OpenClaw auto-enables caching for API-key sessions centminmod (2026)—which means any compression operator must be co-designed with the cache boundary rather than evaluated on token count alone.
Irreversibility and recoverability. Summarization is not interchangeable with the alternatives that preserve a path back to the original. Lossy compaction discards tokens whose future relevance is unknown, and the loss can be severe: one analysis observed autocompaction reduce 132K tokens to 2.3K (98% reduction), discarding a session’s hard-won understanding Santoni (2026). Three recoverable designs avoid this. Filesystem offloading keeps a pointer rather than the content—Manus drops a web page’s text as long as the URL is preserved and omits a document’s body if its path remains, so context shrinks “without permanent loss” Ji (2025), and Anthropic’s Managed Agents generalize this to a durable session log living outside the model’s window Anthropic (2026a). View-level condensation operates by inserting markers and never mutating the raw event stream, so sessions remain replayable All Hands AI (2025a). Inside the KV cache, the analogous move is reconstruction-scored compression: KVzip scores each KV pair by how much it supports reconstructing the original context, yielding a reusable compressed cache rather than query-conditioned eviction Kim et al. (2025). Whether an operator is lossy or recoverable is therefore a first-class property in the agent setting, not an implementation detail.
Provenance and privilege boundaries. A static prompt carries one trust level; an agent context mixes system instructions, user input, tool outputs, and untrusted environment content in a unified context whose tokens influence generation regardless of provenance. Compression can blur these boundaries with safety consequences: a study of compression methods finds system-prompt leakage rises with compression, because defense and guardrail instructions often sit in the (evictable) system prompt and aggressive KV compression can silently disable them Chen et al. (2025). The flat context model is itself exploitable: on an isolated testbed running unmodified OpenClaw, ClawWorm shows that a single-message prompt-injection chain can achieve persistent, self-propagating compromise by combining flat context trust with unconditional loading of agent configuration Zhang et al. (2026). Background heartbeat turns provide a separate unattended path through which persistent state can be read or updated OpenClaw (2026b). A compression scheme that ignores which part of the context a token came from can therefore degrade not just accuracy but security.
These five properties—quadratic re-prefill cost, heterogeneous token sinks, the caching-aware optimization target, the lossy/recoverable distinction, and provenance boundaries—are what separate this survey from prompt-compression and KV-cache surveys, which treat the context as a single static block of fixed provenance read exactly once.

3. A Lifecycle Taxonomy for Agent Context Compression

We formalize the agent context-management problem and then partition methods.
Problem setup. Let an agent’s interaction history at step t be a sequence of events H t = ( e 1 , e 2 , , e t ) , where each e i is a message, tool call, or observation with token length | e i | . The model input at step t is a context C t = Φ ( H t ) assembled by a context function Φ . A naive agent sets Φ ( H t ) = concat ( H t ) , so | C t | = i t | e i | grows without bound. A compression operator  κ produces C ˜ t = κ ( C t ) with | C ˜ t | | C t | . We define the compression ratio  ρ = | C t | / | C ˜ t | and the retention  R = Perf ( C ˜ t ) / Perf ( C t ) , the fraction of downstream task performance preserved. The central design tension is to maximize ρ subject to R 1 .
The agent-context lifecycle. Rather than partitioning methods first by mechanism, we organize them by when in an agent’s context-management lifecycle they intervene. Every event e i that enters H t passes through a sequence of decisions: whether it is admitted into context at all, where it is placed, how stale context is compacted, whether discarded detail can be recovered, whether the prefix can be reused across calls, and how the resulting context is governed for provenance and security. Table 2 states the question each stage answers and the representative mechanisms that operate there. This lifecycle view and the four-family where-axis introduced below are complementary but correlated lenses on the same methods rather than independent axes: a single system typically acts at several stages and the families slot into the lifecycle rather than competing with it, but the stages are far from uniformly populated across families. Recovery concentrates in the complementary family—filesystem pointers, retrieval stores, and raw transcripts—with reconstruction-scored KV compression (KVzip Kim et al. (2025)) the notable within-model exception; reuse is dominated by provider-side prompt caching; and governance is, so far, a largely normative stage—motivated by compression–security findings Chen et al. (2025); Zhang et al. (2026) and emerging research such as provenance-preserving delta updates (ACE Zhang et al. (2025a)), but not yet a documented practice in any surveyed production agent (Section 5.5).
Mapping the four families onto the lifecycle. The four method families that follow each occupy a characteristic region of this lifecycle. Token-space (hard/natural-language) methods mainly perform admission and compaction, editing the text before it reaches the model. Soft-token (embedding) methods perform compaction inside learned representations, replacing spans with continuous vectors. KV-cache methods target serving-time placement and compaction of the model’s internal key–value memory. Offloading, memory, RAG, and sub-agent strategies target placement and recovery, relocating content outside the window and re-fetching it on demand. The emerging learned, agent-native line cuts across these: it decides compaction and placement as actions taken by the agent’s own policy (Section 6) rather than by an external scaffold; Figure 4 consolidates the lifecycle and marks which families act at each stage.
One family axis and three cross-cutting axes. The primary axis—where compression acts—defines the four families: token space (natural-language text the model reads), embedding space (continuous soft tokens), the KV cache (the model’s internal key–value memory), or outside the context window (complementary strategies). Three further axes cut across all four:
  • Lossy vs. recoverable. Lossy operators (summarization, eviction) discard information irreversibly; recoverable operators (filesystem offloading, externalized context objects, reconstruction-scored caches) keep a pointer so the full content can be re-fetched Ji (2025); Anthropic (2026a).
  • Training-free vs. model-modifying. Token-space methods leave the model untouched and run on any closed API; embedding- and KV-space methods require model access or self-hosting. This axis directly shapes the recommendations of Section 8.
  • External scaffold vs. learned policy. Classically compression is a wrapper around an unmodified agent; an emerging line instead trains the agent to compress its own context (Section 6). Learned-policy compression cuts across families and is the field’s most active frontier.
The soft/embedding and KV boundaries form a continuum rather than a hard partition—learned soft tokens are frequently materialized as cached KV values (e.g. Activation Beacon Zhang et al. (2024a), 500xCompressor Li et al. (2025c))—so we assign convergent methods by their primary mechanism.
This yields four families, detailed in Section 4: (1) hard/natural-language compression; (2) soft/embedding compression; (3) KV-cache compression; (4) complementary strategies (offloading, memory hierarchies, RAG, sub-agent isolation); Figure 3 (Section 1) traces their evolution from 2023 to 2026 and the recent shift toward recoverable and learned, agent-native compression.

4. Method Families as Implementation Choices

With the agent-centric setup in place, we now survey the method families—but rather than catalog them in isolation, we examine each by the same agent-design questions: where it intervenes in the lifecycle (Section 3); whether it is compatible with closed, API-only models or instead requires modifying the model; whether it preserves cacheable prefixes or invalidates the KV-cache on every edit; whether the compression is recoverable or destructive; whether it preserves provenance (a traceable link back to the source span); and which agent workloads it benefits or breaks. Read this way, the families are not competing schools but a menu of implementation choices, each occupying a different point on the lossy↔recoverable, training-free↔model-modifying, and external-scaffold↔learned-policy axes. Figure 5 locates the three in-context points where compression can intervene, and Figure 6 maps the four families against the two cross-cutting axes—together the what/how complement to the lifecycle’s when (Figure 4).

4.1. Natural-Language Compaction

Natural-language compaction keeps the model and API unchanged—it edits the text sent to the model—so it is training-free and closed-API-compatible, and it acts at the admission and compaction stages of the lifecycle. It splits into abstractive (generate a shorter paraphrase/summary) and extractive/pruning (select or delete spans) approaches Li et al. (2025b); Li et al. (2023).

4.1.1. Summarization-Based Compression

Recursive and hierarchical summarization (the conceptual basis). The idea of recursively folding history into a bounded, hierarchical summary—Wang et al. (2023) for long dialogue, Generative Agents Park et al. (2023) for low-level activity into reflections—is the conceptual basis for the “compaction” used in nearly every production agent, and (as Section 6 shows) for the RL-trained compaction policies of 2025–2026.
Trajectory / conversation compaction. OpenHands implements an LLMSummarizingCondenser (a RollingCondenser) that, once history exceeds a size limit, summarizes older events while keeping recent messages verbatim, encoding the user’s goals, progress made, and remaining work plus technical artifacts (critical files, failing tests) All Hands AI (2025b). Anthropic frames “the art of compaction” as choosing what to keep versus discard, recommending engineers “maximize recall” first then tune precision Anthropic (2025c). Claude Code triggers automatic server-side compaction at roughly 80% of the context window (∼160K of 200K tokens), and Claude Opus 4.6 exposes context compaction triggered at a configurable threshold (e.g. 50K tokens) to extend agentic runs Anthropic (2026b).
Observation masking—a cheaper alternative. A counterintuitive result cautions against assuming summarization is always best. JetBrains’ Complexity Trap study finds that simple observation masking (replacing old environment observations with placeholders while keeping reasoning and actions intact) matches or beats LLM summarization on SWE-bench Verified: Qwen3-Coder-480B scored 2.6% higher solve rate at 52% lower cost, and summarization actually inflated trajectory length by 13–15% by obscuring natural stopping signals. Because observations dominate the turn (the ∼84% of Section 2), masking captures most of the available savings (a hybrid masking-plus-summary scheme adds a further 7–11% reduction); the masking-window hyperparameter must, however, be tuned per scaffold, since agents that retain failed retries (OpenHands) need larger windows than those that skip them (SWE-agent) Lindenbauer et al. (2025).
Optimizing the compressor (ACON). ACON optimizes the compression guideline itself via natural-language failure analysis, then distills the compressor into a smaller model. It reports 26–54% reduction in peak token usage on AppWorld, OfficeBench, and Multi-objective QA, is gradient-free, retains over 95% accuracy once distilled, and even improves smaller-LM agents by up to 46% relative to a naive prompting baseline Kang et al. (2025b).
Agent-controlled active compression (Focus). Focus lets the agent itself decide when to consolidate learnings into a persistent “Knowledge” block and prune raw history. On five context-intensive SWE-bench instances with Claude Haiku 4.5, aggressive prompting (compress every 10–15 tool calls) achieved a 22.7% token reduction (14.9M → 11.5M) at identical accuracy (3/5), with per-instance savings of 18–57%; passive prompting yielded only ∼6% savings and degraded accuracy, showing that compression scaffolding must be aggressive to pay off Verma (2026).

4.1.2. Token Pruning/Selective Context Dropping

Pruning deletes low-information tokens before sending the prompt. Selective-Context Li et al. (2023) scores tokens by self-information from a small LM and drops the lowest. The LLMLingua family Jiang et al. (2023b); Microsoft Research (2024) is the canonical line:
  • LLMLingua Jiang et al. (2023a): a coarse-to-fine pipeline (budget controller + iterative token-level perplexity pruning + distribution alignment) using a small LM (e.g. GPT-2/LLaMA-7B). It reports “up to 20x compression with only a 1.5 point performance drop” across GSM8K, BBH, ShareGPT, and Arxiv-March23 (LLaMA-7B compressor, GPT-3.5-Turbo target).
  • LongLLMLingua Jiang et al. (2024b): adds query-aware coarse-to-fine compression and document reordering for long-context RAG, boosting performance by up to 21.4% with ∼4× fewer tokens on NaturalQuestions, achieving a 94.0% cost reduction on LooGLE, and accelerating end-to-end latency 1.4–2.6× at 2–6× compression of ∼10K-token prompts.
  • LLMLingua-2 Pan et al. (2024): reframes compression as token classification with a BERT-sized bidirectional encoder distilled from GPT-4, giving task-agnostic compression that is 3–6× faster than LLMLingua and reduces end-to-end latency by up to 2.9× at 2–5× compression.
A systematic study Li et al. (2023) cautions that, surprisingly, extractive compression “often outperforms” token-pruning methods and enables up to 10× compression with minimal degradation—i.e. pruning is not always the best hard method. Recent sentence-level extractive pruners build on this insight: Provence Chirkova et al. (2025) recasts context pruning as binary sequence labeling jointly trained with a reranker, giving a near-zero-cost RAG step faster than LLMLingua, and EXIT Hwang et al. (2025) classifies sentences context-aware to preserve inter-sentence dependencies while avoiding the token-by-token decoding latency of abstractive compressors. For coding agents specifically, SWE-Pruner Wang et al. (2026) learns a lightweight, structure-preserving task-aware classifier that prunes 23–54% of tokens on SWE-bench Verified while raising success rates, reaching up to 14.84× compression on single-turn LongCodeQA. A faithfulness-oriented alternative replaces token-level scoring with discourse structure: EDU compression Zhou et al. (2025a) parses text into a tree of Elementary Discourse Units anchored to source indices and linearizes only the query-relevant sub-trees, a “structure-then-select” route that preserves inter-unit dependencies for long-document and agent context.

4.2. Soft and Latent Compression

This family is model-modifying: rather than rewrite the prompt in natural language, it compacts context inside learned representations (soft tokens, memory slots, or KV values). Because it requires training or fine-tuning the model, it is not closed-API-compatible, which constrains where it can be deployed in practice.
Soft methods compress context into a small number of continuous vectors (soft tokens / memory slots / KV values), trading model-agnosticism for higher ratios Li et al. (2025b).
The founding soft-token line established that a prompt can be replaced by a few learned vectors—but each method modifies the model and compresses holistically (re-running whenever any span changes), so we treat it as a brief lead-in: Gisting Mu et al. (2023) (NeurIPS 2023) trains “gist” tokens for up to 26× compression and 40% FLOPs reduction on short instructions; AutoCompressor Chevalier et al. (2023) (EMNLP 2023) recursively folds segments into “summary vectors” over sequences up to 30,720 tokens; ICAE Ge et al. (2024) (ICLR 2024) pairs a LoRA encoder with a frozen decoder for 4 × compression at ∼1% extra parameters and up to > 7 × cached-slot speedup; and 500xCompressor Li et al. (2025c) carries information in per-layer KV values to reach 6–480× while retaining 62–73% of capability.
Recent directions: ratio, amortization, and convergence with KV. Newer soft methods push two axes—compression ratio and amortization—and increasingly blur the soft/KV boundary. Activation Beacon Zhang et al. (2024a) distills context into the key–value activations of special “beacon” tokens via a sliding-window stream, extending Llama-2-7B from 4K to 400K tokens at ∼2× faster inference and lower KV-cache memory at near-lossless quality—soft-token and KV-cache compression converge when the learned soft tokens are themselves cached as KV states. LLoCO Tan et al. (2024) precomputes compressed representations plus per-document LoRA adapters offline, extending a 4K LLaMA2-7B to an effective 128K context with 30× fewer inference tokens and up to 7.62× speedup—paying the compression cost once and reusing it across many agent queries. For retrieval, xRAG Cheng et al. (2024) fuses a document’s dense-retrieval embedding into the LLM as a single soft token (frozen retriever and LLM), yielding a >10% average gain across six knowledge-intensive tasks at 3.53× fewer FLOPs, and COCOM Rau et al. (2025) compresses passages into a few context embeddings for up to 5.69× decoding speedup. A practical scalability limit is that most soft methods compress holistically, re-running the compressor whenever any span changes; CompLLM Berton et al. (2025) instead compresses fixed-size segments independently—linear in context length and cache-reusable—reporting up to 4× faster time-to-first-token and 50% smaller KV at long contexts, a property well-matched to incrementally-growing agent trajectories. Pushing the other way—scale rather than incrementality—LCLM (Latent Context Language Models) Li et al. (2026a) trains a small (0.6B) encoder to compress token sequences into latent embeddings for a larger (4B) decoder end-to-end on > 350 B tokens at fixed 1:4/1:8/1:16 ratios, reporting a better performance/speed/memory Pareto frontier than prior encoder–decoder soft compressors and signaling that soft compression is now being trained at pre-training scale. For agents specifically, the decisive property is amortization and segment-independence (LLoCO, CompLLM): because trajectories grow one event at a time, holistic compressors that must re-run on every change (gisting, ICAE) fit the re-prefill loop poorly, whereas cache-reusable segment compression does not.
The recurring limitation is that gisting/ICAE/AutoCompressor require modifying or fine-tuning the model, making them impractical for closed-source API agents—which is precisely why production general-purpose agents (Section 5) rely on hard compression and offloading instead. Autoencoding-free variants (e.g. contextual semantic anchors) Liu et al. (2025) are an active attempt to close this gap.

4.3. KV-Cache Compression and Serving-Time Controls

This family targets serving-time placement and compaction: it intervenes on the model’s internal key–value memory and on prefill compute during inference, rather than on the text of the prompt. Because these are deployment-time knobs on the inference stack, they are mostly relevant when self-hosting open-weight models; API-based agents cannot set them directly.
KV-cache methods compress the model’s internal key–value memory during inference, attacking the memory (and bandwidth) bottleneck of long contexts. They are largely training-free and hardware-compatible, and the literature has matured from per-token eviction into three structurally distinct mechanisms, surveyed comprehensively by Li et al. (2025a) (token-, model-, and system-level optimizations).
(i) Token eviction. StreamingLLM Xiao et al. (2024) (ICLR 2024) identifies the “attention sink” phenomenon—a few initial tokens absorb disproportionate attention—and keeps their KV plus a recency window, enabling stable modeling over 4M+ tokens with no fine-tuning (though it is content-agnostic and can discard semantically critical middle tokens). H2O Zhang et al. (2023) (NeurIPS 2023) keeps a small set of “Heavy Hitter” tokens carrying most attention mass plus recent tokens, improving throughput up to 29× and cutting KV memory up to 5 × without accuracy loss. SnapKV Li et al. (2024) (NeurIPS 2024) selects clustered important KV positions per head via a trailing prompt “observation window” and pooling, giving 3.6× faster generation and 8.2× memory savings at 16K context, fine-tuning-free. Rather than evict hard, a 2026 hybrid Meta-Soft Luo et al. (2026) synthesizes a few learnable soft tokens to stand in for removed entries and redistributes their attention mass into the retained cache—a soft-token/eviction blend that connects this section to Section 4.2.
(ii) Quantization. KIVI Liu et al. (2024b) (ICML 2024) quantizes the Key cache per-channel and the Value cache per-token to 2 bits with no fine-tuning, cutting peak memory ∼2.6× and raising throughput 2.35–3.47×—an axis orthogonal to eviction (fewer bits per entry rather than fewer entries).
(iii) Head/layer-structured allocation. Rather than a uniform budget, PyramidKV Cai et al. (2024) allocates layer-wise “pyramidal” budgets (more cache to lower layers), matching full-cache quality at ∼12% KV and beating H2O/SnapKV/StreamingLLM most at small budgets (64–128 tokens). DuoAttention Xiao et al. (2025) (ICLR 2025) splits heads into “retrieval heads” (full KV) and “streaming heads” (constant-length KV), reaching full accuracy at a 25–50% full-attention ratio and enabling 3.3M-token decoding on a single A100. Ada-KV Feng et al. (2025) provides the first head-wise adaptive budget allocation with a proven upper bound on attention-output error and plugs into SnapKV/PyramidKV for further gains on RULER and LongBench. RazorAttention Tang et al. (2025) (ICLR 2025) keeps a full cache only for retrieval heads, prunes remote tokens elsewhere, and recovers dropped content via a “compensation token”—compressing ∼70% of the KV cache (∼3×) with negligible degradation and FlashAttention compatibility. The common thread is that uniform per-token budgets are wasteful: allocating cache by head/layer importance is now the default, though all of these share the static-criticality weakness that Quest (below) exposes.
(iv) Low-rank / latent compression. A fourth, architectural mechanism compresses the KV cache into a low-rank latent rather than evicting or quantizing entries. The most production-impactful instance is Multi-head Latent Attention (MLA), introduced in DeepSeek-V2/V3, which projects keys and values into a small shared latent vector that is cached in place of full per-head KV, cutting KV memory by an order of magnitude while preserving quality DeepSeek-AI (2024); the broader low-rank line is catalogued as a distinct family by the KV-cache survey Li et al. (2025a). Unlike the post-hoc methods above, MLA is a model-design lever (chosen at pre-training), so it is available to agents only through the choice of base model rather than as a deployment-time knob.
Two caveats specific to agents. First, criticality is query-dependent: Quest Tang et al. (2024) (ICML 2024) shows that tokens deemed unimportant at prefill can become essential during decoding—precisely the failure mode static eviction triggers in multi-turn agents whose later queries revisit earlier context. Second, eviction interacts with safety: a 2025 study of five compression methods on Llama-3.1-8B and Qwen-2.5-14B finds compression does not degrade all instructions equally, and—using system-prompt leakage as a case study—shows leakage rises with compression and depends jointly on method, instruction order, and KV-eviction bias; because defense/guardrail instructions often sit in the (evictable) system prompt, aggressive KV compression can silently disable safety instructions Chen et al. (2025). A related but orthogonal lever is prefill-compute sparsification: MInference Jiang et al. (2024a) (NeurIPS 2024) exploits recurring dynamic sparse-attention patterns (A-shape, Vertical-Slash, Block-Sparse) to cut long-context prefill latency up to 10× at 1M tokens on an A100 with preserved accuracy, targeting the prefill bottleneck rather than KV memory.
Toward recoverable KV. Most of the above make permanent eviction decisions. KVzip Kim et al. (2025) (NeurIPS 2025, oral) instead scores each KV pair by how much it supports reconstructing the original context, producing a query-agnostic compressed cache reusable across future queries that cuts KV size 3–4× and decoding latency ∼2× with negligible loss—whereas query-aware eviction degrades even at a 90% budget under multi-query workloads. This directly matches the agent setting, where many unforeseen future queries are issued against the same history (Section 9). For agents, KV-cache compression is mostly relevant when self-hosting open-weight models; API-based agents cannot control it directly and instead rely on provider-side prompt caching (Section 5).

4.4. Retrieval and External-Memory Compression

The remaining, complementary family steps outside the model entirely. Where the natural-language summarization of Section 4.1 is destructive—once history is folded into a paraphrase the original spans are gone—retrieval and external-memory strategies are recoverable alternatives: they relocate context out of the window into a store that can be queried back, intervening at the placement and recovery stages of the lifecycle rather than discarding information outright. Compression rarely operates alone; the following strategies reduce or relocate context load while keeping a path back to the source.

4.4.1. Context Offloading (Filesystem as External Memory)

Rather than compress destructively, Manus treats “the file system as the ultimate context...unlimited in size, persistent by nature, and directly operable by the agent itself.” Its compression is “always designed to be restorable”: a web page’s content can be dropped as long as the URL is preserved, and a document’s content omitted if its path remains, so context shrinks Ji (2025, without permanent loss). The widely quoted “100:1” figure is best stated precisely: it is the average input-to-output token ratio Manus observed across millions of interactions (most spend is on processing context, not generation), which commentary frames as the motivation for restorable offloading rather than a measured lossless compression ratio Bhavsar (2025); the recoverability guarantee is what makes the offloading non-destructive. Anthropic’s Managed Agents generalize this to a durable session log queried via getEvents()—a context object living outside the model’s window Anthropic (2026a).
Offloading the tool surface, not just observations. A 2025 line of Anthropic engineering work offloads the often-overlooked cost of tool definitions and inter-tool data. Exposing MCP tool servers as code APIs—so the agent loads only the definitions it needs and filters results in a sandbox before they reach the model—reduced a representative workflow from 150,000 to 2,000 tokens (a 98.7% saving) Anthropic (2025b). A Tool Search Tool that discovers tools on demand rather than loading all definitions upfront cut tool-definition token overhead by ∼85% and left far more of the window for work—191,300 usable tokens with on-demand discovery vs. 122,800 when all definitions are preloaded, in Anthropic’s comparison—while raising tool-selection accuracy (49%→74% on one model), and Programmatic Tool Calling—orchestrating many tool calls inside one code block instead of round-tripping the model after each—cut average token usage on complex research tasks from 43,588 to 27,297 (37%) and eliminated 19+ inference passes when a task involved 20+ tool calls Anthropic (2025a).

4.4.2. Hierarchical/Virtual Memory (MemGPT, Letta)

Packer et al. (2023) (MemGPT) introduce virtual context management, an OS-inspired memory hierarchy: a fixed in-context “main” tier, plus “recall” (searchable history) and “archival” (vector storage) tiers, with the LLM itself issuing function calls to page information in and out—providing the “illusion” of unbounded context within a finite window. The successor framework Letta adds tiered core/recall/archival memory and background “sleeptime” agents for memory compaction Letta AI (2024). Cognitive taxonomies (episodic / semantic / procedural memory, per CoALA) underpin most modern agent-memory systems Sumers et al. (2024); Zhang et al. (2024d).
Production successors quantify what the virtual-memory abstraction buys. Mem0 Chhikara et al. (2025) dynamically extracts, consolidates, and retrieves salient facts, reporting 26% higher LLM-as-judge accuracy than a built-in memory baseline on the LoCoMo long-conversation benchmark while cutting p95 latency by 91% and token cost by over 90% versus passing the full conversation (its graph variant adds ∼2 points). MemoryOS Kang et al. (2025a) (EMNLP 2025, oral) makes the OS analogy explicit with three short/mid/long-term tiers and Store/Update/Retrieve/Response modules, reporting +49.11% F1 and +46.18% BLEU-1 on LoCoMo. Graph-structured memory is emerging as a competitive alternative to MemGPT’s vector tiers: Zep, built on the temporally-aware Graphiti knowledge-graph engine, surpasses MemGPT on Deep Memory Retrieval (94.8% vs. 93.4%) and improves LongMemEval accuracy up to 18.5% while reducing latency ∼90% versus a full-context baseline Rasmussen et al. (2025); A-MEM Xu et al. (2025) adds Zettelkasten-style note linking with “memory evolution” that updates old notes as new ones arrive. A 2025–2026 turn makes the memory operations themselves RL-learned rather than heuristic: Memory-R1 Yan et al. (2025) trains a manager to issue ADD/UPDATE/DELETE/NOOP over an external store (plus a learned distillation filter on retrieved memories) from only 152 QA pairs, and Mem- α  Wang et al. (2025b) and MemSearcher Yuan et al. (2025) learn end-to-end when to store/update/retrieve during long interactions—the external-store analogue of the in-context, learned compaction policies of Section 6.

4.4.3. Retrieval-Augmented Generation (RAG) for Context Reduction

RAG injects only retrieved-relevant context, but retrieved passages are themselves long, motivating retrieval compression. RECOMP Xu et al. (2024) (ICLR 2024) compresses retrieved documents into textual summaries before integration, offering both an extractive compressor (select useful sentences) and an abstractive one (synthesize a summary), reducing cost and mitigating “lost in the middle.” Later work adds adaptivity: AdaComp Zhang et al. (2024b) predicts a query- and retrieval-quality-dependent compression rate, and AttnComp Luo et al. (2025) uses Top-P attention-weight selection to reach a 17× average compression ratio across five QA datasets (12.6× on HotpotQA to 23.9× on PopQA)—and is the only evaluated compressor that raises end-task accuracy (+1.9 points over the uncompressed baseline, while competitors lose ≥3) while cutting end-to-end latency to 49% of the uncompressed pipeline. (For RAG, soft compression is increasingly competitive: xRAG and COCOM collapse a passage to one or a few embeddings; see Section 4.2.) (Historically, the AutoGPT team removed external vector databases in late 2023, finding brute-force file search sufficient—an early signal that heavyweight retrieval is often overkill for real agent workloads Significant-Gravitas (AutoGPT) (2023).)

4.5. Sub-Agent Isolation

Sub-agent isolation is fundamentally a placement strategy: instead of compacting old context, it keeps detailed exploration out of the orchestrator’s context in the first place, returning only a distilled summary to the lead agent.
Isolating work in sub-agents keeps detailed exploration out of the orchestrator’s context. In Anthropic’s multi-agent research system, “each subagent might explore extensively, using tens of thousands of tokens or more, but returns only a condensed, distilled summary of its work (often 1,000–2,000 tokens),” isolating search context from the lead agent; a Claude Opus 4 lead with Claude Sonnet 4 subagents “outperformed single-agent Claude Opus 4 by 90.2%” on their internal research eval, with token usage explaining ∼80% of performance variance Hadfield et al. (2025). This view is contested: Cognition (makers of Devin) argues against multi-agent designs for most tasks, advocating a single-threaded agent that shares full context and instead offloads long histories to a dedicated compression model that distills actions into key decisions and events—framing context isolation as a source of fragile, conflicting sub-decisions rather than a win Yan (2025). The cost/benefit of isolation is therefore task-dependent, not settled. OpenHands implements sub-agents as ordinary tools with isolated context All Hands AI (2025c); Hermes spawns isolated sub-agents and can “collapse multi-step pipelines into zero-context-cost turns via RPC” Nous Research (2026b). The trade-off is overhead: a single community estimate puts multi-agent coordination at ∼3.5× the token consumption of equivalent single-agent workflows because every handoff duplicates context Hayes (2026). The reconciling variable appears to be task decomposability: isolation pays off when subtasks are read-heavy and independent (open-ended research), whereas a single thread sharing full context wins when subtasks are tightly coupled and write-conflicting (iterative code editing)—which is why the strongest multi-agent results are reported on research-style evals and the strongest single-thread arguments come from coding agents. For long-form deep research specifically, Self-Manager Xu et al. (2026) pushes isolation to an OS-style abstraction, running multiple concurrent sub-threads under explicit “Thread Control Blocks” so no single window accumulates the full trajectory.

5. Production Patterns in General-Purpose Agents

The method families of Section 4 define the design space; the cleanest evidence for what actually works is in deployed general-purpose agents, where compression is the difference between a session that survives hundreds of tool calls and one that stalls against the context window. Stripped of benchmark framing, these systems converge on a small set of recurring patterns—trajectory compaction, budget guards, recoverable offloading, and cache-aware layouts—each an instantiation of the families just surveyed, which we organize below.

5.1. Trajectory Compaction in Deployed Agents

Hermes is the most precisely documented case Nous Research (2026a). Its context management is built on a pluggable ContextEngine; the default ContextCompressor runs two independent layers:
1.
Agent ContextCompressor (primary), fires at 50% of context using accurate API-reported token counts.
2.
Gateway session hygiene (safety net), fires at 85% using a rough character estimate, to catch sessions that ballooned between turns (e.g. overnight on Telegram/Discord).
The compressor runs a 4-phase algorithm: (1) cheaply prune old tool results >200 chars (“[Old tool output cleared...]”) with no LLM call; (2) determine boundaries protecting the first 3 messages (system + first exchange) and a token-budgeted tail (default ≥20 messages); (3) generate a structured summary (Goal / Constraints / Progress / Key Decisions / Relevant Files / Next Steps / Critical Context); (4) reassemble head + summary + tail, sanitizing orphaned tool-call pairs. On subsequent compressions it updates the previous summary rather than re-summarizing from scratch. A documented before/after example compacts 45 messages (∼95K tokens) to 25 messages (∼45K tokens). Separately, Hermes applies Anthropic prompt caching with a “system_and_3” breakpoint strategy that “reduces input token costs by ∼75% on multi-turn conversations” Nous Research (2026a).
Figure 7. A representative production trajectory-compaction design (Hermes-style). Two independent triggers—an accurate-token-count compressor at 50% and a character-estimate safety net at 85%—guard the window, and a four-phase rewrite prunes stale tool output, protects a head and a token-budgeted tail, regenerates a structured summary of the middle, and reassembles the transcript. Subsequent passes update the prior summary rather than re-summarizing from scratch.
Figure 7. A representative production trajectory-compaction design (Hermes-style). Two independent triggers—an accurate-token-count compressor at 50% and a character-estimate safety net at 85%—guard the window, and a four-phase rewrite prunes stale tool output, protects a head and a token-budgeted tail, regenerates a structured summary of the middle, and reassembles the transcript. Subsequent passes update the prior summary rather than re-summarizing from scratch.
Preprints 222693 g007
Other deployed agents share the compaction skeleton but differ in where the rewrite decision lives. Claude Code/Anthropic combine server-side compaction, context trimming (removing stale tool results / thinking blocks, e.g. clear_tool_uses_20250919), the memory tool, and sub-agent isolation Anthropic (2026a); All Hands AI (2025c). OpenHands offers nine pluggable condensers composable into pipelines, operating at the view level (inserting markers, never mutating the raw event stream) so sessions remain replayable; its condenser cut API cost ∼50% in deployment and held latency near 8 s vs. 16 s for the uncompressed baseline at iteration 100, resolving 200 vs. 203 SWE-bench Verified instances All Hands AI (2025a); Smith (2025); Wang et al. (2025a); Rombaut (2026). Cline notably delegates the compaction decision to the LLM via a condense tool and re-injects a task checklist (“Focus Chain”) every few messages to resist drift Rombaut (2026); Baumann (2025).

5.2. Budget Guards and Mundane Controls

OpenClaw does not use a tokenizer library; it estimates with a 4-chars≈1-token heuristic (2 chars/token for token-dense tool output) for pre-call guards, pruning, and adaptive sizing centminmod (2026). Its compression-relevant levers include: truncating oversized tool results (max ∼30% of the context window per result, hard cap 400,000 chars); a /compact summarization command; contextPruning (e.g. cache-ttl mode); on-demand MEMORY.md/memory-search rather than always-injecting long files; bootstrap-injection caps (bootstrapMaxChars, bootstrapTotalMaxChars); and Anthropic prompt caching (cache reads cost ∼10% of normal input tokens) auto-enabled for API-key sessions centminmod (2026); OpenClaw (2026c). A community “Context Manager” skill performs AI-summary-and-replace at 70–80% usage, backing up the original JSONL transcript to memory/compressed/ before resetting the session plgonzalezrx8 (2026), and a third-party “Context Optimizer” advertises 40–60% token reduction AtlasPA (2026). Empirically, the dominant cost driver is unbounded history, and the most effective mitigations reported by the community are mundane: model routing (cheap models for heartbeats), aggressive session resets/compaction, and cache-TTL alignment; community write-ups consistently claim (unaudited) 80–95% cost reductions from these combined LaoZhang AI (2026); Hayes (2026). A structural caveat: lowering historyLimit can increase tokens, because a too-short window pushes the agent to issue more memory_search/grep/read tool calls, each adding tokens Liu (2026).
The same mundane controls recur in the broader Claw ecosystem. ClawMobile inherits OpenClaw’s memory mechanism, embedding lightweight execution preferences and reusable task patterns into context or the retrieval path Du et al. (2026); MetaClaw injects distilled procedural skills into the prompt each round without weight updates Ji et al. (2026).

5.3. Recoverable Context by Design

A second axis separates agents that discard compacted content from those that keep it restorable. Manus treats the filesystem as externalized context, offloading state to files and re-reading on demand rather than holding everything in the window Ji (2025); OpenHands’ view-level condensers insert markers over a never-mutated raw event stream, so any session remains replayable from the underlying log All Hands AI (2025a); and MemGPT/Letta organize memory as an explicit hierarchy with paged in/out movement between a small in-context working set and larger external tiers Packer et al. (2023); Letta AI (2024). The shared idea is that compaction need not be lossy at the system level even when it is lossy in-window: the dropped tokens live in a file, an event log, or an external memory tier that the agent can page back. Section 4 gave the method detail for these mechanisms; here the point is operational—production agents lean on recoverability to make aggressive in-window compaction safe.

5.4. Prompt-Cache-Aware Layouts

Because providers bill cache reads at a fraction of fresh input tokens, the most token-efficient production layouts are organized around what the cache can keep warm. The recurring pattern is a stable system head, a protected recent tail, and a middle that is summarized by update rather than rewrite—so a single compaction does not invalidate the cached prefix on every turn. Hermes encodes this directly: its “system_and_3” breakpoint strategy caches the system prompt plus the first three messages and reports ∼75% input-cost reduction on multi-turn conversations, while its compressor updates the prior summary instead of regenerating it so the protected head stays cache-stable Nous Research (2026a). OpenClaw aligns its contextPruning with a cache-ttl mode and auto-enables Anthropic prompt caching for API-key sessions, where cache reads cost ∼10% of normal input tokens centminmod (2026). Both rest on the provider primitive that cached prefixes are billed at a steep discount and survive only as long as the prefix is left byte-stable across turns Anthropic (2024).

5.5. Production Agents at a Glance

The recurring pattern across these systems is trajectory compaction + tool-output pruning, typically paired with provider-side prompt caching; they differ most in recoverability—OpenHands’ view-level condensers and Manus’ filesystem offloading keep a replayable/restorable record, whereas pure summarization (Hermes, Cognition) does not—and in how far they push offloading (Manus, Claude Code, and OpenClaw relocate content to files or tools) versus sub-agent isolation (Hermes, Claude Code, OpenHands, and Manus spawn isolated sub-agents). Rather than a coarse per-family yes/no inventory, Table 3 makes the choices that actually distinguish agent designs comparable—trigger, protected span, compaction target, recovery source, and cache interaction. A finding worth stating explicitly is what the table cannot fill in: none of the surveyed production agents documents provenance tracking or privilege enforcement on compacted content—an empty cell in the design space that corroborates the lifecycle discussion of Section 3, where governance is a normative rather than observed stage, and the security concerns of Section 9.

6. Learned, Agent-Native Compression: The Frontier

The production designs above treat compression as an external heuristic scaffold. The fastest-moving line of 2025–2026 instead folds context management into the agent’s own learned policy, trained end-to-end with reinforcement learning. The common pattern is to make the compaction step an action: when the working context crosses a budget threshold, the agent (or a learned manager) emits a summary / memory-write / eviction, the window is reset to that compact state, and exploration resumes—so the effective horizon is the working window multiplied by the number of compactions. We group the cluster by what is learned; Figure 3 places it in time and Figure 8 situates its reductions against the other families. Table 4 maps each cluster back to the family and lifecycle axes of Section 3: every method here compresses in the hard/natural-language token space at the trajectory or memory level, and acts mainly at the compaction and placement stages, so the frontier is a learned-policy traversal of the same lifecycle rather than a fifth method family (we use “hard,” “natural-language,” and “token-space” interchangeably).

6.1. Compression as Action

Folding sub-trajectories. Context-Folding  Sun et al. (2025) trains an agent (via FoldGRPO) to branch into a sub-trajectory and “fold” it to a summary on completion, keeping the active context ∼10× smaller than ReAct while matching or beating it on Deep Research and SWE tasks; AgentFold Ye et al. (2025) adds multi-scale folding (granular condensation vs. deep consolidation), holding context to ∼7K tokens after 100 turns (scaling to 500) and reaching 36.2% on BrowseComp.
Summarization-augmented policy optimization (SUPO). SUPO Lu et al. (2025) puts the summarization-as-policy idea on a principled training footing. It formalizes a summarization-augmented MDP: whenever the accumulated context exceeds a threshold L, a summarization prompt is appended, the agent’s own policy generates a task-relevant summary, and the working context is reset to the initial prompt plus that summary (effective length L eff = L × ( S + 1 ) for S summarizations). The key result is a policy-gradient decomposition that splits a long rollout’s gradient into a sum over the summarized sub-trajectories, so standard GRPO/PPO-style infrastructure trains tool-use and summarization end-to-end on horizons far longer than the working window—no separately trained summarizer required. Three design choices carry the method: trajectory management across sub-trajectories; group-relative advantage estimation across the whole rollout group (computing advantage within a single trajectory costs 2.4 points on CodeGym); and an overlong-trajectory mask that stabilizes optimization (removing it collapses gains from + 3.2 to + 0.8 on CodeGym and from + 14.0 to + 5.0 on BrowseComp-Plus). Empirically, SUPO reaches 47.7 % vs. 44.5 % (vanilla multi-turn GRPO) on CodeGym using only a 4K working window for a 32K effective horizon ( 8 × ), and 53.0 % vs. 39.0 % on BrowseComp-Plus at a fixed 64K window; crucially, allowing more summarization rounds at test time than were seen in training pushes accuracy further to 60.0 % . SUPO subsumes segment-overwrite memory (MemAgent Yu et al. (2025)) as a special case and, unlike MEM1’s fixed-size state (Section 6.2, below), provably scales training beyond the reliable context window.
Summarization for deep web-search agents (ReSum). ReSumWu et al. (2025) specializes periodic summarization to long-horizon search, where context blow-up is most acute. As a plug-and-play ReAct replacement, when the trajectory nears the context budget it invokes a purpose-trained summary tool—ReSumTool-30B, an SFT of Qwen3-30B on <Conversation,Summary> pairs—that condenses the think/search/observe history into a structured “reasoning state” recording verified evidence plus an explicit list of remaining information gaps and next steps; the working history is reset to this compact state and exploration resumes from it. To teach the policy to reason well from summaries, ReSum-GRPO adapts GRPO with segmented-trajectory training and advantage broadcasting (the trajectory-level advantage is broadcast across all segments for long-horizon credit assignment). Training-free, ReSum already adds + 4.5 % over ReAct on average; after ReSum-GRPO the gain reaches + 8.2 % (GAIA Pass@1 45.0 47.3 48.5 , BrowseComp-en 12.8 16.0 18.3 , BrowseComp-zh 23.9 24.1 33.3 ), with the resulting agent (WebResummer-30B) trained on only ∼1K samples.

6.2. Memory as Action

Constant-memory consolidation (MEM1). MEM1 Zhou et al. (2025b) is the founding instance of making memory consolidation a learned action. Rather than letting the transcript grow, the agent maintains a single constant-size “internal state” that it rewrites every turn—integrating the prior state with the new observation while discarding redundant or now-irrelevant content—so memory consolidation and reasoning are optimized jointly and context no longer scales with the horizon. Trained end-to-end with RL, MEM1-7B improves task performance 3.5 × while using 3.7 ×  less memory than a 2 × -larger Qwen2.5-14B baseline on a 16-objective multi-hop QA task, and generalizes beyond its training horizon across retrieval QA, open-domain web QA, and multi-turn web shopping. Its limitation—a fixed-size state—is exactly what the next two methods relax.
Memory writes as learned actions. A parallel strand turns explicit memory edits into RL actions. Memory-as-Action Zhang et al. (2025b) treats working-memory deletes/inserts as actions, letting a 14B model match 16 × -larger models while cutting average context length 51 % . MemPO Li et al. (2026b) introduces a <mem> action (alongside <think> and tool calls) so the agent writes its own step-wise memory summary and is prompted only with the most recent <mem> state; it is trained with a dual advantage—a trajectory-level signal (answer-correctness and format) plus a memory-level signal that scores whether the memory content alone makes the correct answer likely—reporting + 25.98 F1 over its base model with 67– 73 % fewer tokens. AgeMem Yu et al. (2026) generalizes this to a full learned memory-op toolset (Add/Update/Delete/Retrieve/Summarize/Discard) trained with three-stage progressive RL.

6.3. Credit Assignment for Compression Decisions

Less-entangled credit for memory writes (HiMPO). These designs leave a subtle training problem. In a compressed-memory agent that rewrites a <mem> state each round, a single memory write is causally entangled with everything that follows it—tool calls, noisy observations, and downstream reasoning—so a trajectory-level reward can punish a faithful write for an unrelated later failure, or credit a lossy write that merely preceded success. HiMPO Yan et al. (2026) isolates a memory-specific advantage applied only to the <mem> tokens, built from a local counterfactual utility (how much rendering the identical pre-write state with the new rather than the previous memory raises the likelihood of the target outcome, independent of the later rollout) gated by a hindsight relevance filter (a retrospective gate that attenuates this credit when the realized outcome does not bear it out). Over MemPO’s combined-reward design, HiMPO reports sharper memory-drop attribution and gains of + 4.7 4.9 F1/EM and + 2.4 2.8 points on BrowseComp-Plus/FRAMES at essentially unchanged token budget, with an ablation identifying the retrospective gate as the component that does the disentangling.

6.4. Budget-Conditioned Managers

Budget-aware and externally-managed variants. ContextBudget (BACM-RL) Wu et al. (2026) conditions on the remaining token budget and chooses Null/Partial/Full compression under a curriculum that tightens the budget 8 K 4 K , beating MEM1 by 2.43 × on 32-objective QA and degrading gracefully as budgets shrink. A distinct design point keeps the agent frozen and learns an external manager: AdaCoM Yi et al. (2026) RL-trains a separate manager that edits a frozen agent’s context (averaging + 39 % over ReAct on BrowseComp-Plus and transferring across agent pairs), and ContextCurator Li et al. (2026c) trains a lightweight curator with multi-turn GRPO that rewrites working memory for a frozen executor, cutting DeepSearch context ∼8× ( 46.7 K 6.6 K tokens) while raising success ( 53.9 % 57.1 % ). These sharpen the external-scaffold vs. learned-policy axis (Section 3): they are learned but external, occupying the middle ground between training-free ACON and fully in-policy folding. Finally, RE-TRAC Zhu et al. (2026) compresses across trajectories, recursively distilling each search attempt into a structured state that seeds the next ( + 15 20 % on BrowseComp with monotonically falling tool calls and tokens).

6.5. Why the Frontier is Agent-Specific

Why now. This frontier is driven by long-horizon deep-research / web-search agents, where context blow-up is most acute and the bottleneck is increasingly efficiency rather than raw accuracy—e.g. Chen et al. (2026) cut average reasoning steps on BrowseComp by 70.7 % by acquiring evidence in parallel within a constrained budget. The unifying shift is from compression-as-scaffold to compression-as-policy, operationalizing Anthropic’s framing of compaction as managing a finite “attention budget” against the n 2 growth of pairwise token relationships Anthropic (2025c). Most of these methods compress natural-language summaries/memory at the trajectory level and are therefore orthogonal to (and combinable with) the KV/soft compression of Section 4.2 and Section 4.3.

6.6. Comparison of Methods

Table 5 and Table 6 consolidate reported quantitative results—single-call prompt/soft/KV compression and agent-level trajectory/memory compression, respectively—and Figure 8 plots the reported reduction factors across families on a shared linear scale (off-scale values are capped and annotated with their true value). Numbers are as-reported by the cited sources under heterogeneous settings and are not directly comparable across rows; treat them as order-of-magnitude evidence. Nor are they all instances of the compression ratio ρ = | C t | / | C ˜ t | defined in Section 3: the reported numbers mix prompt-token ratios, KV-memory and throughput multipliers, cost reductions, and effective-context extensions, and the caption and Table 5 and Table 6 state which quantity each number measures. The landscape shows a clear pattern: soft-token and recoverable-offload methods reach the most extreme ratios (but are lossy or recoverable-by-pointer), whereas KV-cache and the learned, agent-native methods occupy a more moderate, accuracy-preserving regime.

7. Evaluation: From Compression Ratio to Agent Utility

Compression ratio and single-call accuracy are the wrong yardsticks for agent compression, and reporting either in isolation hides the trade-off that actually matters. Most agent-compression results come from small instance counts (Focus: N = 5 ) or single scaffolds, and savings are highly task-dependent (exploration-heavy tasks benefit; iterative-refinement tasks can see compression overhead) Verma (2026). The problem is compounded by which long-context benchmark is used: HELMET Yen et al. (2025) shows that synthetic needle-in-a-haystack (NIAH) scores and arbitrary task subsets do not predict downstream behavior and can reorder model rankings, so a method that wins on one probe may lose on application-centric suites such as LongBench v2 Bai et al. (2024), Bench Zhang et al. (2024c), or BABILong Kuratov et al. (2024) (the NIAH test itself originates as an open-source pressure probe Kamradt (2023)). Crucially, long-context benchmarks score accuracy in isolation while agent-compression results report tokens in isolation; almost none score both. LoCoBench-Agent Qiu et al. (2025) is a rare exception, converting 8,000 software-engineering scenarios into interactive agent environments (10K–1M tokens, 8 tools) and reporting nine metrics split into comprehension and efficiency dimensions, surfacing an explicit comprehension–efficiency trade-off. Standardized agent-centric benchmarks that jointly report accuracy and peak/total tokens (as ACON and LoCoBench-Agent attempt) are needed Kang et al. (2025b); Qiu et al. (2025).
Metrics. A useful evaluation of agent compression must report a vector of quantities, not a single ratio: how well the task was done, how much context was billed at the peak and over the whole session, how much extra work (output and tool calls) the compression induced, how it interacts with the prompt cache, and whether the compacted context remains recoverable, faithful, and secure. Table 7 enumerates the reporting metrics we advocate, what each captures, and why it is needed. The set is deliberately full-session: peak context tokens bound the largest prefill the agent ever pays for, total session input tokens capture the cumulative repeated-prefill bill, and the cache and recovery rows capture failure modes (cache-miss spikes, delayed-relevance retrieval failures) that single-call accuracy cannot see.
Benchmarks. Existing benchmark families each measure a real property but none measures full-session agent utility on its own; Table 8 pairs each family with what it misses and the agent-specific addition required to make it diagnostic. Needle and retrieval probes measure positional recall but are weak predictors of tool-using agents; LongBench-style QA measures long-context answer quality but is single-shot rather than looped; SWE and web-agent suites measure task completion but are scaffold-dependent; and memory benchmarks measure multi-session recall but may ignore cost.
We frame these metrics and benchmark additions as a reporting protocol meant to be adopted, rather than an afterthought—a usable measurement guide alongside the map of the literature.

8. Design Guidelines and Recommendations

For practitioners building or operating general-purpose agents, we recommend a staged approach, ordered by effort-to-impact and aligned with the lifecycle taxonomy of Section 3. The ordering walks the lifecycle from cheapest, most reversible intervention to most invasive: first reduce admission—cap tool output, shorten tool schemas, and route cheap background turns to small models so fewer tokens ever enter the context; then stabilize layout for caching—fix a protected head, a compact middle, and a recent tail so the prompt prefix stays cache-stable; then choose recoverable placement—offload large artifacts to files, the raw transcript, or a retrieval store so dropped content can be re-fetched on demand; then add destructive compaction only when recovery is genuinely not needed; and finally consider learned policies or KV/soft compression when model access and the workload justify the added machinery. The staged recommendations below instantiate this progression.
1.
First, cheap structural fixes (highest ROI). Route low-value turns (heartbeats, status checks) to cheap models; reset sessions on task boundaries; truncate large tool outputs; keep always-injected bootstrap/system files short. Community write-ups report (unaudited) 80–95% cost reductions from these alone LaoZhang AI (2026); Hayes (2026); we present this ordering as a practitioner heuristic pending controlled measurement, not an established result. Threshold to revisit: if context still exceeds ∼50% of the window mid-task.
2.
Then, enable trajectory compaction with caching. Adopt an OpenHands-/Hermes-style condenser that fires at 50–80% utilization, protects the system prompt and a recent tail, summarizes the middle with a structured template, and updates (not re-creates) prior summaries. Align pruning TTL with prompt-cache TTL to avoid cache-miss spikes Nous Research (2026a); All Hands AI (2025a); Wu (2026). Benchmark to track: task success rate and peak tokens jointly; back off compression aggressiveness if success drops >2–3 points.
3.
Add recoverable offloading for large artifacts. Drop verbose content (web pages, file dumps) from context while keeping URLs/paths so it can be re-fetched; let the agent maintain a todo.md/scratchpad Ji (2025); Bhavsar (2025). Prefer this over destructive truncation whenever the artifact may be needed later.
4.
Isolate exploration in sub-agents for research/codebase-exploration tasks, returning only 1–2K-token summaries to the orchestrator—accepting the (community-estimated) ∼3.5× coordination overhead only when the task genuinely parallelizes Hadfield et al. (2025); Hayes (2026).
5.
Consider RAG/extractive compression (RECOMP-style) when context is dominated by retrievable documents; prefer extractive over heavy pruning given evidence that extraction often wins Xu et al. (2024); Li et al. (2023).
6.
Reserve soft/embedding and KV-cache compression for self-hosted open-weight deployments. Gisting/ICAE/500x and H2O/SnapKV give the largest ratios but need model access; they are not actionable for closed-API agents, which should instead rely on provider prompt caching and the above Mu et al. (2023); Ge et al. (2024); Zhang et al. (2023).
What would change these recommendations: (a) if model providers ship cheap, recoverable server-side compaction (as Anthropic Managed Agents trend toward), steps 2–3 collapse into the platform; (b) if context windows become effectively free of “context rot” (no degradation at 1M tokens), aggressive compression becomes harmful and should be relaxed; (c) if provenance-preserving compression matures, security concerns (step gating) ease.

9. Open Challenges

Cache-compression co-design. Compaction invalidates prompt-cache prefixes; misaligned pruning/cache TTLs cause expensive cache-miss spikes that can cost more than the tokens saved Wu (2026); centminmod (2026). As quantified in Section 2, cache reads are billed at only ∼0.1× input, so a compaction event that rewrites the cached prefix forfeits that discount and naive condensation can be a net cost increase Anthropic (2024). Co-designing compression with caching is an underexplored systems problem.
Recoverability and delayed relevance. Lossy compaction discards tokens whose future relevance is unknown. Anthropic notes “irreversible decisions to selectively retain or discard context can lead to failures” Anthropic (2026a), and lossy autocompaction can discard a session’s hard-won understanding wholesale—the 98% reduction documented in Section 2 Santoni (2026). Recoverable offloading and externalized context objects are the leading mitigation Ji (2025); Anthropic (2026a); inside the KV cache, the analogous move is reconstruction-scored compression—KVzip produces a query-agnostic, reusable compressed cache rather than query-conditioned eviction, which degrades under the many-unforeseen-queries workload typical of agents Kim et al. (2025). Recoverability is thus emerging as a first-class design axis, not an afterthought.
Faithfulness, drift, and provenance. Repeated summarization subtly rewords and de-prioritizes the original task, causing reasoning to diverge Zylos Research (2026). Agentic Context Engineering (ACE) names the two failure modes precisely: “brevity bias,” where successive summaries drop domain detail in favor of concise prose, and “context collapse,” where iterative rewriting erodes information over time. ACE counters both by treating context as an incrementally-updated “playbook” edited via structured delta updates that preserve provenance, reporting +10.6% on agent (AppWorld) and +8.6% on finance benchmarks with lower adaptation latency Zhang et al. (2025a). Iterative update-style summaries (Hermes) and structurally lossless trimming (DAG-based virtualization) are kindred responses Nous Research (2026a); Santoni (2026). Compression schemes that preserve provenance—tracking which tokens are derived, summarized, or verbatim—are therefore a prerequisite for trustworthy long-horizon agents, not merely a faithfulness nicety.
Security and privilege boundaries. Compression interacts with safety. KV-cache eviction can bias toward dropping system/defense instructions, enabling prompt leakage Chen et al. (2025). In the Claw ecosystem, ClawWorm demonstrates on an isolated OpenClaw testbed that flat context trust and unconditional configuration loading can enable persistent, self-propagating compromise Zhang et al. (2026); scheduled heartbeat turns add an unattended mechanism for reading or updating persistent state OpenClaw (2026b). Compression schemes that preserve provenance/privilege boundaries are a future need.
Benchmarking full-session utility. Long-context benchmarks score accuracy in isolation while agent-compression results report tokens in isolation; standardized agent-centric benchmarks that jointly report accuracy and peak/total tokens over a full session are still missing Kang et al. (2025b); Qiu et al. (2025). Section 7 treats this gap in detail.
Training stable compression policies. The most promising direction unifies threads above: agent-controlled (Focus), guideline-optimized and distilled (ACON), recoverable (Manus, KVzip), and provenance-aware (ACE) compression—ideally learned end-to-end. The clearest signal of this convergence is the move from compression-as-scaffold to compression-as-policy: Context-Folding, AgentFold, and Memory-as-Action train the agent itself to decide what to fold, consolidate, or delete, reporting order-of-magnitude active-context reductions at parity or better accuracy Sun et al. (2025); Ye et al. (2025); Zhang et al. (2025b). The open problem is training such policies stably: the compression decision is a discrete, high-variance action whose reward (downstream task success) is delayed and confounded with the base agent’s competence. 2026 commentary correspondingly suggests context-window size is plateauing while focus shifts to “hybrid compression+caching, and memory-augmented architectures” Zylos Research (2026).

Reproducibility and Provenance Statement

This survey introduces no new experiments or benchmarks of its own; every quantitative figure it reports is reproduced as-reported by the cited source. Because those sources measure under heterogeneous models, tasks, budgets, and scaffolds, the numbers are not directly comparable across methods unless the text explicitly says so, and should be read as order-of-magnitude evidence rather than head-to-head results. Community and vendor sources are tiered and flagged per the evidence policy of Section 1: peer-reviewed and arXiv-preprint work as primary evidence, first-party vendor engineering blogs and documentation as documented-but-non-archival, and community write-ups, third-party telemetry, and forum reports as unaudited signals that are never the sole basis for our conclusions or recommendations. Non-archival URLs carry access dates in the references and were checked against their live primary pages at the time of writing (June 2026). Finally, the figure sources (self-contained HTML/CSS) and the rendering scripts that produce every vector figure in this manuscript ship alongside it, so each figure can be regenerated from its data.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. All Hands AI. OpenHands context condensation for more efficient AI agents. All Hands AI (OpenHands) Blog, April 2025a. URL https://www.openhands.dev/blog/openhands-context-condensensation-for-more-efficient-ai-agents. Published 9 April 2025; accessed June 2026.
  2. All Hands AI. Context condenser (LLMSummarizingCondenser / RollingCondenser). OpenHands Documentation, 2025b. URL https://docs.openhands.dev/sdk/guides/context-condenser. Accessed 2026-06-24.
  3. All Hands AI. Sub-agent delegation. OpenHands SDK Documentation, 2025c. URL https://docs.openhands.dev/sdk/guides/agent-delegation. Accessed 2026-06-24. Sub-agents as tools with isolated context via DelegateTool / TaskToolSet.
  4. Anthropic. Prompt caching. Claude API Documentation, 2024. URL https://platform.claude.com/docs/en/build-with-claude/prompt-caching. Cache writes 1.25 × (5-min) / 2.0 × (1-hour) base input; cache reads 0.1 × (90% discount). Accessed 2026-06-24.
  5. Anthropic. Introducing advanced tool use on the Claude developer platform. Anthropic Engineering Blog, November 2025a. URL https://www.anthropic.com/engineering/advanced-tool-use. Published 24 November 2025. Authored by Bin Wu and the Claude Developer Platform team. On-page title rendered in sentence case: “Introducing advanced tool use on the Claude Developer Platform”; accessed June 2026.
  6. Anthropic. Code execution with MCP: Building more efficient agents. Anthropic Engineering Blog, November 2025b. URL https://www.anthropic.com/engineering/code-execution-with-mcp. Published 4 November 2025. Authored by Adam Jones and Conor Kelly. On-page title rendered in sentence case: “Code execution with MCP: Building more efficient agents”; accessed June 2026.
  7. Anthropic. Effective context engineering for AI agents. Anthropic Engineering Blog, September 2025c. URL https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents. Published 29 September 2025; accessed June 2026.
  8. Anthropic. Scaling managed agents: Decoupling the brain from the hands. Anthropic Engineering Blog, April 2026a. URL https://www.anthropic.com/engineering/managed-agents. Published 8 April 2026; accessed June 2026.
  9. Anthropic. Claude opus 4.6. Anthropic News, February 2026b. URL https://www.anthropic.com/news/claude-opus-4-6. Published 5 February 2026. Context compaction triggered at a configurable threshold (50K-token example in benchmark methodology); accessed June 2026.
  10. AtlasPA. OpenClaw context optimizer. GitHub repository, 2026. URL https://github.com/AtlasPA/openclaw-context-optimizer. Cited for an advertised 40–60% token reduction via intelligent context compression; accessed June 2026.
  11. Yushi Bai, Shangqing Tu, Jiajie Zhang, Hao Peng, Xiaozhi Wang, Xin Lv, Shulin Cao, Jiazheng Xu, Lei Hou, Yuxiao Dong, Jie Tang, and Juanzi Li. LongBench v2: Towards deeper understanding and reasoning on realistic long-context multitasks, 2024. URL https://arxiv.org/abs/2412.15204.
  12. Nick Baumann. How to think about context engineering in Cline. Cline Blog, August 2025. URL https://cline.bot/blog/how-to-think-about-context-engineering-in-cline. Published 19 August 2025. On-page title: “How to Think about Context Engineering in Cline”; accessed June 2026.
  13. Gabriele Berton, Jayakrishnan Unnikrishnan, Son Tran, and Mubarak Shah. Compllm: Compression for long context q&a, 2025. URL https://arxiv.org/abs/2509.19228.
  14. Pratik Bhavsar. Deep dive into context engineering for agents. Galileo AI Blog, https://galileo.ai/blog/context-engineering-for-agents, sep 2025. Accessed 2026-06-24.
  15. Zefan Cai, Yichi Zhang, Bofei Gao, Yuliang Liu, Yucheng Li, Tianyu Liu, Keming Lu, Wayne Xiong, Yue Dong, Junjie Hu, and Wen Xiao. PyramidKV: Dynamic KV cache compression based on pyramidal information funneling. 2024. URL https://arxiv.org/abs/2406.02069.
  16. centminmod. explain-openclaw: Multi-AI documentation for OpenClaw (architecture, token/context optimization, security). GitHub repository, 2026. URL https://github.com/centminmod/explain-openclaw. Cited for OpenClaw’s tokenizer-free ∼4-chars-per-token estimation, tool-result truncation, contextPruning, and bootstrap-injection size caps (see 06-optimizations/cost-token-optimization.md); accessed June 2026.
  17. Alex Chen, Renato Geh, Aditya Grover, Guy Van den Broeck, and Daniel Israel. The pitfalls of KV cache compression, 2025. URL https://arxiv.org/abs/2510.00231.
  18. Qianben Chen, Tianrui Qin, King Zhu, Qiexiang Wang, Chengjun Yu, Shu Xu, Jiaqi Wu, Jiayu Zhang, Xinpeng Liu, Xin Gui, Jingyi Cao, Piaohong Wang, Dingfeng Shi, He Zhu, Tiannan Wang, Yuqing Wang, Maojia Song, Tianyu Zheng, Ge Zhang, Jian Yang, Jiaheng Liu, Minghao Liu, Yuchen Eleanor Jiang, and Wangchunshu Zhou. Search more, think less: Rethinking long-horizon agentic search for efficiency and generalization, 2026. URL https://arxiv.org/abs/2602.22675.
  19. Xin Cheng, Xun Wang, Xingxing Zhang, Tao Ge, Si-Qing Chen, Furu Wei, Huishuai Zhang, and Dongyan Zhao. xrag: Extreme context compression for retrieval-augmented generation with one token. In Advances in Neural Information Processing Systems (NeurIPS), 2024. URL https://arxiv.org/abs/2405.13792.
  20. Alexis Chevalier, Alexander Wettig, Anirudh Ajith, and Danqi Chen. Adapting language models to compress contexts. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3829–3846. Association for Computational Linguistics, 2023. URL https://aclanthology.org/2023.emnlp-main.232/.
  21. Prateek Chhikara, Dev Khant, Saket Aryan, Taranjeet Singh, and Deshraj Yadav. Mem0: Building production-ready AI agents with scalable long-term memory. arXiv preprint arXiv:2504.19413, 2025. URL https://arxiv.org/abs/2504.19413.
  22. Nadezhda Chirkova, Thibault Formal, Vassilina Nikoulina, and Stéphane Clinchant. Provence: Efficient and robust context pruning for retrieval-augmented generation. In International Conference on Learning Representations (ICLR), 2025. URL https://arxiv.org/abs/2501.16214.
  23. DeepSeek-AI. DeepSeek-V2: A strong, economical, and efficient mixture-of-experts language model, 2024. URL https://arxiv.org/abs/2405.04434. Introduces Multi-head Latent Attention (MLA): low-rank latent compression of the KV cache.
  24. Hongchao Du, Shangyu Wu, Qiao Li, Riwei Pan, Jinheng Li, Youcheng Sun, and Chun Jason Xue. ClawMobile: Rethinking smartphone-native agentic systems, 2026. URL https://arxiv.org/abs/2602.22942. Cited for ClawMobile’s memory mechanism, built on OpenClaw.
  25. Pengfei Du. Memory for autonomous llm agents: Mechanisms, evaluation, and emerging frontiers, 2026. URL https://arxiv.org/abs/2603.07670.
  26. Yuan Feng, Junlin Lv, Yukun Cao, Xike Xie, and S. Kevin Zhou. Ada-KV: Optimizing KV cache eviction by adaptive budget allocation for efficient LLM inference. In Advances in Neural Information Processing Systems (NeurIPS), 2025. URL https://arxiv.org/abs/2407.11550.
  27. Tao Ge, Jing Hu, Lei Wang, Xun Wang, Si-Qing Chen, and Furu Wei. In-context autoencoder for context compression in a large language model. In International Conference on Learning Representations (ICLR), 2024. URL https://arxiv.org/abs/2307.06945.
  28. Jeremy Hadfield, Barry Zhang, Kenneth Lien, Florian Scholz, Jeremy Fox, and Daniel Ford. How we built our multi-agent research system. Anthropic Engineering Blog, June 2025. URL https://www.anthropic.com/engineering/multi-agent-research-system. Published 13 June 2025; accessed June 2026.
  29. Ellie Grace Hayes. How to reduce your OpenClaw API costs by 90% or more. LumaDock (blog), 2026. URL https://lumadock.com/tutorials/openclaw-cost-optimization-budgeting. Community write-up cited for ∼3.5 × multi-agent coordination token overhead and heartbeat cost figures; accessed June 2026.
  30. Kelly Hong, Anton Troynikov, and Jeff Huber. Context rot: How increasing input tokens impacts LLM performance. Technical report, Chroma, July 2025. URL https://research.trychroma.com/context-rot. Accessed June 2026.
  31. Cheng-Ping Hsieh, Simeng Sun, Samuel Kriman, Shantanu Acharya, Dima Rekesh, Fei Jia, Yang Zhang, and Boris Ginsburg. RULER: What’s the real context size of your long-context language models? In Conference on Language Modeling (COLM), 2024. URL https://arxiv.org/abs/2404.06654.
  32. Taeho Hwang, Sukmin Cho, Soyeong Jeong, Hoyun Song, SeungYoon Han, and Jong C. Park. EXIT: Context-aware extractive compression for enhancing retrieval-augmented generation. In Findings of the Association for Computational Linguistics: ACL 2025. Association for Computational Linguistics, 2025. URL https://arxiv.org/abs/2412.12559.
  33. Haonian Ji, Kaiwen Xiong, Siwei Han, Peng Xia, Shi Qiu, Yiyang Zhou, Jiaqi Liu, Jinlong Li, Bingzhou Li, Zeyu Zheng, Cihang Xie, and Huaxiu Yao. ClawArena: Benchmarking AI agents in evolving information environments, 2026. URL https://arxiv.org/abs/2604.04202. Cited for MetaClaw’s distilled procedural-skill injection that adapts behavior without weight updates.
  34. Yichao Ji. Context engineering for AI agents: Lessons from building Manus. Manus Blog, https://manus.im/blog/Context-Engineering-for-AI-Agents-Lessons-from-Building-Manus, jul 2025. Accessed 2026-06-24.
  35. Huiqiang Jiang, Qianhui Wu, Chin-Yew Lin, Yuqing Yang, and Lili Qiu. LLMLingua: Compressing prompts for accelerated inference of large language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 13358–13376, Singapore, December 2023a. Association for Computational Linguistics. URL https://aclanthology.org/2023.emnlp-main.825/. [CrossRef]
  36. Huiqiang Jiang, Qianhui Wu, Chin-Yew Lin, Yuqing Yang, and Lili Qiu. LLMLingua: Innovating LLM efficiency with prompt compression. Microsoft Research Blog, December 2023b. URL https://www.microsoft.com/en-us/research/blog/llmlingua-innovating-llm-efficiency-with-prompt-compression/. Accessed: 2026-06-24.
  37. Huiqiang Jiang, Yucheng Li, Chengruidong Zhang, Qianhui Wu, Xufang Luo, Surin Ahn, Zhenhua Han, Amir H. Abdi, Dongsheng Li, Chin-Yew Lin, Yuqing Yang, and Lili Qiu. MInference 1.0: Accelerating pre-filling for long-context LLMs via dynamic sparse attention. In Advances in Neural Information Processing Systems (NeurIPS), 2024a. URL https://arxiv.org/abs/2407.02490.
  38. Huiqiang Jiang, Qianhui Wu, Xufang Luo, Dongsheng Li, Chin-Yew Lin, Yuqing Yang, and Lili Qiu. LongLLMLingua: Accelerating and enhancing LLMs in long context scenarios via prompt compression. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1658–1677, Bangkok, Thailand, August 2024b. Association for Computational Linguistics. URL https://aclanthology.org/2024.acl-long.91/. [CrossRef]
  39. Greg Kamradt. Needle in a haystack – pressure testing LLMs. https://github.com/gkamradt/LLMTest_NeedleInAHaystack, 2023. Open-source long-context recall evaluation; accessed June 2026.
  40. Jiazheng Kang, Mingming Ji, Zhe Zhao, and Ting Bai. Memory OS of AI agent. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2025a. URL https://arxiv.org/abs/2506.06326. Oral. arXiv:2506.06326.
  41. Minki Kang, Wei-Ning Chen, Dongge Han, Huseyin A. Inan, Lukas Wutschitz, Yanzhi Chen, Robert Sim, and Saravan Rajmohan. ACON: Optimizing context compression for long-horizon LLM agents. arXiv preprint arXiv:2510.00615, 2025b. URL https://arxiv.org/abs/2510.00615. Accepted to ICML 2026.
  42. Jang-Hyun Kim, Jinuk Kim, Sangwoo Kwon, Jae W. Lee, Sangdoo Yun, and Hyun Oh Song. Kvzip: Query-agnostic kv cache compression with context reconstruction. In Advances in Neural Information Processing Systems (NeurIPS), 2025. URL https://arxiv.org/abs/2505.23416.
  43. Yuri Kuratov, Aydar Bulatov, Petr Anokhin, Ivan Rodkin, Dmitry Sorokin, Artyom Sorokin, and Mikhail Burtsev. BABILong: Testing the limits of LLMs with long context reasoning-in-a-haystack. In Advances in Neural Information Processing Systems (NeurIPS), Datasets and Benchmarks Track, 2024. URL https://arxiv.org/abs/2406.10149.
  44. LaoZhang AI. OpenClaw cost optimization: Complete token-management guide. Blog, 2026. URL https://blog.laozhang.ai/en/posts/openclaw-cost-optimization-token-management. Community write-up cited for context-accumulation telemetry: 40–50% of token usage and a session occupying 56–58% of a 400K window (∼230K tokens re-sent per message). Vendor blog; figures are self-reported; accessed June 2026.
  45. Letta AI. Letta: The platform for building stateful agents (formerly MemGPT). https://www.letta.com/, 2024. Successor framework to MemGPT; OS-inspired tiered memory (core/recall/archival) with background sleeptime memory compaction. Accessed 2026-06-24.
  46. Ang Li, Sean McLeish, Haozhe Chen, Nimit Kalra, Zaiqian Chen, Artem Gazizov, Venkata Anoop Suhas Kumar Morisetty, Bhavya Kailkhura, Harshitha Menon, Zhuang Liu, Brian R. Bartoldson, Tom Goldstein, Sanae Lotfi, Micah Goldblum, and Pavel Izmailov. End-to-end context compression at scale, 2026a. URL https://arxiv.org/abs/2606.09659.
  47. Haoyang Li, Yiming Li, Anxin Tian, Tianhao Tang, Zhanchao Xu, Xuejia Chen, Nicole Hu, Wei Dong, Qing Li, and Lei Chen. A survey on large language model acceleration based on KV cache management. Transactions on Machine Learning Research (TMLR), 2025a. URL https://arxiv.org/abs/2412.19442.
  48. Ruoran Li, Xinghua Zhang, Haiyang Yu, Shitong Duan, Xiang Li, Wenxin Xiang, Chonghua Liao, Xudong Guo, Yongbin Li, and Jinli Suo. MemPO: Self-memory policy optimization for long-horizon agents, 2026b. URL https://arxiv.org/abs/2603.00680.
  49. Xiaozhe Li, Tianyi Lyu, Yizhao Yang, Liang Shan, Siyi Yang, Ligao Zhang, Zhuoyi Huang, Qingwen Liu, and Yang Li. Escaping the context bottleneck: Active context curation for llm agents via reinforcement learning, 2026c. URL https://arxiv.org/abs/2604.11462.
  50. Yucheng Li, Bo Dong, Chenghua Lin, and Frank Guerin. Compressing context to enhance inference efficiency of large language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6342–6353, Singapore, December 2023. Association for Computational Linguistics. URL https://aclanthology.org/2023.emnlp-main.391/. [CrossRef]
  51. Yuhong Li, Yingbing Huang, Bowen Yang, Bharat Venkitesh, Acyr Locatelli, Hanchen Ye, Tianle Cai, Patrick Lewis, and Deming Chen. SnapKV: LLM knows what you are looking for before generation. In Advances in Neural Information Processing Systems (NeurIPS), 2024. URL https://arxiv.org/abs/2404.14469.
  52. Zongqian Li, Yinhong Liu, Yixuan Su, and Nigel Collier. Prompt compression for large language models: A survey. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers). Association for Computational Linguistics, 2025b. URL https://aclanthology.org/2025.naacl-long.368/.
  53. Zongqian Li, Yixuan Su, and Nigel Collier. 500xcompressor: Generalized prompt compression for large language models. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (ACL). Association for Computational Linguistics, 2025c. URL https://arxiv.org/abs/2408.03094.
  54. Tobias Lindenbauer et al. The complexity trap: Simple observation masking is as efficient as LLM summarization for agent context management. In Proceedings of the 4th Deep Learning for Code (DL4Code) Workshop at NeurIPS, 2025. URL https://arxiv.org/abs/2508.21433. JetBrains Research.
  55. Jim Liu. OpenClaw context management guide: Prevent memory loss and token waste. OpenAI Tools Hub (third-party blog; unaffiliated with OpenAI), 2026. URL https://www.openaitoolshub.org/en/blog/openclaw-context-management-guide. Community write-up cited for the caveat that lowering historyLimit can increase tokens via memory_search/grep/read amplification; accessed June 2026.
  56. Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang. Lost in the middle: How language models use long contexts. Transactions of the Association for Computational Linguistics, 12:157–173, 2024a. URL https://aclanthology.org/2024.tacl-1.9/. [CrossRef]
  57. Xin Liu, Runsong Zhao, Pengcheng Huang, Xinyu Liu, Junyi Xiao, Chunyang Xiao, Tong Xiao, Shengxiang Gao, Zhengtao Yu, and Jingbo Zhu. Autoencoding-free context compression for llms via contextual semantic anchors, 2025. URL https://arxiv.org/abs/2510.08907.
  58. Zirui Liu, Jiayi Yuan, Hongye Jin, Shaochen Zhong, Zhaozhuo Xu, Vladimir Braverman, Beidi Chen, and Xia Hu. KIVI: A tuning-free asymmetric 2bit quantization for KV cache. In Proceedings of the 41st International Conference on Machine Learning (ICML), 2024b. URL https://arxiv.org/abs/2402.02750.
  59. Miao Lu, Weiwei Sun, Weihua Du, Zhan Ling, Xuesong Yao, Kang Liu, and Jiecao Chen. Scaling LLM multi-turn RL with end-to-end summarization-based context management. arXiv preprint arXiv:2510.06727, 2025. URL https://arxiv.org/abs/2510.06727.
  60. Lvzhou Luo, Yixuan Cao, and Ping Luo. AttnComp: Attention-guided adaptive context compression for retrieval-augmented generation. In Findings of the Association for Computational Linguistics: EMNLP 2025, pages 8456–8472, 2025. URL https://arxiv.org/abs/2509.17486. arXiv:2509.17486.
  61. Wei Luo, Yi Huang, Songchen Ma, Huanyu Qu, Jiang Cai, and Mingkun Xu. Meta-soft: Leveraging composable meta-tokens for context-preserving kv cache compression, 2026. URL https://arxiv.org/abs/2605.22337.
  62. Lingrui Mei, Jiayu Yao, Yuyao Ge, Yiwei Wang, Baolong Bi, Yujun Cai, Jiazhi Liu, Mingyu Li, Zhong-Zhi Li, Duzhen Zhang, Chenlin Zhou, Jiayi Mao, Tianze Xia, Jiafeng Guo, and Shenghua Liu. A survey of context engineering for large language models. arXiv preprint arXiv:2507.13334, 2025. URL https://arxiv.org/abs/2507.13334.
  63. Microsoft Research. LLMLingua series: Effectively deliver information to LLMs via prompt compression. Microsoft Research Project Page, 2024. URL https://www.microsoft.com/en-us/research/project/llmlingua/. Project site mirror at https://llmlingua.com/. Accessed: 2026-06-24.
  64. Ali Modarressi, Hanieh Deilamsalehy, Franck Dernoncourt, Trung Bui, Ryan A. Rossi, Seunghyun Yoon, and Hinrich Schütze. NoLiMa: Long-context evaluation beyond literal matching. In International Conference on Machine Learning (ICML), 2025. URL https://arxiv.org/abs/2502.05167.
  65. Jesse Mu, Xiang Lisa Li, and Noah Goodman. Learning to compress prompts with gist tokens. In Advances in Neural Information Processing Systems (NeurIPS), volume 36, 2023. URL https://arxiv.org/abs/2304.08467.
  66. Nous Research. Hermes Agent: Context compression and caching. Developer documentation, 2026a. URL https://hermes-agent.nousresearch.com/docs/developer-guide/context-compression-and-caching. Cited for the dual ContextEngine/ContextCompressor design (50% agent / 85% gateway triggers), the multi-phase compaction, and the “system_and_3” prompt-cache breakpoint strategy. Source: https://github.com/NousResearch/hermes-agent; accessed June 2026.
  67. Nous Research. Hermes Agent. Project website, 2026b. URL https://hermes-agent.nousresearch.com/. Cited for isolated sub-agents and Python-RPC turns that collapse multi-step pipelines into “zero-context-cost” turns. Repository: https://github.com/NousResearch/hermes-agent; accessed June 2026.
  68. OpenAI. Prompt caching in the API. OpenAI, October 2024. URL https://openai.com/index/api-prompt-caching/. Announced 1 October 2024. Automatic 50% discount on cached input tokens for prompts ≥1,024 tokens; accessed June 2026.
  69. OpenClaw. The OpenClaw ecosystem. Official project website, 2026a. URL https://openclaw.ai/ecosystem/. Cited for the family of Claw-ecosystem variants (the official page describes a federation of ∼70 projects). Associated GitHub star-count growth figures are community-reported and not independently corroborated; accessed June 2026.
  70. OpenClaw. OpenClaw documentation: Agent workspace and bootstrap files. Official documentation, 2026b. URL https://docs.openclaw.ai/concepts/agent-workspace. Cited for SOUL.md/AGENTS.md/MEMORY.md/HEARTBEAT.md bootstrap injection; heartbeat-run mechanics at https://docs.openclaw.ai/gateway/heartbeat; accessed June 2026.
  71. OpenClaw. OpenClaw documentation: Token use and costs. Official documentation, 2026c. URL https://docs.openclaw.ai/reference/token-use. OpenClaw token-accounting docs: cache reads are “significantly cheaper than input tokens,” deferring the exact rate to provider (Anthropic) pricing, where a cache read is ∼10% of the input-token price; accessed June 2026.
  72. Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang, Shishir G. Patil, Ion Stoica, and Joseph E. Gonzalez. MemGPT: Towards LLMs as operating systems. arXiv preprint arXiv:2310.08560, 2023. URL https://arxiv.org/abs/2310.08560.
  73. Zhuoshi Pan, Qianhui Wu, Huiqiang Jiang, Menglin Xia, Xufang Luo, Jue Zhang, Qingwei Lin, Victor Rühle, Yuqing Yang, Chin-Yew Lin, H. Vicky Zhao, Lili Qiu, and Dongmei Zhang. LLMLingua-2: Data distillation for efficient and faithful task-agnostic prompt compression. In Findings of the Association for Computational Linguistics: ACL 2024, pages 963–981, Bangkok, Thailand, August 2024. Association for Computational Linguistics. URL https://aclanthology.org/2024.findings-acl.57/. [CrossRef]
  74. Joon Sung Park, Joseph C. O’Brien, Carrie J. Cai, Meredith Ringel Morris, Percy Liang, and Michael S. Bernstein. Generative agents: Interactive simulacra of human behavior. In Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology (UIST ’23), San Francisco, CA, USA, 2023. Association for Computing Machinery. URL https://dl.acm.org/doi/10.1145/3586183.3606763. [CrossRef]
  75. plgonzalezrx8. OpenClaw context manager skill. GitHub repository (OpenClaw-Skills), 2026. URL https://github.com/plgonzalezrx8/OpenClaw-Skills/blob/master/context-manager/SKILL.md. Cited for AI-summary-and-replace at 70–80% context usage with a JSONL backup written to memory/compressed/ before session reset; accessed June 2026.
  76. Jielin Qiu, Zuxin Liu, Zhiwei Liu, Rithesh Murthy, Jianguo Zhang, Haolin Chen, Shiyu Wang, Ming Zhu, Liangwei Yang, Juntao Tan, Roshan Ram, Akshara Prabhakar, Tulika Awalgaonkar, Zixiang Chen, Zhepeng Cen, Cheng Qian, Shelby Heinecke, Weiran Yao, Silvio Savarese, Caiming Xiong, and Huan Wang. Locobench-agent: An interactive benchmark for LLM agents in long-context software engineering, 2025. URL https://arxiv.org/abs/2511.13998.
  77. Preston Rasmussen, Pavlo Paliychuk, Travis Beauvais, Jack Ryan, and Daniel Chalef. Zep: A temporal knowledge graph architecture for agent memory. arXiv preprint arXiv:2501.13956, 2025. URL https://arxiv.org/abs/2501.13956.
  78. David Rau, Shuai Wang, Hervé Déjean, and Stéphane Clinchant. Context embeddings for efficient answer generation in rag. In Proceedings of the 18th ACM International Conference on Web Search and Data Mining (WSDM). ACM, 2025. URL https://arxiv.org/abs/2407.09252. [CrossRef]
  79. Benjamin Rombaut. Inside the scaffold: A source-code taxonomy of coding agent architectures. arXiv preprint arXiv:2604.03515, 2026. URL https://arxiv.org/abs/2604.03515.
  80. Cosmo Santoni. Contextual memory virtualisation: DAG-based state management and structurally lossless trimming for LLM agents, 2026. URL https://arxiv.org/abs/2602.22402. Cited for the observed 132K→2.3K-token (98%) autocompaction reduction and DAG-based context virtualization.
  81. Significant-Gravitas (AutoGPT). Vector memory revamp: Removing external vector databases from AutoGPT. GitHub Pull Request #4208, https://github.com/Significant-Gravitas/AutoGPT/pull/4208, 2023. Replaced external vector-DB backends with a JSON store and brute-force NumPy similarity search; merged 2023-05-25. Accessed 2026-06-24.
  82. Calvin Smith. Improve performance of LLM summarizing condenser. OpenHands GitHub Pull Request #6597, 2025. URL https://github.com/OpenHands/OpenHands/pull/6597. Latency ∼8s with condenser vs 16s baseline at iteration 100; 200 vs 203 SWE-bench Verified instances; accessed June 2026.
  83. Theodore R. Sumers, Shunyu Yao, Karthik Narasimhan, and Thomas L. Griffiths. Cognitive architectures for language agents. Transactions on Machine Learning Research (TMLR), 2024. URL https://arxiv.org/abs/2309.02427. arXiv:2309.02427.
  84. Weiwei Sun, Miao Lu, Zhan Ling, Kang Liu, Xuesong Yao, Yiming Yang, and Jiecao Chen. Scaling long-horizon llm agent via context-folding. arXiv preprint arXiv:2510.11967, 2025. URL https://arxiv.org/abs/2510.11967.
  85. Sijun Tan, Xiuyu Li, Shishir G. Patil, Ziyang Wu, Tianjun Zhang, Kurt Keutzer, Joseph E. Gonzalez, and Raluca Ada Popa. Lloco: Learning long contexts offline. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, 2024. URL https://arxiv.org/abs/2404.07979.
  86. Hanlin Tang, Yang Lin, Jing Lin, Qingsen Han, Shikuan Hong, Yiwu Yao, and Gongyi Wang. RazorAttention: Efficient KV cache compression through retrieval heads. In International Conference on Learning Representations (ICLR), 2025. URL https://arxiv.org/abs/2407.15891.
  87. Jiaming Tang, Yilong Zhao, Kan Zhu, Guangxuan Xiao, Baris Kasikci, and Song Han. Quest: Query-aware sparsity for efficient long-context LLM inference. In Proceedings of the 41st International Conference on Machine Learning (ICML), 2024. URL https://arxiv.org/abs/2406.10774.
  88. Nikhil Verma. Active context compression: Autonomous memory management in LLM agents. arXiv preprint arXiv:2601.07190, 2026. URL https://arxiv.org/abs/2601.07190. The agent/system is referred to as the “Focus Agent”.
  89. Qingyue Wang, Yanhe Fu, Yanan Cao, Shuai Wang, Zhiliang Tian, and Liang Ding. Recursively summarizing enables long-term dialogue memory in large language models. arXiv preprint arXiv:2308.15022, 2023. URL https://arxiv.org/abs/2308.15022. Journal version in Neurocomputing (2025). [CrossRef]
  90. Xingyao Wang, Simon Rosenberg, Juan Michelini, Calvin Smith, Hoang Tran, Engel Nyst, Rohit Malhotra, Xuhui Zhou, Valerie Chen, Robert Brennan, and Graham Neubig. The OpenHands software agent SDK: A composable and extensible foundation for production agents. arXiv preprint arXiv:2511.03690, 2025a. URL https://arxiv.org/abs/2511.03690.
  91. Yu Wang, Ryuichi Takanobu, Zhiqi Liang, Yuzhen Mao, Yuanzhe Hu, Julian McAuley, and Xiaojian Wu. Mem-α: Learning memory construction via reinforcement learning, 2025b. URL https://arxiv.org/abs/2509.25911.
  92. Yuhang Wang, Yuling Shi, Mo Yang, Rongrui Zhang, Shilin He, Heng Lian, Yuting Chen, Siyu Ye, Kai Cai, and Xiaodong Gu. SWE-Pruner: Self-adaptive context pruning for coding agents. arXiv preprint arXiv:2601.16746, 2026. URL https://arxiv.org/abs/2601.16746.
  93. Keying Wu. How to cut 90% of your OpenClaw token usage. AI Agents Hub (blog), 2026. URL https://www.aiagentshub.net/blog/openclaw-token-cost-optimization-guide. Community write-up cited for heartbeat token/cost estimates (a 5-min heartbeat carrying 50K tokens ≈600K input tokens/hour) and cache-TTL misalignment cost spikes; accessed June 2026.
  94. Xixi Wu, Kuan Li, Yida Zhao, Liwen Zhang, Litu Ou, Huifeng Yin, Zhongwang Zhang, Xinmiao Yu, Dingchu Zhang, Yong Jiang, Pengjun Xie, Fei Huang, Minhao Cheng, Shuai Wang, Hong Cheng, and Jingren Zhou. ReSum: Unlocking long-horizon search intelligence via context summarization. arXiv preprint arXiv:2509.13313, 2025. URL https://arxiv.org/abs/2509.13313.
  95. Yong Wu, YanZhao Zheng, TianZe Xu, ZhenTao Zhang, YuanQiang Yu, JiHuai Zhu, Chao Ma, BinBin Lin, BaoHua Dong, HangCheng Zhu, RuoHui Huang, and Gang Yu. ContextBudget: Budget-aware context management for long-horizon search agents, 2026. URL https://arxiv.org/abs/2604.01664.
  96. Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, and Mike Lewis. Efficient streaming language models with attention sinks. In International Conference on Learning Representations (ICLR), 2024. URL https://arxiv.org/abs/2309.17453.
  97. Guangxuan Xiao, Jiaming Tang, Jingwei Zuo, Junxian Guo, Shang Yang, Haotian Tang, Yao Fu, and Song Han. DuoAttention: Efficient long-context LLM inference with retrieval and streaming heads. In International Conference on Learning Representations (ICLR), 2025. URL https://arxiv.org/abs/2410.10819.
  98. Fangyuan Xu, Weijia Shi, and Eunsol Choi. RECOMP: Improving retrieval-augmented LMs with compression and selective augmentation. In International Conference on Learning Representations (ICLR), 2024. URL https://arxiv.org/abs/2310.04408. arXiv:2310.04408.
  99. Wujiang Xu, Zujie Liang, Kai Mei, Hang Gao, Juntao Tan, and Yongfeng Zhang. A-MEM: Agentic memory for LLM agents. In Advances in Neural Information Processing Systems (NeurIPS), 2025. URL https://arxiv.org/abs/2502.12110. arXiv:2502.12110.
  100. Yilong Xu, Zhi Zheng, Xiang Long, Yujun Cai, and Yiwei Wang. Self-manager: Parallel agent loop for long-form deep research, 2026. URL https://arxiv.org/abs/2601.17879.
  101. Jiangze Yan, Yi Shen, Wenjing Zhang, Jieyun Huang, Zhaoxiang Liu, Ning Wang, Kai Wang, and Shiguo Lian. HiMPO: Hindsight-informed memory policy optimization for less-entangled credit in long-horizon agents, 2026. URL https://arxiv.org/abs/2606.16285.
  102. Sikuan Yan, Xiufeng Yang, Zuchao Huang, Ercong Nie, Zifeng Ding, Zonggen Li, Xiaowen Ma, Jinhe Bi, Kristian Kersting, Jeff Z. Pan, Hinrich Schütze, Volker Tresp, and Yunpu Ma. Memory-R1: Enhancing large language model agents to manage and utilize memories via reinforcement learning, 2025. URL https://arxiv.org/abs/2508.19828.
  103. Walden Yan. Don’t build multi-agents. Cognition Blog, June 2025. URL https://cognition.com/blog/dont-build-multi-agents. Published 12 June 2025; accessed June 2026.
  104. Rui Ye, Zhongwang Zhang, Kuan Li, Huifeng Yin, Zhengwei Tao, Yida Zhao, Liangcai Su, Liwen Zhang, Zile Qiao, Xinyu Wang, Pengjun Xie, Fei Huang, Siheng Chen, Jingren Zhou, and Yong Jiang. Agentfold: Long-horizon web agents with proactive context management. arXiv preprint arXiv:2510.24699, 2025. URL https://arxiv.org/abs/2510.24699.
  105. Howard Yen, Tianyu Gao, Minmin Hou, Ke Ding, Daniel Fleischer, Peter Izsak, Moshe Wasserblat, and Danqi Chen. HELMET: How to evaluate long-context language models effectively and thoroughly. In International Conference on Learning Representations (ICLR), 2025. URL https://arxiv.org/abs/2410.02694.
  106. Lu Yi, Runlin Lei, Liuyi Yao, Yuexiang Xie, Yuyang Li, Wenhao Zhang, Zhewei Wei, Yaliang Li, and Jian-Yun Nie. Learning agent-compatible context management for long-horizon tasks, 2026. URL https://arxiv.org/abs/2605.30785.
  107. Hongli Yu, Tinghong Chen, Jiangtao Feng, Jiangjie Chen, Weinan Dai, Qiying Yu, Ya-Qin Zhang, Wei-Ying Ma, Jingjing Liu, Mingxuan Wang, and Hao Zhou. MemAgent: Reshaping long-context LLM with multi-conv RL-based memory agent, 2025. URL https://arxiv.org/abs/2507.02259.
  108. Yi Yu, Liuyi Yao, Yuexiang Xie, Qingquan Tan, Jiaqi Feng, Yaliang Li, and Libing Wu. Agentic memory: Learning unified long-term and short-term memory management for large language model agents, 2026. URL https://arxiv.org/abs/2601.01885.
  109. Qianhao Yuan, Jie Lou, Zichao Li, Jiawei Chen, Yaojie Lu, Hongyu Lin, Le Sun, Debing Zhang, and Xianpei Han. MemSearcher: Training LLMs to reason, search and manage memory via end-to-end reinforcement learning, 2025. URL https://arxiv.org/abs/2511.02805.
  110. Peitian Zhang, Zheng Liu, Shitao Xiao, Ninglu Shao, Qiwei Ye, and Zhicheng Dou. Long context compression with activation beacon, 2024a. URL https://arxiv.org/abs/2401.03462.
  111. Qianchi Zhang, Hainan Zhang, Liang Pang, Hongwei Zheng, and Zhiming Zheng. AdaComp: Extractive context compression with adaptive predictor for retrieval-augmented large language models. arXiv preprint arXiv:2409.01579, 2024b. URL https://arxiv.org/abs/2409.01579.
  112. Qizheng Zhang, Changran Hu, Shubhangi Upasani, Boyuan Ma, Fenglu Hong, Vamsidhar Kamanuru, Jay Rainton, Chen Wu, Mengmeng Ji, Hanchen Li, Urmish Thakker, James Zou, and Kunle Olukotun. Agentic context engineering: Evolving contexts for self-improving language models. arXiv preprint arXiv:2510.04618, 2025a. URL https://arxiv.org/abs/2510.04618.
  113. Xinrong Zhang, Yingfa Chen, Shengding Hu, Zihang Xu, Junhao Chen, Moo Khai Hao, Xu Han, Zhen Leng Thai, Shuo Wang, Zhiyuan Liu, and Maosong Sun. bench: Extending long context evaluation beyond 100K tokens. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (ACL), pages 15262–15277, 2024c. URL https://aclanthology.org/2024.acl-long.814/.
  114. Yihao Zhang, Zeming Wei, Xiaokun Luan, Chengcan Wu, Zhixin Zhang, Jiangrong Wu, Haolin Wu, Huanran Chen, Jun Sun, and Meng Sun. ClawWorm: Self-propagating attacks across LLM agent ecosystems. 2026. URL https://arxiv.org/abs/2603.15727. Cited for the controlled-testbed demonstration of persistent, self-propagating compromise in OpenClaw and its analysis of flat context trust and unconditional configuration loading as architectural root causes.
  115. Yuxiang Zhang, Jiangming Shu, Ye Ma, Xueyuan Lin, Shangxi Wu, and Jitao Sang. Memory as action: Autonomous context curation for long-horizon agentic tasks. arXiv preprint arXiv:2510.12635, 2025b. URL https://arxiv.org/abs/2510.12635.
  116. Zeyu Zhang, Xiaohe Bo, Chen Ma, Rui Li, Xu Chen, Quanyu Dai, Jieming Zhu, Zhenhua Dong, and Ji-Rong Wen. A survey on the memory mechanism of large language model based agents. arXiv preprint arXiv:2404.13501, 2024d. URL https://arxiv.org/abs/2404.13501.
  117. Zhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen, Lianmin Zheng, Ruisi Cai, Zhao Song, Yuandong Tian, Christopher Ré, Clark Barrett, Zhangyang Wang, and Beidi Chen. H2O: Heavy-hitter oracle for efficient generative inference of large language models. In Advances in Neural Information Processing Systems (NeurIPS), 2023. URL https://arxiv.org/abs/2306.14048.
  118. Yiqing Zhou, Yu Lei, Shuzheng Si, Qingyan Sun, Wei Wang, Yifei Wu, Hao Wen, Gang Chen, Fanchao Qi, and Maosong Sun. From context to edus: Faithful and structured context compression via elementary discourse unit decomposition, 2025a. URL https://arxiv.org/abs/2512.14244.
  119. Zijian Zhou, Ao Qu, Zhaoxuan Wu, Sunghwan Kim, Alok Prakash, Daniela Rus, Jinhua Zhao, Bryan Kian Hsiang Low, and Paul Pu Liang. MEM1: Learning to synergize memory and reasoning for efficient long-horizon agents, 2025b. URL https://arxiv.org/abs/2506.15841.
  120. Jialiang Zhu, Gongrui Zhang, Xiaolong Ma, Lin Xu, Miaosen Zhang, Ruiqi Yang, Song Wang, Kai Qiu, Zhirong Wu, Qi Dai, Ruichun Ma, Bei Liu, Yifan Yang, Chong Luo, Zhengyuan Yang, Linjie Li, Lijuan Wang, Weizhu Chen, Xin Geng, and Baining Guo. Re-trac: Recursive trajectory compression for deep search agents, 2026. URL https://arxiv.org/abs/2602.02486.
  121. Zylos Research. AI agent context compression: Strategies for long-running sessions. Commentary / blog, 2026. URL https://zylos.ai/research/2026-02-28-ai-agent-context-compression-strategies/. Commentary cited for the 2026 context-window plateau and the shift to “hybrid compression+caching, and memory-augmented architectures.”; accessed June 2026.
Figure 1. The agentic loop and unbounded context growth. (a) Each turn appends a (frequently large) tool observation o t to the running history H t ; the full context C t = Φ ( H t ) is re-prefilled every turn, so token consumption grows monotonically. A compression operator κ intervenes before re-submission. (b) Illustrative token trajectories: naive concatenation grows linearly and is re-billed each turn, whereas periodic compaction yields a bounded sawtooth that keeps the context below the window/compaction threshold.
Figure 1. The agentic loop and unbounded context growth. (a) Each turn appends a (frequently large) tool observation o t to the running history H t ; the full context C t = Φ ( H t ) is re-prefilled every turn, so token consumption grows monotonically. A compression operator κ intervenes before re-submission. (b) Illustrative token trajectories: naive concatenation grows linearly and is re-billed each turn, whereas periodic compaction yields a bounded sawtooth that keeps the context below the window/compaction threshold.
Preprints 222693 g001
Figure 2. The token economics of agents. (a) Single-agent workflows use ∼4× and multi-agent systems ∼15× the tokens of a chat interaction, as measured by Anthropic on their own workloads Hadfield et al. (2025); persistent “heartbeat” agents spend continuously even when idle. (b) Reported per-lever token/cost reductions—prompt caching Anthropic (2024), code-execution MCP and Tool Search and programmatic tool calling Anthropic (2025b, 2025a), the OpenHands condenser All Hands AI (2025a), and Hermes compaction Nous Research (2026a). Community OpenClaw write-ups additionally claim (unaudited) 80–95% combined reductions; values are as-reported under heterogeneous settings.
Figure 2. The token economics of agents. (a) Single-agent workflows use ∼4× and multi-agent systems ∼15× the tokens of a chat interaction, as measured by Anthropic on their own workloads Hadfield et al. (2025); persistent “heartbeat” agents spend continuously even when idle. (b) Reported per-lever token/cost reductions—prompt caching Anthropic (2024), code-execution MCP and Tool Search and programmatic tool calling Anthropic (2025b, 2025a), the OpenHands condenser All Hands AI (2025a), and Hermes compaction Nous Research (2026a). Community OpenClaw write-ups additionally claim (unaudited) 80–95% combined reductions; values are as-reported under heterogeneous settings.
Preprints 222693 g002
Figure 3. Evolution of agent context compression, 2023–2026, organized by family. Each marker is a method discussed in this survey, placed at its first public (arXiv) month and auto-packed into non-overlapping rows within its family lane; shape and color both encode family—circle (hard), square (soft), triangle (KV), diamond (complementary), hollow ring (learned)—so the figure stays legible in grayscale. Two trends are central to this survey: the 2024–2025 acceleration of methods, and the 2025–2026 surge of learned, agent-native (RL-trained) compression—the dense lower lane (MEM1, SUPO, ReSum, Context-Folding, MemPO, HiMPO, ...)—that moves the compaction decision from an external scaffold into the agent’s own policy.
Figure 3. Evolution of agent context compression, 2023–2026, organized by family. Each marker is a method discussed in this survey, placed at its first public (arXiv) month and auto-packed into non-overlapping rows within its family lane; shape and color both encode family—circle (hard), square (soft), triangle (KV), diamond (complementary), hollow ring (learned)—so the figure stays legible in grayscale. Two trends are central to this survey: the 2024–2025 acceleration of methods, and the 2025–2026 surge of learned, agent-native (RL-trained) compression—the dense lower lane (MEM1, SUPO, ReSum, Context-Folding, MemPO, HiMPO, ...)—that moves the compaction decision from an external scaffold into the agent’s own policy.
Preprints 222693 g003
Figure 4. The agent-context lifecycle and where the method families act. An event flows through six stages—admission, placement, compaction, recovery, reuse, and governance (Table 2)—and the four method families plus learned, agent-native policies nest inside these stages rather than replacing them; shape-and-color markers (circle hard, square soft, triangle KV, diamond complementary, hollow ring learned) mark which families act at each stage. Token-space (hard) methods act at admission and compaction; soft-token at compaction; KV-cache at placement and compaction; offloading, memory, RAG, and sub-agents at placement and recovery; and learned policies treat compaction and placement as actions. Recovery and reuse are first-class stages that prompt-shortening surveys omit.
Figure 4. The agent-context lifecycle and where the method families act. An event flows through six stages—admission, placement, compaction, recovery, reuse, and governance (Table 2)—and the four method families plus learned, agent-native policies nest inside these stages rather than replacing them; shape-and-color markers (circle hard, square soft, triangle KV, diamond complementary, hollow ring learned) mark which families act at each stage. Token-space (hard) methods act at admission and compaction; soft-token at compaction; KV-cache at placement and compaction; offloading, memory, RAG, and sub-agents at placement and recovery; and learned policies treat compaction and placement as actions. Recovery and reuse are first-class stages that prompt-shortening surveys omit.
Preprints 222693 g004
Figure 5. Three points in the inference pipeline where compression intervenes (a compact orientation inset; the four-family map is Figure 6). Hard methods edit the text before tokenization; soft methods replace spans with learned embeddings; KV-cache methods compress the model’s internal key–value memory during inference; and complementary strategies act outside the context window by relocating content and re-fetching it on demand.
Figure 5. Three points in the inference pipeline where compression intervenes (a compact orientation inset; the four-family map is Figure 6). Hard methods edit the text before tokenization; soft methods replace spans with learned embeddings; KV-cache methods compress the model’s internal key–value memory during inference; and complementary strategies act outside the context window by relocating content and re-fetching it on demand.
Preprints 222693 g005
Figure 6. A map of the four method families and their two cross-cutting axes. Each family is defined by where compression acts—editing natural-language text (hard), learning continuous soft vectors (soft/embedding), evicting or quantizing the key–value cache (KV), or relocating context outside the window (complementary)—and is further placed on the lossy↔recoverable and training-free↔model-modifying axes. It complements the lifecycle view of Figure 4, which orders the same methods by when they intervene.
Figure 6. A map of the four method families and their two cross-cutting axes. Each family is defined by where compression acts—editing natural-language text (hard), learning continuous soft vectors (soft/embedding), evicting or quantizing the key–value cache (KV), or relocating context outside the window (complementary)—and is further placed on the lossy↔recoverable and training-free↔model-modifying axes. It complements the lifecycle view of Figure 4, which orders the same methods by when they intervene.
Preprints 222693 g006
Figure 8. Reported reduction factors by family, as small multiples (one panel per family) on a shared modest 0– 30 × linear scale, with shape and color encoding family (circle hard, square soft, triangle KV, diamond complementary, hollow ring learned). The reduction metric differs by family—prompt/token compression (hard, soft), KV-memory (KV), and token-cost or effective-context (offloading, learned)—so comparisons are order-of-magnitude only; each panel is sub-labeled with the specific quantity its reduction factors measure (cf. Table 5 and Table 6). Two values exceed the shared scale—500xCompressor ( 480 × ) and code-execution MCP ( 77 × )—and are capped at 30 × in their panels (true value annotated) and collected in the off-scale outlier box; these extreme soft/offload ratios are typically lossy or recoverable-by-pointer rather than lossless. The Manus filesystem’s widely quoted “100:1” figure is excluded from the plot entirely: it is an average input-to-output token ratio, not a compression ratio, and is reported only as motivation for restorable offloading (cf. Section 4.4).
Figure 8. Reported reduction factors by family, as small multiples (one panel per family) on a shared modest 0– 30 × linear scale, with shape and color encoding family (circle hard, square soft, triangle KV, diamond complementary, hollow ring learned). The reduction metric differs by family—prompt/token compression (hard, soft), KV-memory (KV), and token-cost or effective-context (offloading, learned)—so comparisons are order-of-magnitude only; each panel is sub-labeled with the specific quantity its reduction factors measure (cf. Table 5 and Table 6). Two values exceed the shared scale—500xCompressor ( 480 × ) and code-execution MCP ( 77 × )—and are capped at 30 × in their panels (true value annotated) and collected in the off-scale outlier box; these extreme soft/offload ratios are typically lossy or recoverable-by-pointer rather than lossless. The Manus filesystem’s widely quoted “100:1” figure is excluded from the plot entirely: it is an average input-to-output token ratio, not a compression ratio, and is reported only as motivation for restorable offloading (cf. Section 4.4).
Preprints 222693 g008
Table 2. The agent-context lifecycle. Each stage answers a distinct question about how an event flows through context management; the four method families and learned policies map onto these stages rather than replacing them.
Table 2. The agent-context lifecycle. Each stage answers a distinct question about how an event flows through context management; the four method families and learned policies map onto these stages rather than replacing them.
Stage Question Representative mechanisms
Admission What is allowed into context? tool-output caps, schema filtering, retrieval top-k, observation masking
Placement Where should information live? in-window text, soft tokens, KV cache, filesystem, vector memory, sub-agent context
Compaction How is old context reduced? summarization, token pruning, learned memory writes, KV eviction/quantization
Recovery Can deleted detail be reconstructed? raw transcript replay, file pointers, retrieval stores, KVzip-style reconstruction
Reuse Can the prefix be cached or shared? prompt caching, stable head/tail layout, sub-agent summaries
Governance Can provenance and security be audited? structured summaries, source spans, privilege-aware compression
Table 3. Agent compression design matrix. For each production agent: what triggers a compaction, which span is held byte-stable, what the compaction rewrites to, where discarded content can be recovered from, and how (if at all) the layout is documented to interact with prompt caching. A “Y” names the documented cache-aware layout mechanism; em-dash = no such mechanism documented in the cited sources. No surveyed agent documents provenance or privilege enforcement on compacted content, so that boundary is uniformly empty and omitted here—a gap we treat in Section 3 and Section 9.
Table 3. Agent compression design matrix. For each production agent: what triggers a compaction, which span is held byte-stable, what the compaction rewrites to, where discarded content can be recovered from, and how (if at all) the layout is documented to interact with prompt caching. A “Y” names the documented cache-aware layout mechanism; em-dash = no such mechanism documented in the cited sources. No surveyed agent documents provenance or privilege enforcement on compacted content, so that boundary is uniformly empty and omitted here—a gap we treat in Section 3 and Section 9.
Agent Trigger Protected span Compaction target Recovery source Cache interaction
Hermes Nous Research (2026a) 50% (token) / 85% (char) first 3 msgs + token-budgeted tail (≥20 msgs) structured middle summary Y (system_and_3 breakpoints; update-not-rewrite)
OpenClaw centminmod (2026); plgonzalezrx8 (2026) /compact; 70–80% (skill) /compact summary JSONL backup in memory/compressed/ Y (contextPruning aligned to cache-ttl)
Claude Code Anthropic (2026a) ∼80% (server-side) server-side summary memory tool
OpenHands All Hands AI (2025a) condenser-dependent view-level markers raw event stream (replayable) trade-off noted: condensation lowers cache utilization
Manus Ji (2025) filesystem offload filesystem (re-read on demand)
Cline Baumann (2025) LLM-decided (condense tool) Focus-Chain checklist condense summary
Devin/Cognition Yan (2025) single-thread compression LLM
Table 4. Crosswalk from the learned-frontier clusters of Section 6 back to the family and lifecycle axes of Section 3. All four clusters compress in the hard/natural-language token space—at the trajectory or memory level—and act mainly at the compaction and placement stages; recovery remains largely the province of the complementary family (Section 4.4), with learned retrieval operations (AgeMem’s Retrieve) at the boundary. The frontier is thus a learned-policy traversal of the existing lifecycle, not a fifth method family.
Table 4. Crosswalk from the learned-frontier clusters of Section 6 back to the family and lifecycle axes of Section 3. All four clusters compress in the hard/natural-language token space—at the trajectory or memory level—and act mainly at the compaction and placement stages; recovery remains largely the province of the complementary family (Section 4.4), with learned retrieval operations (AgeMem’s Retrieve) at the boundary. The frontier is thus a learned-policy traversal of the existing lifecycle, not a fifth method family.
Cluster What is learned Representative methods Space / level Lifecycle stages
Compression as action (§6.1) when to fold a sub-trajectory and what summary to reset the window to Context-Folding Sun et al. (2025), AgentFold Ye et al. (2025), SUPO Lu et al. (2025), ReSum Wu et al. (2025) token space; trajectory compaction (fold→summary); placement (window reset)
Memory as action (§6.2) when to write / update / delete an explicit memory state MEM1 Zhou et al. (2025b), Memory-as-Action Zhang et al. (2025b), MemPO Li et al. (2026b), AgeMem Yu et al. (2026) token space; memory compaction (memory rewrite); placement (<mem>-only prompt)
Credit assignment (§6.3) how to attribute reward to a single memory write HiMPO Yan et al. (2026) token space; memory compaction (credit for memory writes)
Budget-conditioned / external managers (§6.4) compression level given a remaining-token budget; or an external manager over a frozen agent ContextBudget Wu et al. (2026), AdaCoM Yi et al. (2026), ContextCurator Li et al. (2026c), RE-TRAC Zhu et al. (2026) token space; trajectory / memory compaction (budget-conditioned); placement (manager edits context)
Table 5. Context compression methods (I): single-call prompt, soft-token, and KV-cache compression. “Token-space” methods are model-agnostic; “embedding”/“KV” methods require model access or self-hosting. The reported-ratio/savings column states the quantity being reduced (prompt tokens, KV memory, throughput, cost, or effective context) alongside the value; figures are as-reported under heterogeneous models, datasets, and baselines and are not comparable across rows. Table 6 continues with the agent-level methods.
Table 5. Context compression methods (I): single-call prompt, soft-token, and KV-cache compression. “Token-space” methods are model-agnostic; “embedding”/“KV” methods require model access or self-hosting. The reported-ratio/savings column states the quantity being reduced (prompt tokens, KV memory, throughput, cost, or effective context) alongside the value; figures are as-reported under heterogeneous models, datasets, and baselines and are not comparable across rows. Table 6 continues with the agent-level methods.
Method (family) Space Reported ratio / savings Trade-offs
LLMLingua Jiang et al. (2023a) Token (pruning) up to 20× prompt tokens; 1.5 pt perf. Perplexity-based; coarse, may drop key tokens
LongLLMLingua Jiang et al. (2024b) Token (pruning) ∼4× fewer tokens, +21.4% perf. (NQ); 94% cost cut (LooGLE); 1.4–2.6× faster Query-aware; needs small LM for scoring
LLMLingua-2 Pan et al. (2024) Token (classif.) 2–5× prompt tokens; up to 2.9× lower latency Task-agnostic, faithful; needs trained encoder
RECOMP Xu et al. (2024) Token (RAG) extractive & abstractive summaries Over-compression hurts multi-hop QA
AttnComp Luo et al. (2025) Token (RAG) 17× avg; +1.9 pt acc.; 49% latency Needs attention access
xRAG Cheng et al. (2024) Embedding (RAG) 1 token/doc; 3.53× fewer FLOPs Retriever–LLM bridge training
Gisting Mu et al. (2023) Embedding up to 26× prompt tokens; 40% FLOPs; 4.2% faster Short prompts only; requires fine-tuning
AutoCompressor Chevalier et al. (2023) Embedding up to 30,720-token contexts Slow training; tuned tokens tied to model
ICAE Ge et al. (2024) Embedding 4× prompt tokens; >2× (up to >7× cached) speedup; ∼20GB mem. saved Needs LoRA encoder; data-leakage concerns
500xCompressor Li et al. (2025c) Embedding (KV) 6–480× prompt tokens; retains 62–73% Large capability loss at extreme ratios
Activation Beacon Zhang et al. (2024a) Embedding/KV 4K→400K ctx; 8× KV mem; ∼2× faster Needs training; sliding-window stream
StreamingLLM Xiao et al. (2024) KV cache (evict) 4M+ tokens; attention sinks Content-agnostic; drops middle tokens
H2O Zhang et al. (2023) KV cache (evict) up to 29× tput; 1.9× latency; 5× mem Eviction permanent; weaker on reasoning
SnapKV Li et al. (2024) KV cache (evict) 3.6× faster gen; 8.2× mem (16K) Per-head selection cost
KIVI Liu et al. (2024b) KV cache (quant) 2-bit; ∼2.6× mem; 2.35–3.47× tput Quantization error at low bits
KVzip Kim et al. (2025) KV cache (recov) 3–4× size; ∼2× latency; query-agnostic Reconstruction-pass overhead
Table 6. Context compression methods (II): trajectory, memory, offloading, and learned agent-native compression in tool-using agents. Reporting conventions as in Table 5: the reported column states the quantity being reduced, and values are as-reported under heterogeneous settings and not comparable across rows.
Table 6. Context compression methods (II): trajectory, memory, offloading, and learned agent-native compression in tool-using agents. Reporting conventions as in Table 5: the reported column states the quantity being reduced, and values are as-reported under heterogeneous settings and not comparable across rows.
Method (family) Space Reported ratio / savings Trade-offs
ACON Kang et al. (2025b) Trajectory (abs.) 26–54% peak-token cut Compression LLM call overhead
Focus Verma (2026) Trajectory (agent) 22.7% (18–57%) tokens, equal acc. ( N = 5 ) Needs aggressive prompting; task-dependent
OpenHands condenser All Hands AI (2025a) Trajectory (abs.) ∼50% cost; latency 16→8 s Lower cache utilization
Hermes ContextCompressor Nous Research (2026a) Trajectory (abs.) 95K→45K tokens ex.; +75% via caching Lossy; summary-model context-size dependency
Manus filesystem Ji (2025); Bhavsar (2025) Offload (recoverable) Restorable offload; ∼100:1 input:output token ratio (motivation), not a compression ratio Retrieval latency; summarization recall risk
MemGPT Packer et al. (2023) Memory hierarchy “unbounded” effective context Paging logic complexity; retrieval precision
Mem0 Chhikara et al. (2025) Memory hierarchy 90%+ token/cost cut; 91% lower p95 (LoCoMo) Extraction/retrieval precision
Context-Folding Sun et al. (2025) Trajectory (learned) ∼10× smaller active ctx; parity acc. Requires RL training (FoldGRPO)
MEM1 Zhou et al. (2025b) Memory (learned) constant-size state; 3.5 × perf at 3.7 × less mem Fixed-size state; requires RL
SUPO Lu et al. (2025) Trajectory (learned) 8 × effective horizon (4K→32K window) Requires RL (GRPO); summary quality
MemPO Li et al. (2026b) Memory (learned) + 25.98 F1; 67–73% fewer tokens Requires RL; per-step <mem> write
ContextCurator Li et al. (2026c) Trajectory (learned) ∼8× ctx (46.7K→6.6K), +acc. External curator; requires RL
Table 7. Reporting metrics for agent compression. Compression ratio alone is insufficient; a faithful evaluation reports task utility and the full-session token, cache, recoverability, faithfulness, and provenance costs of achieving it.
Table 7. Reporting metrics for agent compression. Compression ratio alone is insufficient; a faithful evaluation reports task utility and the full-session token, cache, recoverability, faithfulness, and provenance costs of achieving it.
Metric What it captures Why it is needed
Task success / answer quality Whether the agent still solves the task after compression Compression that degrades the outcome is not a saving
Peak context tokens Largest prefill the agent ever pays for Bounds worst-case cost and context-window pressure
Total session input tokens Cumulative repeated-prefill bill across all turns The quantity actually billed over a long-horizon session
Output tokens & tool-call count Extra generation and tool work induced by compression Summarization and re-retrieval can offset prefill savings
Latency per turn & total wall time End-to-end responsiveness Compaction and recovery add wall-clock cost users feel
Cache write/read ratio & hit rate How compression interacts with prompt caching Compaction invalidates prefixes and can trigger cache-miss spikes
Recovery rate Whether omitted detail is retrievable when later needed Lossy compaction must not cause delayed-relevance failures
Drift / faithfulness Whether iterated summaries stay faithful to the source Compounding summarization errors silently corrupt state
Security / provenance Whether privileged or untrusted boundaries survive compaction Merged provenance enables prompt-injection and privilege leakage
Table 8. Benchmark families for agent compression: each measures a genuine property but is insufficient alone, and each needs an agent-specific addition to become diagnostic of full-session utility.
Table 8. Benchmark families for agent compression: each measures a genuine property but is insufficient alone, and each needs an agent-specific addition to become diagnostic of full-session utility.
Benchmark type What it measures Why insufficient alone Needed agent addition
Needle / retrieval probes Positional recall Weak predictor of tool agents Add delayed dependency after tool use
LongBench-style QA Long-context answer quality Single-shot, not looped Add total-session token accounting
SWE / web agents Task completion Scaffold-dependent Standardize cache and tool-output logging
Memory benchmarks Multi-session recall May ignore cost Add budgeted memory pressure
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2026 MDPI (Basel, Switzerland) unless otherwise stated

Accessibility

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings