Self-Compacting Language Model Agents
Apple's self-compacting agents solve a real inference problem: how to keep long reasoning traces from drowning in stale context.

Why it matters
Long agent chains accumulate junk that bloats context windows and degrades subsequent reasoning. Apple's approach lets the model itself decide when and what to summarize—addressing a production constraint that fixed-interval compaction misses.
The key facts
6 to knowPublished by Apple Machine Learning Research
Addresses context-window overflow in multi-step agent reasoning
SELFCOMPACT scaffold pairs compaction tool + model-driven pruning decision
Contrasts with fixed-interval compaction that risks discarding partial derivations
Inference-time mechanism (no model retraining required)
Problem domain: long agent traces with chains of thought and tool calls
Go to the source
Apple Machine Learningmachinelearning.apple.com
Publisher excerpt: Long agent traces composed of chains of thought and tool calls accumulate stale content that anchor subsequent generations, and eventually outgrow the context window. Existing scaffolds mitigate it with fixed-interval compaction triggered at a token threshold. Such triggers pay no heed to…