MemForest: Efficient Agent Memory Management via EventTree Partitioning and Progressive Merging

AuthorsJunxi Wang, Te Sun, Jiayi Zhu et al.

arXiv 20262026

TL;DR

MemForest uses EventTree Semantic-Temporal Partitioning plus EventTree Progressive Merging to compress 50% of agent memory while retaining 97.1% performance and achieving up to 2.24× retrieval speedup.

SharePost on XLinkedIn

Read our summary here, or open the publisher PDF on the next tab.

THE PROBLEM

Agent memories bloat and slow retrieval as historical nodes grow

Agent memory systems accumulate historical memory over long interactions, and Mem0 shows that compressing 50% still needs to preserve 97.1% performance while achieving 1.89× speedup.

As memory nodes grow, embedding time, retrieval time, and response time all increase, making frameworks like Mem0 and M3-Agent struggle with storage pressure and slower retrieval.

HOW IT WORKS

MemForest — EventTree Semantic-Temporal Partitioning and Progressive Merging

MemForest centers on EventTree Semantic-Temporal Partitioning, EventTree Progressive Merging, and Anchor-Guided Propagation Retrieval, which together restructure and compress historical memory into event-centric trees.

You can think of MemForest as turning a messy log of memories into a forest of event trees, like a card catalog that groups related cards by both topic and time.

By merging highly similar nodes inside each EventTree and then using anchor-guided temporal propagation, MemForest preserves event structure and retrieval accuracy far beyond what a plain context window or naive pruning can keep.

DIAGRAM

Anchor-Guided Propagation Retrieval Pipeline

This diagram shows how MemForest performs Anchor-Guided Propagation Retrieval from a compressed memory set for a single query.

DIAGRAM

MemForest Evaluation Setup Across Mem0 and M3-Agent

This diagram shows how MemForest is evaluated on Mem0 and M3-Agent with different compression ratios and baselines.

PROCESS

How MemForest Handles a Query Session

  1. 01

    EventTree Semantic-Temporal Partitioning

    MemForest first applies EventTree Semantic-Temporal Partitioning using KMeans clustering with global similarity gj_ci and local continuity lj_ci to form event units Ck.

  2. 02

    EventTree Progressive Merging

    MemForest builds a maximum spanning tree Tk per event unit and progressively merges node pairs using updated weights w'_ij until the target compression ratio is reached.

  3. 03

    Anchor-Guided Propagation Retrieval

    MemForest retrieves a candidate set Mh, selects anchor nodes Ma, computes propagation scores pj, and fuses them with similarity scores sj into vj.

  4. 04

    Query Answering with Compressed Memory

    MemForest feeds the top k memories selected by fusion scores vj into the agent backbone, enabling Mem0 or M3-Agent to answer while using only 50% of the original memory.

KEY CONTRIBUTIONS

Key Contributions

  • 01

    General Compression Framework

    MemForest introduces a general agent memory compression framework that combines EventTree Semantic-Temporal Partitioning and EventTree Progressive Merging to compress 50% of historical memory while retaining 97.1% and 99.7% performance on Mem0 and M3-Agent.

  • 02

    Novel Retrieval Mechanism

    MemForest adds Anchor-Guided Propagation Retrieval, which fuses query similarity and temporal propagation scores to recover relevant neighbors and yields up to 21.0% performance gains after 50% compression in M3-Agent.

  • 03

    Excellent Empirical Performance

    MemForest achieves 1.89× retrieval speedup on Mem0 and 2.24× on M3-Agent at 50% compression, outperforming Random Pruning, KMeans, DART, StreamMeCo, Random Merging, and ToMe in performance retention.

RESULTS

By the Numbers

Avg. All Mem0

59.3 score

+6.3 over Random Pruning at 50% on Mem0

Avg. All M3Agent

39.0 score

+4.3 over Random Pruning at 50% on M3-Agent

Retention Mem0

97.1%

MemForest vs Mem0 baseline at 50% compression

Retention M3Agent

99.7%

MemForest vs M3-Agent baseline at 50% compression

On LoCoMo, LongMemEval, PersonaMem, M3-Bench-robot, and M3-Bench-web, MemForest compresses 50% of historical memory while keeping 59.3 vs 61.1 average score on Mem0 and 39.0 vs 39.1 on M3-Agent, proving MemForest preserves nearly all accuracy with large retrieval speedups.

BENCHMARK

By the Numbers

On LoCoMo, LongMemEval, PersonaMem, M3-Bench-robot, and M3-Bench-web, MemForest compresses 50% of historical memory while keeping 59.3 vs 61.1 average score on Mem0 and 39.0 vs 39.1 on M3-Agent, proving MemForest preserves nearly all accuracy with large retrieval speedups.

BENCHMARK

Performance comparison of different baselines on Mem0 under 50% compression

Avg. All score on Mem0 with 50% historical memory compression.

BENCHMARK

Performance comparison of different baselines on M3-Agent under 50% compression

Avg. All score on M3-Agent with 50% historical memory compression.

KEY INSIGHT

The Counterintuitive Finding

MemForest retains 99.7% of M3-Agent performance at 50% compression, with Avg. All score 39.0 vs 39.1 while achieving a 2.24× retrieval speedup.

This is surprising because aggressive memory compression is usually expected to hurt multimodal agents more, yet MemForest shows multimodal memory has enough redundancy to compress by half with almost no accuracy loss.

WHY IT MATTERS

What this unlocks for the field

MemForest unlocks event-level memory compression that respects both global semantic similarity and local temporal continuity, enabling long-running agents to keep memory growth under control.

Builders can now deploy Mem0 and M3-Agent style systems that maintain near-original accuracy while halving memory size and nearly doubling retrieval speed, making persistent agents practical at scale.

~12 min read← Back to papers

Related papers

BenchmarkAgent Memory

Active Context Compression: Autonomous Memory Management in LLM Agents

Nikhil Verma

· 2026

Focus Agent adds start_focus, complete_focus, a persistent Knowledge block, and an optimized Persistent Bash plus String-Replace Editor scaffold to actively compress context during long software-engineering tasks. On five hard SWE-bench Lite instances against a Baseline ReAct agent, Focus Agent achieves 22.7% token reduction (14.9M → 11.5M) while matching 3/5 = 60% task success.

Agent Memory

ActMem: Bridging the Gap Between Memory Retrieval and Reasoning in LLM Agents

Xiaohui Zhang, Zequn Sun et al.

· 2026

ActMem transforms dialogue history into atomic facts via Memory Fact Extraction, groups them with Fact Clustering, links them through a Memory KG Construction module, and uses Counterfactual-based Retrieval and Reasoning for action-aware answers. On ActMemEval, ActMem reaches 76.52% QA accuracy with DeepSeek-V3, beating LightMem’s 63.97% by 12.55 points and NaiveRAG’s 61.54%.

Questions about this paper?

Paper: MemForest: Efficient Agent Memory Management via EventTree Partitioning and Progressive Merging

Answers use this explainer on Memory Papers.

Checking…