arXiv(opens in a new tab)cs.AIOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.11573

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

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 multiclass 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 query-document alignment in multi-class corpora, leading to systematic performance degradation. Extensive experiments on three datasets demonstrate that MemoType consistently outperforms existing methods, achieving up to 16.18% improvement in Recall@1 1^{1}.

1 Introduction

Large Language Models (LLMs) have demonstrated remarkable abilities in natural language understanding and multi-turn dialogue fields, garnering increasing attention. However, with the growing frequency of User-LLM interactions, the limited context window length of LLMs fails to meet the demand for scalable conversational interactions [Liu et al., 2023]. When presented with retrospective queries, LLMs cannot effectively utilize conversation memories to achieve personalized responses, resulting in the “Forgetting” problem. To address this issue, Retrieval-Augmented Generation (RAG)-based memory techniques have emerged as a practical solution. Instead of concatenating all conversations, RAG-based approaches store conversations in an external bank for selective retrieval, which enables the LLM to recall critical memories and achieve personalized responses.

RAG-based memory strategies [Xu et al., 2025c, Lu et al., 2023] can be broadly classified into unstructured and structured types, based on whether to construct additional memory associative information. Unstructured memory augmentation approaches typically store dialogue fragments or summaries, retrieved through similarity matching with the given query. An early and influential effort is the MemoryBank [Zhong et al., 2024], which maintains a user-specific memory and retrieves facts

1^{1}https://github.com/wenyiwy99/MemoType.

Preprint.

LongMemEval-S t-SNE Distribution

Figure

Existing Retrieval-based Memory Methods

Our MemoType Framework

(a) The t-SNE distribution of LongMemEval-S. (b) Existing unified retrieval vs. MemoType framework.

Figure 1: Evidence and Motivation: Semantic Clustering of memory and the MemoType framework.

with relevance scoring to produce appropriate responses. On this basis, SeCom [Pan et al., 2025] employs adaptive memory segmentation techniques to achieve superior performance. Structural memory augmentation strategies organize memories into meaningful relationships, thereby achieving stronger sense-making and richer associations. For instance, HippoRAG [Gutiérrez et al., 2024] builds a graph and uses personalized pageRank to surface associative passages. Structural memory augmentation strategies deepen memory connections while inevitably introducing additional overhead.

Despite great success, the above methods still suffer certain drawbacks. In the retrieval phase, most approaches overlook the structural and content differences between memories and employ a unified strategy to process all memories, leading to suboptimal performance. For instance, event-related memories often contain fragmented information such as persons, time, and location, preventing regular embedding-based similarity from achieving precise retrieval. Conversely, when memories pertain only to basic concepts, introducing details like time or persons may introduce noise into the retrieval process. Thus, an intuitive question arises:

Can we categorize memory into different types and select tailored strategies for each type?

However, addressing the aforementioned issues presents two major obstacles: i) Existing memory systems lack a unified classification framework. Developing a comprehensive scheme that adequately captures the diversity of real conversation scenarios remains a significant challenge. 2^{2}. ii) Precise classification is inherently difficult given the topic-rich, scenario-complex, and boundary-blurred nature of memory scenarios. Although some attempts have been conducted, most research [Zhang et al., 2025, Wang and Chen, 2025] relies on human-crafted categories or adopts basic prompt-based methods to determine memory types, making it difficult to adapt to complex memory scenarios to achieve accurate classification, thus failing to acquire optimal results.

To tackle these challenges, we first draw on Tulving's distinction theory [Tulving et al., 1972] in cognitive psychology [Eysenck and Keane, 2020], which distinguishes memory into episodic and semantic components. Episodic memory records events tied to specific time, place, and participants, whereas semantic memory captures facts and stable knowledge. However, this coarse dichotomy is insufficient for real-world dialogue. Event-centric discussions are relatively rare. For instance, in the LongMemEval-S dataset, episodic memory accounts for only 12.35% of instances, making semantic memory overwhelmingly dominant and poorly resolved. This observation motivates a finer-grained semantic classification. Surprisingly, the t-SNE visualizations of LongMemEval, as shown in Figure 1a, reveal a pronounced semantic separation within semantic memory: the personal content and general knowledge form two distinct clusters with a clear semantic gap. Guided by this evidence, we introduce a well-defined categorization principle consisting of Episodic Memory, Personal Semantic Memory, and General Semantic Memory.

2^{2}In this paper, the memory we discuss primarily refers to dialogue memory, which mainly encompasses two categories: user-to-user conversations and user-to-assistant conversations. This differs from the experience memory in agent fields. We will not repeat this explanation in subsequent sections.

Inspired by the above classification principle, we construct a memory multi-class dataset, termed TriMEM, a memory multi-class dataset comprising 6,000 samples with fine-grained type annotations across diverse topics and scenarios. With the help of TriMEM, we propose a novel memory framework, named MemoType. As shown in Figure 1b, MemoType 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 in both effectiveness and efficiency. Besides, we design a memory pruning module that adaptively prunes retrieved memories based on queries, reducing irrelevant information. Moreover, we provide a theoretical analysis showing that any single retrieval strategy is subject to a fundamental upper bound on its expected query-document alignment in multi-class corpora, leading to systematic performance degradation. Our contributions are as follows:

• Inspired by Tulving’s distinction theory, we propose a novel categorization principle and construct TriMEM, a memory multi-class dataset with accurate annotations spanning diverse topics, providing a solid foundation for memory-type classification in memory field.

• We propose MemoType, a novel memory framework that adaptively recognizes memory and query types via a learned router, applies tailored retrieval strategies for each type, and further prunes irrelevant information from retrieved memories through a memory pruning module.

• We theoretically prove that any single retrieval strategy has a fundamental upper bound on its expected query-doc alignment in multi-class corpora, leading to systematic performance degradation.

References (70)