MemForest: An Efficient Agent Memory System with Hierarchical Temporal Indexing

Han Chen, Zining Zhang, Wenqi Pei, Bingsheng He, Ming Wu, Jason Zeng, Michael Heinrich, Wei Wu, Hongbao ZhangarXiv 2026

TL;DR

MemForest is a novel memory framework that reformulates LLM agent memory as a write-efficient temporal data management problem. By introducing parallel chunk extraction and a hierarchical temporal index called MemTree, it removes the sequential bottlenecks and global rewrite costs plaguing current memory systems. This architectural shift allows MemForest to achieve up to a 9.5× speedup in memory build rates while matching or exceeding state-of-the-art accuracy.

What Problem Does This Paper Address?

For LLM agents to act as effective long-term assistants, they need persistent memory that spans days, weeks, or months. Existing agent memory systems typically follow a three-stage workflow: extraction (turning raw dialogue into memory records), maintenance (consolidating and organizing knowledge), and retrieval (fetching relevant context for queries).

However, current architectures suffer from a severe write critical path bottleneck. As illustrated below, extraction is often sequentially chained, and maintenance routines frequently rewrite global summaries or user profiles from scratch whenever new information arrives.

Figure 2: A generic workflow of agent memory systems. New dialogue history first goes through extraction, then mainte- nance updates the existing memory state, and future user queries trigger retrieval over the maintained memory. In many existing systems, the dominant LLM hotspot lies on the write path of extraction and maintenance.

As an agent's history grows, the cost of updating its memory scales with the total accumulated memory size rather than the size of the newly arrived evidence. Furthermore, memory is inherently temporal—user states evolve, and facts change. Existing systems struggle to efficiently handle historical or transition queries (e.g., "Where did the user live before moving to New York?") without sacrificing write performance.

Methods

MemForest addresses these challenges by treating memory management like a write-optimized database index (drawing inspiration from structures like Log-Structured Merge-trees). Its architecture relies on three core components:

  1. Shared Memory Substrate: The system cleanly decouples persistent state (stable write units called canonical facts) from derived artifacts (auxiliary structures like interval summaries and embeddings). When updates occur, only the affected persistent regions are modified, and dependent summaries are refreshed lazily.
  2. Parallel Chunk Extraction & Routing: Instead of processing long dialogue streams sequentially, MemForest partitions sessions into fixed-size chunks and extracts facts concurrently. An entity and scene router then maps these facts into distinct, localized scopes.
  3. MemTree (Hierarchical Temporal Index): Each scope is materialized as a balanced, time-ordered tree. As shown in the diagram below, leaf nodes preserve fine-grained chronological evidence, internal nodes summarize contiguous time intervals, and the root provides a coarse tree-level summary.
Figure 4: MemTree. Leaves preserve time-ordered evidence, internal nodes summarize contiguous intervals, and the root supports coarse tree-level recall. The same structure supports both query-time browse and localized refresh after writes.

During maintenance, MemForest performs an eager structural maintenance step (updating tree paths in $O(\log N)$ time) followed by a lazy semantic refresh, where dirty nodes are batched and summarized bottom-up.

At query time, retrieval is split into forest recall (finding candidate trees via root and fact embeddings) and tree browse (descending from coarse intervals to precise leaf evidence). Tree browsing can operate in a fast, embedding-only mode or a high-accuracy, LLM-guided mode paired with a query planner.

Datasets

The authors evaluated MemForest across three generative backbones (Qwen3-4B, Qwen3-30B, and Gemma-4-12B-IT) using two prominent long-context memory benchmarks:

  • LongMemEval-S: A benchmark containing 500 question-specific instances across six categories (including single-session, multi-session, temporal, and knowledge updates).
  • LoCoMo: A dataset consisting of 1,986 questions evaluating single-hop, multi-hop, open-ended, and temporal reasoning. The main evaluation focused on categories 1–4 (1,540 questions).

Key Insights and Ideas

  • Locality is Efficiency: By structuring memory into scoped trees rather than a flat global log, the cost of memory maintenance scales with the depth of the affected tree paths ($O(\log N)$) and the number of distinct dirty nodes, rather than the total size of the database.
  • Preserving History via Structure: Instead of overwriting old profiles with new information, state evolution is naturally preserved because older states remain accessible as earlier leaves and intervals in the tree. This inherently supports complex temporal and transition queries.
  • Separation of Concerns: Separating the source-of-truth persistent facts from derived summaries means the system can support advanced lifecycle operations—like merging external memories or deleting retracted data—by simply updating pointers and selectively refreshing local paths, completely avoiding global state reconstruction.

Key Results

MemForest demonstrates a significantly better speed-versus-accuracy operating point than existing baselines like EverMemOS, Mem0, and MemoryOS.

Figure 1: Qwen3-30B accuracy and memory-build rate on LongMemEval-S and LoCoMo categories 1–4.
  • Throughput/Build Rate: MemForest achieved an input-normalized build rate 6.0× faster than EverMemOS on LongMemEval-S and 9.5× faster on LoCoMo workloads.
  • Accuracy: Using Qwen3-30B, MemForest-Planner achieved the highest overall accuracy on LongMemEval-S (81.8% pass@1). On LoCoMo, it achieved 84.09%, effectively tying with EverMemOS (84.22%) while operating at a fraction of the write cost.
  • Query Latency: The embedding-only mode (MemForest-Embed) dropped total query latency to just 2.19 seconds (compared to EverMemOS's 8.49 seconds), providing a highly viable option for latency-sensitive applications.
Figure 5: Retrieval and answer latency. MF-P and MF-E denote MemForest-Planner and MemForest-Embed.

Limitations and Future Work

While MemForest drastically reduces wall-clock write latency through parallelization, it does not optimize aggregate token consumption. Processing smaller, parallelized chunks repeats prompt schemas and structured-output overhead, meaning token costs remain comparable to sequential baselines.

Additionally, while the system retains provenance links to help correct extraction errors, automatic factuality verification (detecting if an extracted fact is true or hallucinated) is not currently handled and remains a target for future work.

Summary updated

BibTeX
@misc{chen2026memforest,
  author = {Han Chen and Zining Zhang and Wenqi Pei and Bingsheng He and Ming Wu and Jason Zeng and Michael Heinrich and Wei Wu and Hongbao Zhang},
  title = {{MemForest: An Efficient Agent Memory System with Hierarchical Temporal Indexing}},
  year = {2026},
  eprint = {2605.23986},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.23986},
}
Figure