Source-linked AI summary

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 Zhao

arXiv:2610.11573v1cs.AI

TL;DR

Retrieval methods often use a unified strategy despite differences between memories. The paper introduces TriMEM and MemoType for type-aware retrieval, and reports that MemoType performs best across four datasets.

  • Problem

    Most retrieval-based memory methods use a unified strategy despite structural and content differences between memories, which can lead to suboptimal retrieval.

    Source: §1 · p. 2
  • Method

    TriMEM annotates memory types, while MemoType uses a learned router to identify memory and query types and apply tailored retrieval strategies.

    Source: §1 · p. 3, §6 · p. 9
  • Results

    MemoType achieves the best performance across all four datasets.

    Source: §4.2 · p. 7
  • Takeaways & Limitations

    The analysis shows that a single retrieval strategy has an upper bound on expected query-document alignment in multi-class corpora.

    Source: §1 · p. 3

    Element decomposition adds computational cost, though routing restricts it to episodic memories rather than expanding structure corpus-wide.

    Source: §2.4 · p. 5

Abstract

from arXiv · show

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.

1 Introduction

RAG-based memory can support personalized recall, but existing systems often use a unified retrieval strategy despite differences among memories. The paper introduces a three-type classification, TriMEM, and MemoType to route memories and queries to tailored strategies.

1 Introduction

  • Existing memory approaches often process structurally and content-wise different memories with one strategy, although event fragments and basic concepts pose different retrieval challenges.The introduction also identifies the lack of a unified classification framework and the difficulty of precise classification in complex, boundary-blurred scenarios.Source: §1 · p. 2
  • The proposed taxonomy distinguishes Episodic Memory, Personal Semantic Memory, and General Semantic Memory, refining the episodic/semantic distinction for dialogue scenarios.In LongMemEval-S, episodic memory accounts for 12.35% of instances; the paper reports personal content and general knowledge as distinct semantic clusters.Source: §1 · p. 2
  • Here, “memory” primarily means dialogue memory from user-user and user-assistant conversations, rather than agent experience memory.Source: §1 · p. 2
  • TriMEM contains 6,000 samples with fine-grained memory-type annotations across diverse topics and scenarios.MemoType uses a learned router to identify memory and query types, apply tailored retrieval strategies, and prune irrelevant retrieved memories.Source: §1 · p. 3
  • The paper theoretically argues that any single retrieval strategy has an upper bound on expected query-document alignment in multi-class corpora, leading to systematic performance degradation.The introduction presents this bound as a consequence of corpus heterogeneity.Source: §1 · p. 3

2 MemoType

MemoType addresses the difficulty of classifying diverse dialogue memories and matching them with suitable retrieval strategies. Its design combines memory-type routing, type-specific retrieval, and query-conditioned pruning.

2.2 TriMEM Dataset

  • TriMEM frames memory diversity through three memory types, against prior taxonomy limits including single-label annotation and conflation of dialogue form with content type.The cited discussion presents these limitations as motivation for a more comprehensive classification benchmark grounded in real-world dialogue scenarios.Source: §2.2 · p. 3, Figure 2 · p. 4

2.3 Type Router

  • MemoType uses a fine-tuned memory router and classifies hypothetical memories generated from a query to determine its query type.The router is described as a lightweight Qwen3-1.7B model fine-tuned with LoRA for multi-label classification; the most frequent predicted category across hypothetical memories determines query type.Source: §2.3 · p. 4
  • Type-aware filtering removes approximately 50% of unrelated memories across datasets, with K=5 chosen to balance coverage and robustness.The filtering strategy reduces the retrieval space.Source: §2.3 · p. 4

2.4 Type-Specific Retrieval Strategies

  • Episodic retrieval decomposes queries and memories into typed event elements, then aligns those elements instead of relying on a single holistic embedding.The elements include temporal information, participants, location, and event context; routing restricts this more costly strategy to episodic memories.Source: §2.4 · p. 5
  • For personal semantic memory, MemoType expands each memory into hypothetical queries and fuses that score with original query-memory similarity.This reverses query-side expansion because personal-knowledge queries are often underspecified relative to their richer memories.Source: §2.4 · p. 5
  • For general semantic memory, MemoType expands the query into hypothetical memories and fuses their retrieval results with those from the original query.The paper motivates query-side expansion by the relatively standardized expression of factual world knowledge.Source: §2.4 · p. 5

2.5 Memory Pruning Module

  • Query-conditioned pruning filters retrieved multi-topic dialogue segments before generation because even a relevant segment can contain unrelated content that may mislead the generator.The paper contrasts this issue with standard document retrieval, where passages tend to be topically coherent.Source: §2.5 · p. 5

3 Theoretical Analysis

The analysis studies shared-encoder retrieval in corpora with separated latent categories. It derives an expected-alignment ceiling and explains how category diversity and separation constrain retrieval across categories.

Theoretical result

  • For uniformly distributed documents across categories separated by δ, any retrieval encoder has an upper bound on expected query-document similarity.The theorem assumes a positive lower bound on intercategory angular separation.Source: §3 · p. 6

Implications

  • As the number of categories C or their separation δ increases, the shared-encoder alignment ceiling tightens, limiting simultaneous performance across categories and degrading retrieval precision.The analysis states that improving alignment for one category comes at the cost of suppressing alignment for others.Source: §3 · p. 6

4 Experiment

Experiments compare MemoType with nine baselines on four long-term-memory datasets across retrieval and generation tasks. MemoType leads the reported overall results, while ablations show gains from type-aware retrieval and query-conditioned pruning.

4.1 Experimental Settings

  • Evaluation covers four long-term-memory datasets, retrieval and generation tasks, nine baselines, shared Contriever embeddings, and GPT-4o-mini with temperature fixed at 0.Raptor has no retrieval results; A-Mem, HippoRAG2, and Raptor are omitted on LongMemEval-M because memory construction exceeded one week.Source: §4.1 · pp. 6–7, §4.2 · p. 7

4.2 Overall Results

  • MemoType leads retrieval across all four datasets, with Recall@1 of 59.15% on LongMemEval-S and 71.92% on PerLTQA.Table 1 reports retrieval performance with Contriever as the retriever.Source: Table 1 · p. 7, §4.2 · p. 7
  • MemoType ranks best on all four QA datasets; on LongMemEval-S, its GPT4Judge score is 56.80 and BLEU score is 4.66.Table 2 reports question-answer performance with Contriever as the retriever.Source: §4.2 · pp. 7–8, Table 2 · p. 8

4.3 Ablation Study

  • Type-aware retrieval exceeds the best single strategy in Recall@1 by 5.24 points on LongMemEval-S, with gains on LoCoMo and PerLTQA.Table 3 compares the proposed type-aware strategy with single-strategy retrieval on three datasets.Source: Table 3 · p. 8, §4.3 · p. 9
  • On LongMemEval-S, query-conditioned pruning raises F1 from 19.55 to 20.31 by filtering query-irrelevant retrieved content before generation.The paper attributes the improvement to reducing noise from irrelevant memory segments.Source: §4.3 · p. 9

5 Related Work

Related work covers retrieval-augmented memory organized as unstructured chunks or structured relations, as well as agent-memory methods beyond RAG. These approaches involve trade-offs between richer memory organization and overhead.

  • Figure 3 presents an ablation study of the memory-pruning module on two benchmarks.Source: Figure 3 · p. 9

RAG-based Memory technology

  • Unstructured RAG stores dense chunks or summaries for similarity retrieval, while structured RAG adds graph or tree relations that can aid complex reasoning but incur computational overhead.The discussion also notes that structural enhancements may add noise and degrade performance on simpler problems.Source: §5 · p. 9

Agent Memory Beyond RAG

  • Beyond RAG, agent-memory methods use mechanisms such as latent memory pools, reinforcement-learning memory managers, and lifelong skill distillation, often with higher construction latency.The paper identifies balancing performance and latency as an open area for these methods.Source: §5 · p. 9

6 Conclusion

The conclusion presents TriMEM's three-category benchmark and MemoType's type-adaptive retrieval framework, alongside a theoretical limit on single-strategy retrieval in heterogeneous corpora.

  • TriMEM categorizes memory as Episodic, Personal Semantic, and General Semantic Memory, drawing on cognitive psychology.Source: §6 · p. 9
  • MemoType identifies memory types and designs tailored storage and retrieval strategies, with experiments demonstrating its effectiveness.Source: §6 · p. 9
  • The paper's theoretical analysis finds a fundamental precision bound for single-strategy retrieval in heterogeneous corpora; corpus-level strategy benefits remain a future direction.Source: §6 · p. 9

A Proof of Theorem 3.3

The appendix gives a bound for single-strategy retrieval under category assumptions, motivates and defines three dialogue-memory categories, and details TriMEM's construction and verification.

A Proof of Theorem 3.3

  • Under angular separation and uniform category distribution assumptions, the theorem bounds expected query-document similarity; no single retrieval direction can align highly with every category direction.Source: A Proof of Theorem 3.3 · p. 16

B.1 Classification Rationale

  • The classification covers linguistic declarative dialogue memory: episodic and semantic memory, with semantic memory split into personal and general categories.The split addresses category imbalance and reflects reported semantic differences between personal and general memory.Source: §B.1 · p. 17

B.2 Memory Type Definitions

  • Episodic memory concerns contextualized events or plans; Personal Semantic Memory captures enduring individual knowledge, while General Semantic Memory covers world facts.Source: §B.2 · pp. 17–18

B.3 Dataset Construction Pipeline

  • TriMEM's 6,000 dialogue samples were assembled from multiple sources and manually constructed dialogues, then labeled with category-specific prompts and human verification.Verification reported 94.6% overall annotation accuracy and Fleiss’ κ of 0.87; ambiguous samples were corrected and rechecked.Source: §B.3 · pp. 18–19

B.4 Dataset Statistics

TriMEM spans varied conversational settings, with overlapping memory-type labels and distinct patterns across interaction types. On TriMEM, the evaluated model outperforms the other LLMs overall, though existing LLMs still struggle with precise classification.

B.4 Dataset Statistics

  • TriMEM’s 6,000 dialogues span user-assistant and user-user interactions, with an average of 91.06 tokens per text.The reported interaction shares are 58.77% user-assistant and 41.23% user-user.Source: §B.4 · p. 19
  • Memory labels overlap: Episodic Memory covers 29.08%, Personal Semantic Memory 49.35%, General Semantic Memory 33.95%, and None 16.25%.The proportions sum above 100% because a dialogue may carry multiple labels.Source: §B.4 · p. 19
  • General Semantic Memory is concentrated in user-assistant dialogues (90.48%), while Episodic and Personal Semantic Memory slightly favor user-user dialogues (59.71% and 57.72%).None is approximately balanced: 56.82% user-assistant and 43.18% user-user.Source: §B.4 · p. 19

B.5 Router Classification Performance

  • 92.10% ACC and 91.75% F1: the evaluated model leads overall on TriMEM, ahead of GPT-4o-Mini’s 83.55% ACC and 76.94% F1.For Personal Semantic Memory, its 82.65% ACC is below GPT-4o-Mini’s 87.18%, while its 85.64% F1 is slightly above GPT-4o-Mini’s 85.59%.Source: §B.5 · p. 20
  • Despite the model’s stronger TriMEM results, the paper reports that existing LLMs still struggle with precise classification and need improved accuracy and generalization.Source: §B.5 · p. 20

B.6 Data Leakage Analysis

Surface-form measures show low overlap between transferred and original memories, while semantic similarity remains moderate rather than near-duplicate. The paper interprets these patterns as evidence against instance-level copying and reports strong out-of-distribution router accuracy on PerLTQA.

B.6 Data Leakage Analysis

  • Across LongMemEval-S and LoCoMo, most samples fall below 0.5 on Word Overlap Rate, BLEU, and 3-gram Overlap Rate.The distributions are concentrated in the low-similarity range, with low means and medians and few high-overlap cases.Source: §B.6 · p. 20
  • Contriever cosine similarity centers around 0.70—mean 0.712 on LoCoMo and 0.701 on LongMemEval-S—without a high-similarity peak above 0.9.The paper says rewritten dialogues retain meaning needed for their original memory-type labels, but are not semantic near-duplicates.Source: Figure 7 · p. 20, §B.6 · p. 21

B.7 Dataset Statistics

  • The paper combines surface-form and semantic analyses to argue that the router relies on generalized memory-type characteristics rather than copied expressions or individual benchmark instances.Source: §B.6 · p. 21, §B.7 · p. 21
  • 96–100% accuracy on PerLTQA, whose dialogues were not used to construct TriMEM, is reported as out-of-distribution router performance.The paper interprets this as evidence of generalizable type-level features rather than benchmark-specific patterns.Source: §B.7 · p. 21

C.1 Evaluation Dataset Details

The evaluation spans long-term conversational-memory benchmarks with different scales and designs, alongside a set of retrieval and memory-system baselines. The supplied dataset descriptions distinguish conversation-centered tests from PerLTQA’s persona-centered memory views.

C.1 Evaluation Dataset Details

  • LongMemEval-S has 50 question sessions averaging 115,000 tokens, while LongMemEval-M extends the setting to 500 sessions per question and 1.5 million tokens per conversation.Source: §C.1 · p. 22
  • LoCoMo evaluates long-context dialogue handling, with conversations averaging 300 turns and 9,000 tokens and extending to 35 sessions.The described public subset, LoCoMo-10, contains ten conversations.Source: §C.1 · p. 22
  • PerLTQA combines persona profiles, relationships, life events, and multi-turn dialogues with questions grounded in specific dialogue turns.Its design supports joint evaluation of memory classification, retrieval, and fusion for downstream QA.Source: §C.1 · p. 23

C.2 Baseline Descriptions

  • The listed retrieval baselines include dense encoders and query-expansion approaches: Contriever, MPNet, MiniLM, QAMiniLM, HyDE, Mill, and Query2Doc.HyDE retrieves using generated hypothetical documents; Mill generates sub-queries and documents with mutual verification; Query2Doc uses pseudo-documents for query expansion.Source: §C.2 · pp. 23–24
  • Other listed memory and retrieval systems include LightMem, Secom, HippoRAG2, Raptor, A-Mem, and MemoryOS.Their descriptions cover topic-aware memory processing, structural passage connections, hierarchical abstraction, dynamic linking, and tiered memory organization.Source: §C.2 · p. 24

D.1 Retriever Ablation

MemoType’s retrieval gains persist across the tested embedding models, including weaker retrievers. The results support gains that are not tied to one particular encoder.

D.1 Retriever Ablation

  • The ablation replaces default Contriever with MPNet, MiniLM, and QAMiniLM, covering general-purpose and task-specific encoders.Source: §D.1 · p. 24
  • 47.87 Recall@1 with MPNet on LongMemEval-S exceeds the strongest baseline, SeCom, by over 10 points; MemoType also leads across all tested retriever–dataset combinations and ranks.Other reported examples are 49.01 Recall@1 on PerLTQA with MiniLM, nearly 18 points above A-Mem, and 49.79 Recall@1 on LongMemEval-S with QAMiniLM, 8.73 points above SeCom.Source: §D.1 · p. 24, Table 7 · p. 25
  • The authors attribute consistent gains across embedding models to diversity-aware routing rather than a favorable interaction with one encoder.They also report substantial margins with weaker retrievers and characterize the framework as robust.Source: §D.1 · p. 24

D.2 Router Performance Ablation

MemoType’s router filters memories by predicted query type, improving retrieval across four datasets. The ablation isolates classification filtering from retrieval enhancements.

D.2 Router Performance Ablation

  • The ablation compares type-filtered retrieval with retrieval over the unfiltered corpus, applying no retrieval enhancement strategies in either setting.The reported gains are attributed to filtering that removes irrelevant memory categories from the candidate pool.Source: §D.2 · pp. 25–26
  • Across all four datasets, classification filtering improves retrieval; on LongMemEval-S, Recall@1 rises from 43.40 to 50.21.On LongMemEval-S, NDCG@5 rises from 60.33 to 65.47; on LoCoMo, Recall@3 increases from 36.56 to 41.99.Source: §D.2 · pp. 25–26
  • On LongMemEval-M, Recall@1 improves by 4.68 points with nearly 500 sessions per question, while PerLTQA Recall@1 rises from 55.32 to 61.98.PerLTQA shows consistent gains across all metrics.Source: §D.2 · p. 26

D.3 Memory Pruning Ablation

The ablations report gains from memory pruning and complementary type-specific retrieval strategies, competitive routing with lightweight encoders, lower LLM costs, and separated memory-type clusters.

D.3 Memory Pruning Ablation

  • 20.30 to 22.23 F1 on LoCoMo with pruning; gains extend across datasets and nearly all generation metrics.Pruning retains query-relevant content before generation; gains are more substantial on BLEU and Rouge than on BERTScore.Source: §D.3 · p. 26

D.4 Per-Type Retrieval Strategy Contributions

  • Combining all three type-specific strategies achieves the highest scores across datasets and metrics, while episodic retrieval yields the largest individual gains.On LoCoMo, w/ EM raises Recall@1 from 25.13 to 28.25; on PerLTQA, w/ PM raises Recall@1 from 61.98 to 67.62.Source: §D.4 · p. 27, Figure 11 · p. 27, Figure 12 · p. 28

D.5 Router Architecture Ablation

  • RoBERTa reaches 58.09 Recall@1 on LongMemEval-S, 1.06 points below Qwen3-1.7B, and 49.15 on LongMemEval-M, slightly surpassing it.The authors attribute routing effectiveness primarily to TriMEM’s data quality and annotation precision, and note encoder-only models are faster at inference.Source: §D.5 · p. 27, Table 10 · p. 28

D.6 Cost Analysis

  • MemoType is cheapest across all four datasets; on LongMemEval-M, its API bill is 146× lower than HippoRAG2 and 248× lower than A-Mem.Its paid LLM calls are limited to turns routed as Episodic Memory; on PerLTQA it halves HippoRAG2’s cost and is more than 3× cheaper than A-Mem.Source: §D.6 · pp. 27–28, Table 11 · p. 29

D.7 Empirical Evidence for Semantic Clustering

  • On LongMemEval-S and PerLTQA, the three memory types form distinct embedding clusters, corroborating angular separation and supporting a non-vacuous theoretical bound.General Semantic Memory is particularly separated from the other categories.Source: §D.7 · pp. 28–29, Figure 13 · p. 29

E.1 RAG-based Memory Methods

The part leads cover long-term LLM memory systems that use external stores and retrieval, including learned memory-management policies, alongside reproducibility and research-responsibility checklist disclosures.

E.1 RAG-based Memory Methods

  • RAG approaches include vector memories with forgetting or salience heuristics, structured notes and graphs, tiered stores, and reflection-based consolidation.Examples include cached chains-of-thought [Liu et al., 2023], agentic note networks [Xu et al., 2025c], and hippocampal indexes [Gutiérrez et al., 2024].Source: §E.1 · pp. 29–30
  • RAG memory systems encode interaction history in a retrievable store and surface relevant items on demand, varying in granularity, update discipline, and retrieval signal.Stores range from turns and sessions to facts and graphs; updates may be online, batched, or sleep-time, while retrieval may use embeddings, keywords, or structural traversal.Source: §E.1 · p. 30

E.2 RL-based Memory Methods

  • RL-based memory work trains controllers to optimize storage and recall for downstream reward rather than surface-level similarity, and reports gains over fixed heuristics on long-horizon benchmarks.Learned policies include structured ADD, UPDATE, DELETE, and NOOP actions trained with PPO or GRPO using QA outcome rewards [Yan et al., 2025, Yu et al., 2026].Source: §E.2 · p. 30
  • RL methods also learn end-to-end memory construction and address sparse rewards through shaping, while differing from retrieval agents because they decide what to remember and when to forget.Mem-α generalizes from short training contexts to sequences an order of magnitude longer [Wang et al., 2025], MemAgent targets million-token histories [Yu et al., 2025], and ReMemR1 combines final-answer rewards with dense step-level signals [Shi et al., 2025].Source: §E.2 · p. 30

NeurIPS Paper Checklist

Loading 2610.11573v1…