Agentic AI
Researchers propose memory compression system to help AI agents maintain context across long reasoning tasks
A new approach called Contextual Memory Virtualisation uses directed acyclic graphs to manage and trim session history, cutting token usage by up to 86% while preserving key interactions.
When large language models work through extended problem-solving sessions, they accumulate extensive context—architectural designs, technical decisions, code conventions—that gets lost once the context window fills up. Researchers have proposed Contextual Memory Virtualisation (CMV), a new framework that treats this accumulated understanding as version-controlled state rather than disposable history.
How it works#
CMV borrows concepts from operating system memory management to organize session history as a Directed Acyclic Graph (DAG). This structure enables the system to define formal operations for taking snapshots, branching into parallel sessions, and trimming unnecessary content. The key innovation is a three-pass trimming algorithm that identifies and removes non-essential material—such as raw tool outputs, encoded images, and metadata—while preserving every user message and assistant response word-for-word.
The trimming process achieved a median token reduction of 20% across test cases, with some sessions seeing cuts as high as 86%. Mixed tool-use sessions showed particularly strong results, averaging 39% reduction in tokens and reaching economic viability within 10 conversational turns even when using prompt caching.
Real-world evaluation#
A case study tracking 76 actual coding sessions demonstrated that the trimming approach remains cost-effective in practice, particularly for workflows that combine multiple tools. The researchers found that the system's gains hold up robustly alongside modern caching strategies, suggesting it could be practically adopted today.
A reference implementation is available for review.

