Constructing memory from users' long-term conversations overcomes LLMs' contextual limitations and enables personalized interactions. Recent studies focus on hierarchical memory to model users' multi-granular behavioral patterns via clustering and aggregating historical conversations. However, conversational noise and memory hallucinations can be amplified during clustering, causing locally aggregated memories to misalign with the user's global persona. To mitigate this issue, we propose Bi-Mem, an agentic framework ensuring hierarchical memory fidelity through bidirectional construction. Specifically, we deploy an inductive agent to form the hierarchical memory: it extracts factual information from raw conversations to form fact-level memory, aggregates them into thematic scenes (i.e., local scene-level memory) using graph clustering, and infers users' profiles as global persona-level memory. Simultaneously, a reflective agent is designed to calibrate local scene-level memories using global constraints derived from the persona-level memory, thereby enforcing global-local alignment. For coherent memory recall, we propose an associative retrieval mechanism: beyond initial hierarchical search, a spreading activation process allows facts to evoke contextual scenes, while scene-level matches retrieve salient supporting factual information. Empirical evaluations demonstrate that Bi-Mem achieves significant improvements in question answering performance on long-term personalized conversational tasks.
翻译:从用户的长期对话中构建记忆能够克服大语言模型的上下文限制,并实现个性化交互。近期研究聚焦于通过聚类和聚合历史对话来建模用户多粒度行为模式的分层记忆。然而,在聚类过程中,对话噪声和记忆幻觉可能被放大,导致局部聚合的记忆与用户的全局人物角色失准。为缓解此问题,我们提出了 Bi-Mem,一个通过双向构建确保分层记忆保真度的智能体框架。具体而言,我们部署一个归纳智能体来形成分层记忆:它从原始对话中提取事实信息以形成事实级记忆,使用图聚类将其聚合为主题场景(即局部场景级记忆),并推断用户画像作为全局人物角色级记忆。同时,我们设计了一个反思智能体,利用从人物角色级记忆推导出的全局约束来校准局部场景级记忆,从而强制执行全局-局部对齐。为实现连贯的记忆检索,我们提出了一种关联检索机制:在初始分层搜索之外,一个扩散激活过程允许事实信息唤起上下文场景,而场景级匹配则检索显著的支持性事实信息。实证评估表明,Bi-Mem 在长期个性化对话任务上的问答性能取得了显著提升。