The token crisis: 118K vs 3.26M
Long-horizon reasoning tasks have exposed a critical flaw in current AI agent architectures: context windows fill up rapidly, and retrieval pipelines often return noise instead of actionable signals. According to researchers at the National University of Singapore (NUS), a typical agentic framework, such as LangMem, consumes approximately 3.26 million tokens per query when handling complex, multi-step tasks. In stark contrast, their newly developed framework, MRAgent, reportedly uses just 118,000 tokens per query — a reduction of roughly 96%.
This dramatic difference stems from MRAgent's fundamental redesign of how agents store and recall information. Instead of relying on static retrieval mechanisms that dump irrelevant data into the context window, MRAgent employs a dynamic memory reconstruction process. The framework allows the agent to iteratively build and refine its memory based on accumulating evidence, rather than pulling from a fixed database. This approach reportedly reduces token waste significantly while maintaining or even improving task accuracy.
The researchers tested MRAgent across multiple benchmarks, including multi-hop question answering and long-document analysis. Preliminary results indicate that the framework not only cuts token usage but also achieves higher recall precision compared to traditional retrieve-then-reason pipelines. The NUS team plans to release the framework as open-source, pending further validation.
How dynamic memory reconstruction works
Traditional agentic systems, including popular frameworks like LangMem and MemGPT, rely on a static retrieve-then-reason pipeline. When an agent encounters a query, it first retrieves relevant chunks from a vector database, then feeds them into the context window for reasoning. However, this approach often retrieves irrelevant or redundant information, bloating the context window and degrading performance. According to the NUS researchers, this static method fails to adapt to the evolving needs of long-horizon tasks.
MRAgent, in contrast, integrates memory reconstruction directly into the reasoning process. The agent starts with a minimal initial context and incrementally expands its memory as it processes evidence. At each step, the framework evaluates the relevance of new information against the current reasoning state, discarding noise and retaining only high-signal data. This iterative refinement reportedly reduces the total token count while preserving the essential context needed for accurate decisions.
The mechanism uses a lightweight scoring function to prioritize memory items based on their contribution to the current reasoning path. The researchers claim this approach mimics human memory consolidation, where relevant experiences are reinforced and irrelevant ones are pruned. Early tests show MRAgent maintains 92% accuracy on complex reasoning tasks, compared to 88% for LangMem, despite using a fraction of the tokens.
Why context window efficiency matters
Token consumption directly impacts the operational cost and latency of AI agents, especially in production environments. With major LLM providers charging per token, a framework that uses 3.26 million tokens per query would cost approximately $65 per query at current GPT-4 rates (roughly $0.02 per 1,000 tokens). In contrast, MRAgent's 118,000 tokens per query would cost around $2.36 — a savings of over 96% per query. For enterprises running thousands of queries daily, this translates to millions of dollars in annual savings.
Latency is another critical factor. Processing 3.26 million tokens requires multiple round trips to the LLM, often taking 30 seconds or more per query. MRAgent's reduced token count reportedly cuts inference time to under 5 seconds for most tasks, enabling real-time or near-real-time agent interactions. This makes the framework suitable for applications like customer support, code generation, and autonomous research assistants, where speed is paramount.
Scalability also improves. With smaller context windows, agents can handle longer conversations and more complex workflows without hitting hard limits. The NUS team notes that MRAgent can sustain up to 10,000 conversation turns without significant performance degradation, compared to around 500 turns for static retrieval systems. This opens the door for truly long-running autonomous agents.
Competitive landscape and industry impact
The race to build efficient agent memory systems has intensified in 2026, with major players like LangChain (maker of LangMem), Microsoft (via MemGPT), and OpenAI (with its own agentic tools) all vying for dominance. LangMem, released in late 2025, gained traction for its ability to handle long conversations but quickly drew criticism for its token-hungry approach. According to industry analysts, token waste has become the single biggest barrier to deploying AI agents at scale.
MRAgent enters this landscape as a potential disruptor. By focusing on dynamic memory reconstruction rather than static retrieval, the NUS framework addresses the core inefficiency that plagues existing systems. Early benchmarks show MRAgent outperforming LangMem on both token efficiency and accuracy, though independent validation is still pending. The researchers have also hinted at compatibility with multiple LLM backends, including GPT-4, Claude 3, and open-source models like Llama 4.
If MRAgent proves robust in production, it could shift the industry away from retrieval-augmented generation (RAG) toward more integrated memory architectures. However, adoption may face hurdles, including the need for retraining existing agents and the computational overhead of the dynamic scoring mechanism. The NUS team plans to release detailed benchmarks and code in Q2 2026.
Implications for developers and enterprises
For developers building AI agents, MRAgent offers a path to dramatically reduce operational costs while maintaining or improving performance. The framework's open-source nature (pending release) means teams can customize the scoring function and memory reconstruction logic to fit their specific use cases. Early adopters in the NUS pilot program reportedly integrated MRAgent into customer support bots and code review assistants, achieving 40% faster response times and 30% lower API costs.
Enterprises should also consider the security implications. With smaller context windows, the risk of leaking sensitive information through token overflow is reduced. Additionally, the dynamic memory reconstruction process inherently filters out irrelevant data, potentially improving compliance with data privacy regulations like GDPR and CCPA. The researchers emphasize that MRAgent does not store raw conversation data; it only retains processed memory items.
However, the framework is not without limitations. The dynamic scoring mechanism adds computational overhead, which could offset token savings for very short queries. The NUS team recommends MRAgent for tasks requiring more than 10 reasoning steps, where the efficiency gains become pronounced. They also caution that the framework's accuracy depends on the quality of the underlying LLM, and further testing is needed for edge cases.