AI Agents Could Soon Tidy Up Their Own Memory Mid-Task
A new system from Apple ML Research lets an AI agent decide for itself when to compress its own working memory, stopping it from forgetting important details at the worst possible moment.

Key points
- Apple ML Research published research in 2026 on SELFCOMPACT, a system that lets AI agents choose when to compress their own memory during long tasks.
- Current AI agents use fixed token limits to trigger memory cleanup, which can cut off a line of reasoning at exactly the wrong moment.
- SELFCOMPACT pairs a self-invoked compression tool with the agent's own judgement, replacing the blunt timer with something closer to common sense.
- This is Apple ML Research territory we know well: AI2Day has published 44 stories on the lab's work, 42 of them in the past 90 days.
Here's the problem in plain terms. When you ask an AI agent, software that can carry out multi-step tasks on its own, to do something complicated like book a trip or dig through a long document, it keeps a running log of everything it has thought and done. That log lives inside a context window, the chunk of text the model can hold in its working memory at any one time. Long tasks fill that window fast.
Today's fix is blunt. Most AI scaffolds, the software frameworks that manage how an agent operates, set a fixed token limit. Tokens are the small text chunks AI models read and write, roughly three quarters of a word each. Hit the limit, and the system compresses automatically. The trouble is the timer doesn't know what it's interrupting. It might cut the log right in the middle of a calculation or halfway through a web search, throwing away partial results the agent still needed.
SELFCOMPACT, detailed by Apple ML Research, hands that decision back to the model. The agent gets two things: a compression tool it can call whenever it judges the moment is right, and a signal telling it how full its context window currently is. Instead of an external system firing at a fixed threshold, the agent waits for a natural break in its own reasoning, then summarises what it has done so far and carries on.
Think of it like a surgeon deciding when to step back and brief a colleague, rather than a kitchen timer going off mid-operation regardless.
This doesn't change what you type or what you pay, at least not directly. But it's the kind of plumbing improvement that makes AI tools noticeably more reliable on long or complex jobs. An agent that manages its own memory sensibly is less likely to lose track of what it was doing or quietly drop something important.
What does this have to do with the AI speed race?
Memory efficiency and raw speed are two sides of the same coin. Faster compression means the agent spends less time re-reading stale notes and more time on the actual task.
All 13 of AI2Day's inference-tagged stories have landed since 17 July 2026, and the thread running through them is that the big labs and chipmakers are squeezing every millisecond out of the inference step, the moment a model actually produces an answer. Smarter memory management is part of that squeeze. We also covered how compressed models can now run locally on a Mac and how idle MacBooks might soon handle AI workloads overnight. AI is moving closer to your own hardware, and memory handling is the gating factor.
Should you worry about what it forgets?
SELFCOMPACT is research, not a shipping product. There's no app to download today. The real question is whether the agent's own compression judgement can be trusted at scale, and whether handing a model control over its own memory opens new ways for it to quietly lose important context. That's what the next round of tests needs to answer.



