A new technique called StateComp decides, mid-task, which pieces of an AI agent's memory can be safely deleted.
Long-running AI agents (the kind that work through multi-step tasks like coding or research) pile up interaction history as they go. Most tools today trim that history on a fixed schedule or after a set amount of time, without checking whether the agent still needs it. StateComp instead labels each past interaction as KEEP or READY based on the agent's current state, using a lightweight router trained on hidden representations pulled from a frozen language model. Interactions marked READY get grouped into spans and swapped for compact summaries while the agent keeps working. On a benchmark called WorkBuddyBench, the approach cut total agent and summarization tokens by 52.27 percent and sped up the representation-extraction step by 12.67 times, without dropping task performance.
That distinction, between compressing on a timer and compressing only when it's actually safe, is the real contribution here. Every extra token an agent carries costs money and slows every following step, so as agents get asked to handle longer and messier jobs, this kind of state-aware pruning matters more than shaving down individual prompts.
Still, this is one arXiv paper tested on one benchmark the authors built themselves. Whether the KEEP or READY router holds up on messier, real-world agent workloads is an open question, not a settled one.