From Single to Multi-Granularity: Toward Long-Term Memory Association and Selection of Conversational Agents
MemoryAgentICLR 2026 PosterCCF-A中国科学技术大学香港城市大学华为诺亚方舟实验室https://openreview.net/forum?id=i2yIvZARnG
https://github.com/Applied-Machine-Learning-Lab/ICLR2026_MemGAS
从单粒度到多粒度:面向对话智能体的长期记忆关联与选择
Abstract
Large Language Models (LLMs) have recently been widely adopted in conversational agents. However, the increasingly long interactions between users and agents accumulate extensive dialogue records, making it difficult for LLMs with limited context windows to maintain a coherent long-term dialogue memory and deliver personalized responses. While retrieval-augmented memory systems have emerged to address this issue, existing methods often depend on single-granularity memory segmentation and retrieval. This approach falls short in capturing deep memory connections, leading to partial retrieval of useful information or substantial noise, resulting in suboptimal performance. To tackle these limits, we propose MemGAS, a framework that enhances memory consolidation by constructing multi-granularity association, adaptive selection, and retrieval. MemGAS is based on multi-granularity memory units and employs Gaussian Mixture Models to cluster and associate new memories with historical ones. An entropy-based router adaptively selects optimal granularity by evaluating query relevance distributions and balancing information completeness and noise. Retrieved memories are further refined via LLM-based filtering. Experiments on four long-term memory benchmarks demonstrate that MemGAS outperforms state-of-the-art methods on both question answer and retrieval tasks, achieving superior performance across different query types and top-K settings.
大语言模型(LLM)近来已被广泛应用于对话智能体。 然而,用户与智能体之间日益增长的长期交互会积累大量对话记录,使上下文窗口有限的 LLM 难以维持连贯的长期对话记忆并提供个性化响应。 尽管检索增强记忆系统已经出现以解决这一问题,现有方法往往依赖单粒度记忆切分与检索。 这种方法无法充分捕捉深层记忆连接,导致只能检索到部分有用信息,或引入大量噪声,从而造成次优性能。 为克服这些限制,我们提出 MemGAS,这是一个通过构建多粒度关联、自适应选择和检索来增强记忆巩固的框架。 MemGAS 以多粒度记忆单元为基础,并采用高斯混合模型对新记忆进行聚类,使其与历史记忆建立关联。 基于熵的路由器通过评估查询相关性分布,并在信息完整性与噪声之间取得平衡,自适应选择最佳粒度。 检索到的记忆还会通过基于 LLM 的过滤进一步精炼。 在四个长期记忆基准上的实验表明,MemGAS 在问答和检索任务上均优于最先进方法,并在不同查询类型与 top-K 设置下取得更优性能。
1. Introduction
Large Language Models (LLMs) have showcased remarkable conversational abilities, enabling them to serve as personalized assistants and handle a wide range of applications, such as customer service and software development. However, as user-agent interactions increase, the volume of conversational history grows significantly. Despite their impressive conversational abilities, LLMs struggle with maintaining long-term conversational memory due to their limited context length, which makes it challenging to retain a comprehensive record of user interactions and preferences over time. This limitation undermines their ability to generate coherent and personalized responses. The development of retrieval-based external (non-parametric) memory systems has emerged as a promising solution. By storing interaction histories and retrieving relevant information when needed, memory systems enable LLMs to recall user-specific details from past dialogues and deliver more tailored responses.
大语言模型(LLM)已经展现出卓越的对话能力,使其能够充当个性化助手,并处理客户服务和软件开发等广泛应用。 然而,随着用户与智能体的交互增多,对话历史的规模也显著增长。 尽管 LLM 具有令人瞩目的对话能力,但受限于上下文长度,它们难以维持长期对话记忆,也很难随时间完整保留用户交互与偏好记录。 这一限制削弱了它们生成连贯且个性化响应的能力。 基于检索的外部(非参数化)记忆系统已成为一种很有前景的解决方案。 通过存储交互历史并在需要时检索相关信息,记忆系统使 LLM 能够回忆过去对话中的用户特定细节,并提供更贴合用户的响应。
Recent studies on external memory systems of LLM agents primarily depend on the Retrieval-Augmented Generation (RAG) pipeline and have explored diverse aspects of memory segmentation and construction for effective retrieval. For memory segmentation, existing approaches mainly adopt single-granularity to segment conversations. They utilize session-level chunks as retrieval units, while others employ finer-grained turn-level segmentation to capture details. Recent advances introduce topic-aware segmentation techniques that group dialogue based on semantic coherence, enhancing topic-consistent retrieval. Additionally, several works generate memory summary, condensing key information into compact representations to improve retrieval efficiency.
近期关于 LLM 智能体外部记忆系统的研究主要依赖检索增强生成(RAG)流水线,并从记忆切分与构建的多个方面探索如何实现有效检索。 在记忆切分方面,现有方法主要采用单一粒度切分对话。 一些方法将会话级块作为检索单元,另一些方法则采用更细粒度的轮次级切分来捕捉细节。 近期进展引入了主题感知切分技术,按照语义连贯性对对话进行分组,从而增强主题一致的检索。 此外,一些工作还会生成记忆摘要,将关键信息压缩成紧凑表示以提高检索效率。
Regarding memory construction, researchers have explored structured organization paradigms to enhance long-term knowledge retention. Methods like RAPTOR and MemTree employ hierarchical tree structures to encode multi-scale relations between memory units. Inspired by cognitive mechanisms, HippoRAG implement graph-based memory architectures that simulate neural memory consolidation processes, establishing relations between entities.
在记忆构建方面,研究人员已经探索了结构化组织范式,以增强长期知识保留。 RAPTOR 和 MemTree 等方法采用层次树结构来编码记忆单元之间的多尺度关系。 受认知机制启发,HippoRAG 实现了模拟神经记忆巩固过程的图记忆架构,从而在实体之间建立关系。

However, despite their progress, current approaches exhibit two critical limits: i) Insufficient Multi-Granularity Memory Connection. While existing methods endeavor to organize memories into topological structures (e.g., knowledge graphs or trees), they predominantly concentrate on singular granularity levels—either entities or session summaries. This single-scale paradigm fails to model cross-granular interactions between memory units, resulting in retrieving only partial useful information. As demonstrated in Figure 1, answering multi-session queries requires establishing semantic links across granularities (e.g., connecting Conversation 1 and Conversation 2 through shared keyword/summary). Failure to establish links results in partial retrieval (e.g., retrieving only Conversation 1), which leads to incorrect answers.
然而,尽管现有方法已经取得进展,它们仍存在两个关键限制: i)多粒度记忆连接不足。 尽管现有方法尝试将记忆组织成拓扑结构(例如知识图谱或树),但它们主要集中在单一粒度层面,即实体或会话摘要。 这种单尺度范式无法对记忆单元之间的跨粒度交互进行建模,导致只能检索到部分有用信息。 如图1所示,回答多会话查询需要跨粒度建立语义链接,例如通过共享的关键词或摘要连接 Conversation 1 与 Conversation 2。 未能建立这些链接会造成不完整检索,例如只检索到 Conversation 1,进而导致错误答案。
ii) Lack of Adaptive Multi-Granular Memory Selection. Current methods mainly rely on fixed granularity strategies (e.g., session/turn segmentation or LLM-generated summaries), which often lead to incomplete context recall or noise due to improper granularity. Although topic-aware segmentation enhances intra-chunk coherence, they lack adaptive mechanisms to select granularity for each query. Our empirical analysis in Figure 1(a) reveals that adaptively choosing best-suited granularity per query (e.g., balancing noise reduction in summaries/keywords with information retention in raw sessions) yields substantial performance gains. This highlights the necessity of granularity selection to resolve the inherent noise-information trade-off.
ii)缺乏自适应多粒度记忆选择。 当前方法主要依赖固定粒度策略,例如会话或轮次切分以及 LLM 生成的摘要;粒度选择不当常会造成上下文回忆不完整或引入噪声。 尽管主题感知切分增强了块内连贯性,但这些方法缺乏针对每个查询自适应选择粒度的机制。 我们在图1(a)中的实证分析表明,为每个查询自适应选择最适合的粒度,例如在摘要或关键词的噪声减少与原始会话的信息保留之间取得平衡,可以带来显著性能提升。 这突出了粒度选择对于解决内在噪声—信息权衡的必要性。
In this paper, we propose MemGAS, a framework for constructing and retrieving long-term memories through multi-granularity association and adaptive selection. Our method addresses these issues by two core strategies: i) Memory Association: We leverage LLMs to generate memory summaries and keywords, constructing multi-granular memory units. When new memory is updated, a Gaussian Mixture Model is employed to cluster historical memories into an accept set (relevant) and a reject set (irrelevant). The memories in the accept set are then associated with new memories, ensuring consolidated memory structures and real-time updates. ii) Granularity Selection: An entropy-based router adaptively assigns retrieval weights to different granularities by evaluating the certainty of the query’s relevance distribution. Finally, critical memories are retrieved using Personalized PageRank and filtered through LLMs to remove redundancies, ensuring a refined and high-quality memory that enhances the assistant's understanding. Experiments on four open-source long-term memory benchmarks demonstrate that MemGAS significantly outperforms state-of-the-art baselines and single-granularity approaches on both question answer (QA) and retrieval tasks. Moreover, it consistently achieves superior results across various query types and retrieval top-k settings.
在本文中,我们提出 MemGAS,这是一个通过多粒度关联与自适应选择来构建和检索长期记忆的框架。 我们的方法通过两项核心策略解决这些问题:i)记忆关联: 我们利用 LLM 生成记忆摘要和关键词,以构建多粒度记忆单元。 当新记忆更新时,采用高斯混合模型将历史记忆聚类为接受集(相关)和拒绝集(无关)。 随后,接受集中的记忆会与新记忆建立关联,从而确保记忆结构得到巩固并能实时更新。 ii)粒度选择: 基于熵的路由器通过评估查询相关性分布的确定性,自适应地为不同粒度分配检索权重。 最后,系统使用个性化 PageRank 检索关键记忆,并通过 LLM 过滤冗余,从而得到精炼且高质量的记忆,增强助手的理解能力。 在四个开源长期记忆基准上的实验表明,MemGAS 在问答(QA)和检索任务上均显著优于最先进基线与单粒度方法。 此外,它在多种查询类型和检索 top-k 设置下都持续取得更优结果。
2. Methodology
This section defines the task and data format, constructs a dynamical memory association framework, details an entropy-based router for better-suited granularity, and outlines strategies for retrieving and filtering high-quality contextual information for response generation.
本节定义任务与数据格式,构建动态记忆关联框架,详细介绍面向更适合粒度的熵路由器,并概述用于检索和过滤高质量上下文信息以生成响应的策略。
2.1 Preliminary
Our work focuses on building personalized assistants through long-term conversational memory, where the system leverages multi-session user-agent interactions (referred to as memory) to construct an external memory bank
我们的工作聚焦于通过长期对话记忆构建个性化助手,其中系统利用多会话用户—智能体交互(称为记忆)来构建外部记忆库
When the assistant receives a query
当助手收到查询
2.2 Multi-Granularity Association Construction
Existing methods mainly encode memories into vector libraries (e.g., session-level chunks) and directly retrieve information via similarity search. However, such approaches overlook deeper associations between memories. To address this, we propose an associative memory construction process that captures multi-granular relationships.
现有方法主要将记忆编码到向量库中,例如会话级块,并通过相似度搜索直接检索信息。 然而,这些方法忽略了记忆之间更深层的关联。 为解决这一问题,我们提出一种能够捕捉多粒度关系的关联记忆构建过程。
Multi-Granular Memory Metadata. For the
多粒度记忆元数据。 对于第
Here,
其中,
Dynamical Memory Association. When a new memory
动态记忆关联。 当加入新记忆
- Accept Set: Memories with high similarity to
, forming direct associations with . - Reject Set: Irrelevant memories, excluded from immediate connections with
.
- 接受集: 与
高度相似的记忆,它们会与 建立直接关联。 - 拒绝集: 无关记忆,它们不会立即与
建立连接。
Note that the similarity vectors are computed with granularity-specific information, meaning that each granularity of
需要注意的是,相似度向量使用各粒度特定的信息计算,这意味着

2.3 Multi-Granularity Router
Existing methods rely on single predefined granularity for memory retrieval, limiting their ability to adaptively prioritize fine- or coarse-grained information based on query. To address this, we propose an entropy-based router that adaptively selects the better-suited granularity for each query.
现有方法依赖单一预定义粒度进行记忆检索,限制了它们根据查询自适应优先选择细粒度或粗粒度信息的能力。 为解决这一问题,我们提出一种基于熵的路由器,为每个查询自适应选择更适合的粒度。
Entropy-Driven Granularity Selection. For a query
熵驱动的粒度选择。 对于查询
where
其中,
Soft Router Weights. Our motivation stems from that lower entropy
软路由权重。 我们的动机在于,较低的熵
where
其中,
2.4 Memory Retrieval and Filter
After constructing the multi-granularity memory associations and determining granularity weights, we retrieve relevant memories for a query
在构建多粒度记忆关联并确定粒度权重后,我们利用图结构记忆
where
其中,
Using the initial scores
我们将初始分数
LLM-Based Redundancy Filtering. To minimize noise and eliminate redundancy in the retrieved multi-granularity memories, we employ an LLM-based filtering mechanism. This mechanism processes the top-
基于 LLM 的冗余过滤。 为尽量减少噪声并消除检索到的多粒度记忆中的冗余,我们采用基于 LLM 的过滤机制。 该机制将 top-
3. Experiments
3.1 Experimental Settings
Dataset and Metrics. Experiments are conducted on four comprehensive long-term memory datasets: LoCoMo, Long-MT-Bench+, LongMemEval-s, and LongMemEval-m, all focused on evaluating the capabilities of LLM agents in long-term conversations. Since our task is training-free, the whole QA pairs in datasets are used for evaluation. Detailed dataset statistics are provided in Appendix.
数据集与指标。 我们在四个综合性长期记忆数据集上开展实验:LoCoMo、Long-MT-Bench+、LongMemEval-s 和 LongMemEval-m;它们均侧重评估 LLM 智能体在长期对话中的能力。 由于我们的任务无需训练,因此使用数据集中的全部问答对进行评估。 详细的数据集统计信息见附录。
To comprehensively evaluate model performance, we employ multiple metrics: F1 scores, BLEU (with 4-gram by default), BERTScore, and ROUGE scores. Additionally, we introduce GPT4o-as-Judge (GPT4o-J), an evaluation setting where GPT4o assesses the alignment of a model's response with the reference answer. The evaluation prompts are provided in Appendix.
为全面评估模型性能,我们采用多项指标:F1 分数、BLEU(默认使用 4-gram)、BERTScore 和 ROUGE 分数。 此外,我们引入 GPT4o-as-Judge(GPT4o-J)评估设置,由 GPT4o 判断模型响应与参考答案的一致程度。 评估提示见附录。
Baselines. We compare MemGAS against various methods.
基线。 我们将 MemGAS 与多种方法进行比较。
- 1. Full History: which utilizes all the latest conversation records, incorporating up to 128k tokens of context.
- 2. MPNet.
- 3. Contriever.
- 4. RecurSum: which uses LLMs to recursively summarize and update memory for contextually relevant responses.
- 5. MPC: which composes LLM with prompting and external memory.
- 6. A-Mem: which organizes memories through generating note and links.
- 7. SeCom: which segments memory into coherent topics and applies compression-based denoising to boost retrieval.
- 8. HippoRAG 2: which integrates knowledge graphs for efficient retrieval.
- 9. RAPOTR: which enhances retrieval via recursive summary and hierarchical clustering into a tree structure.
- 1. Full History: 使用全部最新对话记录,纳入最多 128k token 的上下文。
- 2. MPNet。
- 3. Contriever。
- 4. RecurSum: 使用 LLM 递归总结并更新记忆,以生成上下文相关响应。
- 5. MPC: 将 LLM、提示与外部记忆组合起来。
- 6. A-Mem: 通过生成笔记和链接来组织记忆。
- 7. SeCom: 将记忆切分为连贯主题,并采用基于压缩的去噪来增强检索。
- 8. HippoRAG 2: 集成知识图谱以实现高效检索。
- 9. RAPTOR: 通过递归摘要和层次聚类构建树结构,从而增强检索。
More details can be found in Appendix.
更多细节见附录。
| Model | 4o-J | F1 | B-4 | R-1 | R-2 | R-L | BS | Avg. Tokens | Avg. Latency |
|---|---|---|---|---|---|---|---|---|---|
| LongMemEval-s | |||||||||
| Full History | 50.60 | 11.48 | 1.40 | 12.10 | 5.47 | 10.85 | 83.07 | 103,137 | 9.39 |
| MPNet | 53.20 | 13.96 | 2.21 | 14.49 | 6.78 | 12.93 | 83.72 | 8,173 | 1.82 |
| Contriever | 55.40 | 13.78 | 2.21 | 14.46 | 6.93 | 12.89 | 83.70 | 8,286 | 1.85 |
| MPC | 53.80 | 13.60 | 1.74 | 14.27 | 6.49 | 12.95 | 83.49 | 8,457 | 2.66 |
| RecurSum | 35.40 | 12.29 | 2.09 | 13.01 | 5.55 | 11.52 | 83.60 | 8,853 | 1.94 |
| SeCom | 56.00 | 12.95 | 2.25 | 13.80 | 6.09 | 11.93 | 83.51 | 2,741 | 1.67 |
| HippoRAG 2 | 57.60 | 14.73 | 2.15 | 15.30 | 7.36 | 13.83 | 83.86 | 8,530 | 4.51 |
| RAPTOR | 32.20 | 12.08 | 1.90 | 12.73 | 5.82 | 11.25 | 83.50 | 6,254 | 2.25 |
| A-Mem | 55.60 | 13.73 | 2.11 | 14.82 | 6.81 | 12.98 | 83.88 | 9,018 | 2.59 |
| MemGAS (Ours) | 60.20 | 20.38 | 4.22 | 21.05 | 10.47 | 19.47 | 85.21 | 8,829 | 2.55 |
| LongMemEval-m | |||||||||
| Full History | 12.20 | 5.70 | 0.78 | 6.27 | 2.08 | 5.28 | 81.62 | 128,000 | 12.88 |
| MPNet | 37.80 | 10.76 | 1.70 | 11.46 | 4.76 | 10.03 | 83.09 | 8,352 | 1.83 |
| Contriever | 42.80 | 11.88 | 1.66 | 12.56 | 5.63 | 11.02 | 83.28 | 8,467 | 1.92 |
| MPC | 37.80 | 11.28 | 1.37 | 11.93 | 5.12 | 10.57 | 82.98 | 8,428 | 2.75 |
| RecurSum | 23.80 | 10.04 | 1.70 | 10.89 | 4.26 | 9.21 | 83.12 | 8,927 | 1.99 |
| SeCom | 42.80 | 11.33 | 1.79 | 12.03 | 5.07 | 10.49 | 83.36 | 2,821 | 1.63 |
| MemGAS (Ours) | 45.40 | 16.85 | 3.39 | 17.60 | 8.25 | 16.14 | 84.69 | 8,852 | 2.45 |
| LoCoMo | |||||||||
| Full History | 33.43 | 12.23 | 1.84 | 12.70 | 5.66 | 11.73 | 84.07 | 20,078 | 4.92 |
| MPNet | 38.07 | 14.44 | 2.35 | 14.90 | 6.83 | 13.90 | 84.42 | 2,472 | 1.29 |
| Contriever | 40.33 | 15.66 | 2.67 | 16.01 | 7.68 | 15.00 | 84.65 | 2,348 | 1.24 |
| MPC | 40.38 | 14.81 | 1.99 | 15.10 | 6.83 | 14.13 | 84.43 | 2,683 | 1.95 |
| RecurSum | 22.56 | 9.14 | 0.99 | 9.82 | 3.38 | 8.98 | 83.45 | 3,074 | 1.58 |
| SeCom | 44.21 | 13.79 | 2.30 | 14.28 | 6.17 | 13.30 | 84.04 | 1,021 | 1.02 |
| HippoRAG 2 | 45.62 | 16.66 | 2.91 | 17.01 | 8.27 | 15.93 | 84.88 | 2,991 | 3.56 |
| RAPTOR | 31.72 | 14.55 | 2.88 | 15.09 | 7.49 | 14.18 | 84.48 | 1,931 | 1.73 |
| A-Mem | 40.81 | 14.72 | 2.83 | 16.22 | 7.71 | 14.89 | 84.72 | 3,042 | 1.98 |
| MemGAS (Ours) | 41.07 | 17.66 | 3.61 | 18.00 | 8.93 | 16.99 | 85.13 | 2,825 | 1.88 |
| LongMTBench+ | |||||||||
| Full History | 67.44 | 36.07 | 11.32 | 37.90 | 20.51 | 29.25 | 87.81 | 19,194 | 4.72 |
| MPNet | 63.89 | 36.09 | 11.26 | 38.39 | 20.58 | 28.86 | 87.84 | 12,143 | 3.21 |
| Contriever | 63.54 | 36.30 | 11.59 | 38.17 | 21.65 | 29.67 | 87.90 | 11,941 | 3.27 |
| MPC | 61.81 | 31.52 | 7.97 | 33.56 | 17.27 | 25.20 | 86.51 | 12,289 | 3.98 |
| RecurSum | 24.65 | 26.58 | 6.91 | 29.23 | 11.93 | 20.90 | 86.11 | 13,527 | 3.41 |
| SeCom | 64.58 | 36.68 | 12.01 | 38.81 | 21.44 | 29.65 | 87.88 | 4,714 | 2.68 |
| HippoRAG 2 | 63.54 | 35.64 | 11.05 | 37.61 | 20.37 | 28.76 | 87.70 | 13,583 | 6.14 |
| RAPTOR | 59.72 | 37.69 | 13.47 | 40.08 | 21.68 | 30.88 | 88.38 | 10,631 | 3.47 |
| A-Mem | 65.73 | 36.82 | 11.36 | 38.92 | 20.88 | 29.14 | 87.92 | 13,735 | 3.95 |
| MemGAS (Ours) | 69.44 | 41.49 | 15.62 | 43.69 | 24.45 | 34.66 | 88.96 | 12,873 | 3.85 |
Implementation Details. We use gpt-4o-mini-2024-07-18 as the backbone for all tasks, including multi-granularity information generation and QA. To ensure fairness, all baselines share consistent generation prompts. The temperature of LLMs is set to 0 for reproducibility, and all models operate in a zero-shot setting with prompt templates detailed in Appendix.
实现细节。 我们使用 gpt-4o-mini-2024-07-18 作为所有任务的骨干模型,包括多粒度信息生成与问答。 为确保公平,所有基线共享一致的生成提示。 LLM 的温度设置为 0 以保证可复现性,所有模型都在零样本设置下运行,提示模板详见附录。
A consistent top-3 session retrieval setting is applied across all models for fair comparison, with top-3 segments used for SeCom and sessions/summaries for RAPTOR. Contriever is used as the encoding model to generate embeddings for memory texts. LongMTBench+ is excluded due to the lack of a ground-truth of retrieval. RAPTOR and A-Mem retrieval cannot be evaluated as their retrieved information cannot be judged. Results for RAPTOR, A-Mem, and HippoRAG on LongMemEval-m are unavailable due to high runtime.
为公平比较,所有模型都采用一致的 top-3 会话检索设置;SeCom 使用 top-3 片段,RAPTOR 使用会话或摘要。 我们使用 Contriever 作为编码模型,为记忆文本生成嵌入。 由于缺少检索真值,LongMTBench+ 不纳入检索评估。 RAPTOR 和 A-Mem 的检索结果无法评估,因为无法判断其检索信息。 由于运行时间过长,LongMemEval-m 上没有 RAPTOR、A-Mem 和 HippoRAG 的结果。
We compared various methods across different retrievers, generators, and query types, as detailed in Appendix. Additionally, we provide a hyperparameter analysis in Appendix and an error analysis in Appendix. The additional cost and efficiency of the methods are discussed in Appendix.
我们还比较了不同检索器、生成器和查询类型下的多种方法,详见附录。 此外,附录中还提供了超参数分析和错误分析。 方法的额外成本与效率也在附录中讨论。
3.2 Overall Results
We present the results for Question Answering and Retrieval in Table 1 and Table 2, respectively. We also compare performence of single-granularity and multi-granularity in Appendix. Below, we provide analysis of these results.
我们分别在表1和表2中给出问答与检索结果。 我们还在附录中比较了单粒度与多粒度的性能。 下面对这些结果进行分析。
Question Answering Results. As presented in Table 1, MemGAS consistently outperforms other methods across most datasets and evaluation metrics. Unlike Full History, which introduces noise by utilizing all historical context, MemGAS excels by effectively consolidating and retrieving only the most relevant memories. Other baselines, such as RecurSum and SeCom, although operating at specific granularities, lack the capability to integrate multi-granular associations between memory, resulting in suboptimal outcomes. Besides, methods like HippoRAG 2 and RAPTOR, while establishing connections between memory units, fail to construct multi-granular relationships and selection mechanisms effectively, limiting their performance.
问答结果。 如表1所示,MemGAS 在大多数数据集和评估指标上始终优于其他方法。 Full History 使用全部历史上下文,因而会引入噪声;与之不同,MemGAS 能够有效巩固并只检索最相关的记忆,因此表现更好。 RecurSum 和 SeCom 等其他基线虽然在特定粒度上运行,却缺乏整合记忆间多粒度关联的能力,因而结果次优。 此外,HippoRAG 2 和 RAPTOR 等方法虽然在记忆单元之间建立连接,但无法有效构建多粒度关系与选择机制,从而限制了其性能。
MemGAS performs better through its dynamic construction and adaptive router of multi-granular memory units and redundancy filtering, emphasizing the critical role of association and selection in memory management. Notably, these gains come with competitive efficiency: we keep average tokens and latency close to lightweight retrievers and below HippoRAG2 and A-Mem, achieving substantial improvements without incurring significant token or time overhead.
MemGAS 借助多粒度记忆单元的动态构建、自适应路由器和冗余过滤取得更好表现,突出了关联与选择在记忆管理中的关键作用。 值得注意的是,这些增益同时保持了有竞争力的效率:平均 token 数和延迟接近轻量级检索器,并低于 HippoRAG2 和 A-Mem,在不引入显著 token 或时间开销的情况下实现了大幅提升。
Retrieval Results. As shown in Table 2, our MemGAS demonstrates outstanding performance across all datasets, consistently achieving the highest Recall and NDCG metrics. These results highlight the effectiveness and robustness of our approach, addressing key challenges in long-term memory construction and retrieval, and ensuring that queries are matched with the most relevant context.
检索结果。 如表2所示,我们的 MemGAS 在所有数据集上均表现出色,Recall 和 NDCG 指标始终最高。 这些结果凸显了我们方法的有效性与鲁棒性:它解决了长期记忆构建与检索中的关键挑战,并确保查询与最相关的上下文匹配。
| Model | Recall@3 | NDCG@3 | Recall@5 | NDCG@5 | Recall@10 | NDCG@10 |
|---|---|---|---|---|---|---|
| LongMemEval-s | ||||||
| MPNet | 66.17 | 75.47 | 76.38 | 78.29 | 85.11 | 80.63 |
| Contriever | 71.06 | 79.72 | 81.28 | 82.47 | 90.00 | 84.29 |
| RecurSum | 67.23 | 78.33 | 79.79 | 81.76 | 87.66 | 83.28 |
| MPC | 60.00 | 70.90 | 68.09 | 73.27 | 80.00 | 76.59 |
| SeCom | 71.06 | 80.88 | 80.43 | 83.08 | 89.15 | 85.11 |
| HippoRAG 2 | 75.53 | 85.44 | 84.68 | 87.32 | 91.28 | 88.73 |
| MemGAS (Ours) | 78.51 | 86.83 | 88.94 | 88.77 | 94.47 | 89.96 |
| LongMemEval-m | ||||||
| MPNet | 37.02 | 48.68 | 45.74 | 52.51 | 61.28 | 56.55 |
| Contriever | 44.26 | 56.11 | 53.40 | 59.44 | 65.96 | 62.74 |
| RecurSum | 23.19 | 32.10 | 31.70 | 36.99 | 43.62 | 41.40 |
| MPC | 35.96 | 47.51 | 42.55 | 50.36 | 54.26 | 53.88 |
| SeCom | 44.26 | 56.61 | 55.32 | 60.76 | 66.60 | 63.78 |
| MemGAS (Ours) | 51.06 | 61.36 | 63.62 | 66.07 | 77.02 | 69.46 |
| LoCoMo | ||||||
| MPNet | 45.92 | 47.71 | 53.98 | 51.79 | 68.58 | 56.88 |
| Contriever | 49.90 | 52.15 | 58.26 | 56.29 | 71.80 | 60.92 |
| RecurSum | 47.23 | 48.99 | 59.01 | 54.58 | 74.97 | 60.07 |
| MPC | 49.50 | 51.47 | 57.45 | 55.53 | 71.85 | 60.47 |
| SeCom | 55.24 | 57.90 | 64.80 | 62.36 | 78.30 | 66.97 |
| HippoRAG 2 | 56.60 | 58.37 | 65.06 | 62.50 | 78.05 | 66.79 |
| MemGAS (Ours) | 57.30 | 58.76 | 67.32 | 63.62 | 81.82 | 68.42 |
3.3 Ablation Study
The ablation study in Table 3 demonstrates the significance of each component in enhancing both QA and retrieval performance. Individually removing GMM, PPR, MA, or the Router results in consistent performance degradation, validating their essential contributions. Notably, the combined absence of all components leads to the most significant drop, with the F1 score plummeting from 20.38 to 13.78, and Recall@3 decreasing from 78.51 to 71.06. This highlights the importance of all modules in improving overall performance.
表3中的消融研究表明,每个组件对于增强问答与检索性能都很重要。 单独移除 GMM、PPR、MA 或路由器都会导致性能持续下降,验证了它们各自不可或缺的贡献。 值得注意的是,同时移除所有组件会造成最大幅度的下降:F1 分数从 20.38 骤降至 13.78,Recall@3 从 78.51 降至 71.06。 这凸显了所有模块对提升整体性能的重要性。
Moreover, the latency introduced by these modules is minimal, with the highest latency increase being only 0.0191 seconds for QA and 0.0079 seconds for retrieval. This demonstrates that the proposed architecture achieves a remarkable balance between enhanced performance and computational efficiency.
此外,这些模块引入的延迟极小,问答和检索的最大延迟增量分别只有 0.0191 秒和 0.0079 秒。 这表明所提出的架构在性能提升与计算效率之间取得了出色平衡。
| Method | QA Performance | Retrieval Performance | |||||||
|---|---|---|---|---|---|---|---|---|---|
| GPT4o-J | F1 | RogueL | Avg. Tokens | Total Latency (s) | R@3 | R@5 | R@10 | Retrieval Latency (s) | |
| MemGAS | 60.20 | 20.38 | 19.47 | 8,829 | 2.5534 | 78.51 | 88.94 | 94.47 | 0.0239 |
| w/o GMM | 57.20 | 19.49 | 18.68 | 8,820 | 2.5506 (Δ0.0028) | 76.38 | 85.53 | 91.28 | 0.0232 (Δ0.0007) |
| w/o PPR | 56.60 | 19.76 | 18.85 | 8,772 | 2.5449 (Δ0.0085) | 75.96 | 85.96 | 90.64 | 0.0194 (Δ0.0045) |
| w/o MA | 56.80 | 17.69 | 19.00 | 8,734 | 2.5418 (Δ0.0116) | 74.89 | 85.74 | 91.49 | 0.0182 (Δ0.0057) |
| w/o Router | 56.60 | 18.88 | 18.62 | 8,763 | 2.5471 (Δ0.0063) | 75.53 | 85.74 | 92.34 | 0.0216 (Δ0.0023) |
| w/o All | 55.40 | 13.78 | 12.89 | 8,701 | 2.5343 (Δ0.0191) | 71.06 | 81.28 | 90.00 | 0.0160 (Δ0.0079) |
3.4 Detailed Comparison Analysis
In this section, we present a comprehensive analysis comparing our approach with baselines across different query types and different Top-K retrieval settings.
本节全面分析我们的方法与基线在不同查询类型和不同 Top-K 检索设置下的表现。





Comparison on different query types. The results in Figure 3 highlight performance across different query types. Our MemGAS consistently demonstrates superior performance, particularly excelling in multi-hop retrieval on LoCoMo and multi-session on LongMemEval-s. This suggests that memory association mechanism in MemGAS effectively identifies highly relevant sessions, enabling enhanced multi-hop reasoning and better integration of knowledge. Additionally, our method performs well across single-session, temporal reasoning, and knowledge update, demonstrating its strength in addressing both simple and complex query types. We also provide a case study for different query types in Appendix, and comparison with other datasets and metrics in Appendix.
不同查询类型的比较。 图3展示了不同查询类型下的性能。 我们的 MemGAS 始终表现更优,尤其擅长 LoCoMo 上的 多跳检索 和 LongMemEval-s 上的 多会话 查询。 这表明 MemGAS 的记忆关联机制能够有效识别高度相关的会话,从而增强多跳推理并更好地整合知识。 此外,我们的方法在单会话、时间推理和知识更新方面也表现良好,展现了处理简单与复杂查询类型的能力。 附录还提供了不同查询类型的案例研究,以及在其他数据集和指标上的比较。
Comparison on different Top-K retrieval. The results shown in Figure 4 demonstrate the performance of various Top-K retrieval settings. On the LoCoMo and LongMemEval-s datasets, our model consistently surpasses baseline methods in F1 scores as Top-K increases from 1 to 10. This trend highlights that retrieving more relevant context significantly enhances accuracy. Note that on LongMemEval-s dataset, while F1 scores initially improve at lower Top-K values, performance declines at higher Top-K levels, suggesting that the longer context introduces noise, which negatively impacts the model's effectiveness.
不同 Top-K 检索的比较。 图4展示了不同 Top-K 检索设置下的性能。 在 LoCoMo 和 LongMemEval-s 数据集上,随着 Top-K 从 1 增至 10,我们模型的 F1 分数始终高于基线方法。 这一趋势表明,检索更多相关上下文能够显著提高准确性。 需要注意的是,在 LongMemEval-s 数据集上,F1 分数最初会在较低 Top-K 值下提高,但在较高 Top-K 值下反而下降,这说明更长的上下文会引入噪声,从而对模型效果产生负面影响。
4. Related Work
Retrieval Methods. Recent advancements in retrieval methods have greatly enhanced information retrieval performance. BM25, a classic sparse retrieval method, uses a probabilistic model to improve query relevance. In contrast, dense retrieval methods excel at capturing semantic similarity. For instance, DPR employs dual-encoder models to encode queries and documents into dense vectors for efficient similarity search. Similarly, Contriever leverages contrastive learning to enhance semantic understanding. Advanced methods like E5, BGE, and GTE further utilize pre-trained or fine-tuned transformers for robust and efficient semantic retrieval.
检索方法。 近期检索方法的进展显著提升了信息检索性能。 BM25 是一种经典稀疏检索方法,它使用概率模型提高查询相关性。 相比之下,稠密检索方法更擅长捕捉语义相似性。 例如,DPR 采用双编码器模型将查询与文档编码为稠密向量,以实现高效相似度搜索。 类似地,Contriever 利用对比学习增强语义理解。 E5、BGE 和 GTE 等先进方法进一步利用预训练或微调的 Transformer,实现稳健且高效的语义检索。
Long Term Memory Management. With the development of LLMs, the user-assistant conversation becomes longer and contains various topics, which introduces challenges for preserving the user's long-term memory. Management in long-term memory often involves segmentation, summary, compression, forgetting and updating. For example, several approaches focus on generating memory summaries as records to enable more accurate retrieval. Besides, some methods leverage compression techniques to reduce memory size while preserving essential information. The forgetting mechanisms address the need to remove obsolete or irrelevant memories while maintaining model performance.
长期记忆管理。 随着 LLM 的发展,用户与助手之间的对话变得更长并涵盖多种主题,这给保留用户的长期记忆带来了挑战。 长期记忆管理通常涉及切分、摘要、压缩、遗忘与更新。 例如,一些方法侧重生成记忆摘要作为记录,以实现更准确的检索。 此外,一些方法利用压缩技术,在保留关键信息的同时减小记忆规模。 遗忘机制则在保持模型性能的同时,满足移除过时或无关记忆的需求。
Some integrated methods combine memory retention, update to enable personalized and contextually relevant long-term dialogue. However, existing approaches typically focus on single-granularity segmentation strategies, such as session/turn, to organize and manage long-term memory. Whereas our work leverages multi-granular information for better adaptive memory selection.
一些集成方法结合记忆保留与更新,以实现个性化且与上下文相关的长期对话。 然而,现有方法通常侧重会话或轮次等单粒度切分策略,用于组织和管理长期记忆。 我们的工作则利用多粒度信息,实现更好的自适应记忆选择。
Structural Memory Management. Additionally, existing works employ structured paradigms for memory or knowledge base organization. HippoRAG builds entity-centric knowledge graphs inspired by hippocampal indexing theory, while Graph-CoT and G-Retriever integrate graph reasoning for interactive retrieval or generation, whereas LightRAG and GraphRAG optimize retrieval and summary via graph structures. MemTree and RAPTOR utilize recursive embedding, clustering, and summarization of text chunks to construct a hierarchical tree, while StructRAG enhances reasoning by leveraging multiple structured formats.
结构化记忆管理。 此外,现有工作采用结构化范式来组织记忆或知识库。 HippoRAG 受海马体索引理论启发,构建以实体为中心的知识图谱;Graph-CoT 和 G-Retriever 集成图推理以进行交互式检索或生成;LightRAG 和 GraphRAG 则通过图结构优化检索与摘要。 MemTree 和 RAPTOR 利用文本块的递归嵌入、聚类与摘要构建层次树,而 StructRAG 通过利用多种结构化格式增强推理。
While existing methods focus on single-granularity memory modeling, they lack cross-granularity interactions. In contrast, our MemGAS, which leverages multi-granularity association and adaptive selection to construct consolidated memory structures and optimize retrieval efficiency.
现有方法侧重单粒度记忆建模,因而缺乏跨粒度交互。 相比之下,我们的 MemGAS 利用多粒度关联和自适应选择来构建巩固的记忆结构,并优化检索效率。
5. Conclusion
In this paper, we proposed MemGAS, a novel framework for long-term memory construction and retrieval that integrates multi-granular memory units and enables adaptive selection and retrieval. By leveraging human-inspired memory mechanisms through Gaussian Mixture Models and an entropy-based multi-granularity router, MemGAS effectively addresses challenges of memory connection and selection. Experimental results across four benchmarks demonstrate that MemGAS significantly outperforms state-of-the-art baselines in both QA and retrieval tasks, highlighting its robustness and superiority in managing long-term memory for conversational agents.
在本文中,我们提出 MemGAS,这是一种用于长期记忆构建与检索的新框架,它集成多粒度记忆单元,并支持自适应选择和检索。 MemGAS 通过高斯混合模型和基于熵的多粒度路由器利用受人类启发的记忆机制,有效解决记忆连接与选择方面的挑战。 四个基准上的实验结果表明,MemGAS 在问答和检索任务上均显著优于最先进基线,突显了它在对话智能体长期记忆管理方面的鲁棒性与优越性。
Ethics Statement
This work adheres to ethical research practices by ensuring that all experiments and datasets used are publicly available and utilized in accordance with their licenses. The proposed MemGAS framework is designed to enhance conversational agents responsibly, with a focus on improving user experience while minimizing the risk of harm, such as generating misinformation. No sensitive or proprietary data was used during the research process, and the methodology prioritizes transparency and accountability in memory retrieval and usage.
本工作遵循合乎伦理的研究实践,确保所有使用的实验与数据集均公开可用,并按照其许可证使用。 所提出的 MemGAS 框架旨在以负责任的方式增强对话智能体,重点在改善用户体验的同时,尽量降低生成错误信息等伤害风险。 研究过程中未使用敏感或专有数据,方法在记忆检索与使用中优先考虑透明度和问责性。
Reproducibility Statement
We are committed to ensuring the reproducibility of our work. To this end, we have provided the code in an anonymous repository. The repository includes a well-documented README file with instructions to replicate our experiments. Additionally, we have detailed implementation specifics in this manuscript, and hyperparameter tuning is comprehensively described in Appendix. Furthermore, we have included the complete set of prompts required for the experiments, ensuring that all components of our methodology can be accurately reproduced. We encourage the community to leverage these resources to build upon our work.
我们致力于确保本工作的可复现性。 为此,我们已在匿名仓库中提供代码。 该仓库包含文档完善的 README 文件,其中给出了复现实验的说明。 此外,我们在本文中详细说明了实现细节,并在附录中全面描述了超参数调优过程。 我们还提供了实验所需的完整提示集合,确保方法的所有组成部分都能被准确复现。 我们鼓励社区利用这些资源,在本工作基础上继续研究。