Memory Type Varies: Empowering LLM Agents for Long-Term Memory with Diverse Strategies

Yi Wen, Derong Xu, Pengyue Jia, Yichao Wang, Yingyi Zhang, Maolin Wang, Junyi Li, Wenlin Zhang, Xiaopeng Li, Yong Liu, Xiangyu ZhaoNeurIPS 2026

TL;DR

Human brains don't store "what I ate for breakfast last Tuesday" the same way they store "water boils at 100°C"—yet current LLM memory systems force every single conversation snippet through the exact same retrieval pipeline. This paper introduces MemoType, a framework inspired by cognitive psychology that categorizes dialogue memories into three distinct types and routes each to a custom-built retrieval strategy. The authors prove mathematically that a "one-size-fits-all" retriever hits a hard ceiling in diverse datasets, and show empirically that tailoring retrieval to memory types boosts accuracy by up to 16%.

What Problem Does This Paper Address?

Even with massive context windows, LLMs eventually suffer from "forgetting" during long-term, multi-session interactions. The standard fix is Retrieval-Augmented Generation (RAG): dump past conversations into an external vector database and fetch relevant chunks when the user asks a question.

The catch? Current RAG-based memory systems treat all memories equally, using a single, unified retrieval strategy. This creates friction because dialogue memories are fundamentally diverse:

  • Information Coupling: Event-based memories (who, what, when, where) get squished into a single embedding vector, diluting specific details like timestamps or locations.
  • Semantic Gaps: If a user asks a short question like "What is my major?", its embedding looks very different from the rich, chatty paragraph where they actually talked about studying math at NYU.
  • Noise: Conversely, if you use complex graph structures to link entities for simple factual queries, you just introduce computational overhead and noise.
Semantic clustering of memory types showing a clear gap between personal and general memories.

Drawing on Endel Tulving’s classic cognitive psychology distinction between episodic and semantic memory—and noticing a stark visual split in embedding space between personal facts and general trivia—the authors ask: Can we automatically classify memories and give each type its own specialized retrieval strategy?

Methods

To make type-aware retrieval work, the authors built MemoType, a four-stage pipeline:

Figure 2: Three Memory Types in TriMEM (Left) and the proposed MemoType Framework (Right).
  1. The Memory Taxonomy: Memories are split into three buckets: Episodic Memory (specific events tied to time/place), Personal Semantic Memory (facts about the user), and General Semantic Memory (standardized world knowledge).
  2. Type Routing (with a clever twist): A lightweight, LoRA-fine-tuned Qwen3-1.7B model acts as the router, tagging incoming memories with multi-label classifications. However, routing incoming queries is tricky because queries are short and vague. To bridge this asymmetry, MemoType uses an LLM to hallucinate $K=5$ "hypothetical memories" that would answer the query, and runs those through the router instead. This also filters out ~50% of irrelevant database entries right off the bat.
  3. Type-Specific Retrieval Strategies:
  4. Episodic: Uses a decompose-then-align approach. An LLM extracts structured elements (Time, Participants, Location, Event) from both query and memory, summing their individual similarity scores alongside holistic similarity.
  5. Personal Semantic: Reverses standard query expansion. Because personal memories are rich and queries are vague, MemoType pre-generates hypothetical queries from each stored memory and matches the user's actual query against those.
  6. General Semantic: Because world facts are standardized, LLMs can easily guess what the answer looks like. Here, standard hypothetical memory generation (like HyDE) works great, fused with original query rankings via Reciprocal Rank Fusion.
  7. Query-Conditioned Memory Pruning: Multi-turn chat logs are messy and wander off-topic. Before generating a final answer, an LLM acts as a binary judge, snipping out retrieved dialogue segments that aren't strictly relevant to the query.

Datasets

  • TriMEM (New Benchmark): Because existing datasets (like PerLTQA) force single labels onto multi-topic chats and ignore general world knowledge, the authors built TriMEM to train their router. It contains 6,000 dialogue samples across user-user and user-assistant scenarios with fine-grained, multi-label annotations for the three memory types.
  • Evaluation Benchmarks: MemoType was tested on retrieval and QA generation across four established long-term memory datasets: LongMemEval-S, LongMemEval-M, LoCoMo, and PerLTQA.

Key Insights and Ideas

  • The Mathematical Ceiling of Unified Retrieval: The authors provide a formal proof (Theorem 3.3) showing that when a corpus contains semantically distinct clusters separated by an angle $\delta$, any single shared embedding encoder faces a strict upper bound on expected query-document alignment. Improving alignment for one memory type mathematically forces degradation in another.
  • Data Quality Beats Model Scale for Routing: Prompting massive LLMs to classify memory types yields mediocre results because conversational boundaries are blurry. However, once trained on TriMEM, even tiny encoders like BERT perform competitively with much larger models, proving the taxonomy and dataset are doing the heavy lifting.
  • Targeted Compute Amortization: Decomposing events into time/place/person is expensive. By only running this heavy extraction on the small fraction of memories routed as Episodic (e.g., ~12% in LongMemEval-S), MemoType gets the precision of structured RAG without the week-long indexing times of graph-based baselines.

Key Results

Using Contriever as the base retriever and gpt-4o-mini as the LLM backbone, MemoType swept all nine baselines (including HippoRAG2, LightMem, and SeCom) across every benchmark:

  • Retrieval Jumps: Achieved 48.09% Recall@1 on the massive LongMemEval-M dataset (beating SeCom by 16.18 points) and 71.92% Recall@1 on PerLTQA (beating MemoryOS by 14.73 points). Noticeably, complex baselines like HippoRAG2 and A-Mem couldn't even finish indexing LongMemEval-M within a week.
  • Better Answers: In downstream QA evaluated by GPT4Judge, MemoType scored 56.80 on LongMemEval-S (over 13 points higher than LightMem) and 48.79 on LoCoMo.
  • Ablation Validation: Forcing all memories through any single one of MemoType's three strategies caused Recall@1 to drop by over 5 points across datasets, directly backing up their theoretical proof.

Limitations and Future Work

The authors explicitly scope this paper to dialogue memory (user-to-user and user-to-assistant chats), noting that this differs from procedural "experience memory" in autonomous agent workflows (like learning software tools via reinforcement learning). As for next steps, while MemoType routes and processes individual memory chunks, the authors suggest exploring whether applying diverse strategies at the corpus level could unlock even better long-term memory performance.

Summary updated

Abstract

The memory capabilities of Large Language Models (LLMs) have garnered increasing attention recently. Despite great success achieved, existing retrieval-based memory approaches typically overlook the differences between memories and employ a unified strategy to process all memories, leading to suboptimal performance. Thus, an intuitive question arises: can we categorize memory into different types and select appropriate strategies? However, given the topic-rich, scenario-complex, and boundary-blurred nature of memory scenarios, achieving precise classification of memories is not easy. To address this challenge, we propose a memory multi-class dataset in this paper, termed TriMEM, which provides precise annotations for memory types across diverse scenarios. Building upon this foundation, we propose a novel memory framework, named MemoType, which can adaptively recognize each memory and query type with the learned router model. With the memory and query routing, MemoType can retrieve the memory with corresponding query types and design tailored retrieval strategies, thereby enhancing the retrieval performance. Moreover, we theoretically prove that any single retrieval strategy is subject to a fundamental upper bound on its expected retrieval precision in multi-class corpora, leading to systematic precision degradation. Extensive experiments on three datasets demonstrate that MemoType consistently outperforms existing methods, achieving up to 16.18% improvement in Recall@1.
BibTeX
@inproceedings{wen2026memory,
  author = {Yi Wen and Derong Xu and Pengyue Jia and Yichao Wang and Yingyi Zhang and Maolin Wang and Junyi Li and Wenlin Zhang and Xiaopeng Li and Yong Liu and Xiangyu Zhao},
  title = {{Memory Type Varies: Empowering LLM Agents for Long-Term Memory with Diverse Strategies}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=NCIPC3ZEFB},
}
Figure