MemFolder framework optimizes long-term AI agent memory
Researchers have introduced MemFolder, a framework that reduces both the number of memory records and their length to improve AI agent efficiency.
Source: Grafy Research LabLong-term AI agents face a growing efficiency crisis as they accumulate massive external memory stores through continuous interactions. According to a paper by Xuyang Liu and colleagues, this accumulation creates a dual bottleneck: increasing the number of records raises retrieval overhead, while longer retrieved contexts drive up prefill and decoding costs.
How does MemFolder address memory bottlenecks?
Existing memory management techniques often focus on only one side of the efficiency equation. Some methods prune unnecessary data, which risks discarding useful evidence, while others consolidate records, which can result in fewer but significantly longer text units. Figure 1 illustrates this trade-off, showing how different approaches shift the balance between record count and tokens per unit .
To solve both problems simultaneously, the researchers proposed MemFolder, a structure-guided framework designed to sequentially reduce both the count of retrieval units and their individual context lengths. The framework operates through two primary components: RecordFolder and ContextFolder.
What are the core components of the framework?
RecordFolder focuses on the record level by grounding entity mentions and selecting representative, complementary anchors. It uses semantic and entity affinity, combined with temporal chaining, to consolidate multiple records into a smaller number of retrieval units.
Once these groups are established, ContextFolder handles the context level. It encodes the original records within each group into a compact text format based on a target token ratio. To ensure that the compression process does not lose critical information, ContextFolder employs a verification feedback loop. This allows the system to revise encodings if key facts cannot be successfully recovered from the compressed version.
What does the experimental data show?
Testing was conducted across three text-based benchmarks—LoCoMo, PersonaMem, and LongMemEval—as well as two multimodal benchmarks, M3-Bench-web and M3-Bench-robot. The results indicate that MemFolder maintains high performance even under significant compression.
According to the authors, when using RecordFolder alone, the system retained 99.0% of the average performance on Mem0 across the three text benchmarks while using 50% fewer records. This outperformed the strongest baseline by 1.9 percentage points in terms of performance retention. Figure 3 highlights the accuracy-token trade-offs, demonstrating that when ContextFolder is combined with RecordFolder, it further reduces tokens per record by 31% to 40% across various benchmarks with minimal accuracy loss.
Can MemFolder be used with existing methods?
One of the notable strengths of the framework is its modularity. Because ContextFolder is independent of the specific grouping algorithm used, it can function as a plug-and-play component for other record-compression methods. The researchers found that applying ContextFolder to existing methods yielded better accuracy-efficiency trade-offs than established compressors like BabelTele or LLMLingua-2.
For researchers and developers working with large-scale datasets or long-context models, this framework offers a way to maintain the intelligence of an agent while significantly lowering the computational footprint required for long-term memory retrieval.
Applying these concepts in Grafy
While MemFolder is a research framework for agentic memory, the principles of efficient information retrieval and context management are central to modern AI workflows. If you are conducting deep research into papers regarding memory architectures or agentic frameworks, you can use Reader to analyze these complex documents. Reader allows you to ask specific questions over dense PDFs, effectively acting as a high-level interface for the very types of information density MemFolder aims to manage.


