MCP
arXivarXiv
Preprint
Published: August 4, 2026
cs.AI

LeanMem: Simple and Efficient Long-Term Memory for LLM Agents

Abstract
Long-term memory is essential for LLM-based agents to sustain interactions and reliably leverage distant history. However, existing memory systems typically process heterogeneous dialogue content through a uniform summarization and retrieval pipeline, leading to either excessive token consumption or irreversible loss of fine-grained evidence. We argue that historical dialogue content should be handled differently according to its compressibility, temporal dynamics, and fidelity requirements. Based on this insight, we propose LeanMem, a lightweight long-term memory framework. LeanMem first filters out low-value content, then stores informative segments as compact profile memory, temporally structured event memory, or source-grounded record memory, depending on the nature of the information. During maintenance, only dynamically evolving event memories are selectively updated, avoiding redundant consolidation of stable profiles and immutable records. During inference, LeanMem dynamically selects memory types and allocates retrieval budgets according to query-specific evidence demands, assembling relevant evidence on demand. On LoCoMo and LongMemEval-S with GPT-4.1-mini and Qwen3-8B, LeanMem improves accuracy over the strongest memory-based baseline in every setting, by up to 15.1 points, at the lowest or near-lowest construction cost, inference tokens, and latency. The code and datasets are included in the supplementary materials.
4
AI overview
Reviews
Citation graph
References · 22
Structured
This preview uses generator v1; v2 is available

Overview

LeanMem is a lightweight long-term memory framework for LLM Agents that stores and maintains heterogeneous conversational content differentially according to compressibility, temporal dynamics, and fidelity requirements, achieving accuracy gains while reducing token consumption on public long-term conversational QA benchmarks.

Existing Problems of the Unified Processing Paradigm for LLM Agent Long-Term Memory

The long-term memory module of an LLM Agent must manage massive, heterogeneous historical conversation content. Existing mainstream memory systems commonly process all conversation content through a unified summarization and retrieval pipeline. This indiscriminate processing mechanism causes two negative outcomes that are hard to reconcile: either retaining enough detail leads to excessive token consumption, or compressing volume causes irreversible loss of fine-grained evidence.

To address this common design gap, related research proposes that different historical conversation content inherently has different compressibility, temporal dynamics characteristics, and fidelity requirements, and should not be pushed through the same pipeline for indiscriminate processing. This judgment forms the core design premise of the differentiated long-term memory processing framework.

LeanMem's Core Design Ideas and Overall Architecture

The framework's overall architecture consists of four functional modules connected in series, covering the full life cycle of memory from input to query response: the first module performs topic segmentation, filtering key statements and grouping them into topically coherent segments; the second module is controlled memory write routing, which dispatches segments to one of three storage partitions—profile memory, event memory, or record memory—based on their compression needs, temporal attributes, and fidelity requirements; the third module implements selective memory evolution, buffering and incrementally updating event memory via localized offline merge operations; the fourth module performs adaptive evidence synthesis, planning retrieval paths and assembling sufficient supporting evidence under query-triggered resource budget constraints. You can use the architecture diagram to intuitively understand the division of labor among the four modules and the complete processing chain.

Fig. 1: The overall architecture of LeanMem, comprising four core modules: topic segmentation detection, controlled memory writing, selective memory evolution, and adaptive evidence synthesis.

The Working Mechanism of LeanMem's Staged Memory Processing

LeanMem uses a three-stage pipeline for full-process memory handling; the first stage is controlled memory writing. After a conversation segment is input, the framework first determines whether the segment needs to enter the memory system; segments with low informational value are directly ignored, avoiding unnecessary construction overhead. For segments judged useful, a lightweight scheduler first completes information type classification, assigning suitable storage strategies to different content categories: stable user attributes and preferences are compressed and stored as profile memory, state-changing information is stored as event memory with temporal anchors and state descriptions, and detail-dense content is stored as record memory with a lightweight index and pointers to the original conversation, ensuring later traceability of fine-grained evidence.

The second stage is selective memory evolution, where the framework designs differentiated maintenance strategies for different memory representations. Profile memory stores stable user attributes, and record memory retains immutable source-based indexes; neither performs unnecessary merge or update operations. Only event memory—which represents continuous interaction processes and can be progressively refined through subsequent interactions—is allowed to undergo evolution, eliminating redundant overhead from repeatedly maintaining the full memory at its root.

Benchmark Evaluation and Component Ablation Validation Results

The paper designs controlled ablation experiments targeting LeanMem's core component contributions, setting up five functional-deficiency variants, each removing one of five core modules: key statement filtering, topic segmentation, heterogeneous memory storage scheduling, event memory evolution, and demand-aware retrieval planning; all other experimental conditions remain identical to the full LeanMem version.

The query requirement tuple that supports demand-aware retrieval planning contains entities, attributes, temporal ordering, relational constraints, evidence requirement descriptions, the set of memory types needed, and the relative dependency weights of each memory type.

The ablation results for each component show that the absence of any core module brings varying degrees of performance loss and increased runtime overhead: removing key statement filtering introduces many non-informative dialogue turns, causing accuracy drops and higher token usage and latency; removing topic segmentation causes session-level inputs to mix different discussion content, generating coarser memory construction units, raising costs and severely degrading performance on the LongMemEval-S dataset; replacing heterogeneous memory storage scheduling with a unified summarization strategy causes the largest accuracy drop on both public benchmarks, LongMemEval-S and LoCoMo, while increasing token usage, validating that the differentiated minimal-sufficient memory representation is the framework's core design for balancing evidence retention and runtime efficiency; removing the event memory evolution module also causes明显明显 significant performance degradation on LongMemEval-S.

Fig. 2: Heatmap comparison of GPT-4.1-mini's accuracy across different question categories on the LongMemEval-S dataset.

LeanMem's Core Design Conclusions

LeanMem's differentiated storage design avoids both typical defects of traditional long-term memory pipelines: it neither performs redundant processing on easily compressible information nor causes irreversible loss of fidelity-sensitive evidence information. Experimental validation on the two public benchmarks LoCoMo and LongMemEval-S shows that the framework can achieve more stable answer quality while reducing the combined overhead of the full chain from memory construction to inference.

Rating
No ratings yet
Rate
Community rating
—
/ 5
No ratings yet
Rating
—
Soundness
—
Presentation
—
Contribution
—
Confidence
—
Discussion
Top
Newest
Questions
Replication
Author
No comments yet — be the first