LiCoMemory: Lightweight and Cognitive Agentic Memory for Efficient Long-Term Reasoning
MemoryAgentKnowledge GraphACL 2026 Findings香港科技大学华为香港研究中心香港中文大学微众银行LiCoMemory:面向高效长期推理的轻量认知智能体记忆
Abstract
Large Language Model (LLM) agents exhibit remarkable conversational and reasoning capabilities but remain constrained by limited context windows and the lack of persistent memory. Recent efforts address these limitations via external memory architectures, often employing graph-based representations, yet most adopt flat, entangled structures that intertwine semantics with topology, leading to redundant representations, unstructured retrieval, and degraded efficiency and accuracy. To resolve these issues, we propose LiCoMemory, an end-to-end agentic memory framework for real-time updating and retrieval, which introduces CogniGraph, a lightweight hierarchical graph that utilizes entities and relations as semantic indexing layers, and employs temporal and hierarchy-aware search with integrated reranking for adaptive and coherent knowledge retrieval. Experiments on long-term dialogue benchmarks, LoCoMo and LongMemEval, show that LiCoMemory not only outperforms established baselines in temporal reasoning, multi-session consistency, and retrieval efficiency, but also notably reduces update latency.
大语言模型(LLM)智能体展现出卓越的对话与推理能力,但仍受限于有限的上下文窗口和持久记忆的缺失。 近期工作通过外部记忆架构来应对这些限制,通常采用基于图的表示;然而,大多数方法采用将语义与拓扑相互交织的扁平耦合结构,从而导致表示冗余、检索缺乏结构,以及效率和准确率下降。 为解决这些问题,我们提出 LiCoMemory,一个用于实时更新与检索的端到端智能体记忆框架;该框架引入 CogniGraph,这是一种将实体和关系用作语义索引层的轻量层次图,并采用时间与层次感知搜索以及集成重排序,实现自适应且连贯的知识检索。 在 LoCoMo 和 LongMemEval 长期对话基准上的实验表明,LiCoMemory 不仅在时间推理、多会话一致性和检索效率方面优于成熟基线,还显著降低了更新延迟。
1. Introduction

Large Language Models (LLMs) have demonstrated remarkable advancements across a wide range of language understanding and generation tasks and are increasingly evolving into personalized assistants with enhanced contextual reasoning capabilities. Despite their strong generalizing and reasoning abilities, LLMs remain constrained by a critical short-term memory limitation: the finite context window. Information beyond the context window cannot be effectively preserved or recalled, leading to degraded reasoning capability and reduced response accuracy in long-term conversational scenarios.
大语言模型(LLM)在广泛的语言理解与生成任务上取得了显著进展,并正日益演变为具有更强上下文推理能力的个性化助手。 尽管具备强大的泛化和推理能力,LLM 仍受到一个关键短期记忆限制:有限的上下文窗口。 超出上下文窗口的信息无法得到有效保留或回忆,导致长期对话场景中的推理能力下降和响应准确率降低。
To resolve these issues, early attempts to enhance the long-term memory of agents commonly adopt Retrieval-Augmented Generation (RAG) architectures, which leverage conversation history as an external knowledge source and retrieve contextually relevant information to support response generation. Graph-based RAG further extends this paradigm by structuring conversational content into relational graphs using heuristic rules, thereby capturing semantic dependencies among historical records and improving cross-session reasoning. Despite their effectiveness in retrieval, these approaches often treat memory as a static component, neglecting the inherently dynamic nature of human–agent interactions, and thus lacking mechanisms for reorganization of accumulated knowledge. Moreover, such predefined retrieval and linking strategies can lead to information loss and hinder adaptive memory evolution. Recent studies have thus shifted toward dynamic agent memory frameworks, which extend beyond traditional RAG by modeling the evolving nature of conversational data and adaptive retrieval. Mem0 initiates this shift by introducing explicit memory operations that allow agents to manage and revise stored knowledge as conversations evolve. Building on this, MIRIX enhances retrieval organization through multi-granularity memory indexing and relevance fusion, improving contextual alignment and reducing redundancy in long-term reasoning. Further, Zep represents memory as a graph to capture relational dependencies among dialogue events, promoting interpretability but at the cost of high graph-construction overhead and retrieval latency.
为解决这些问题,早期增强智能体长期记忆的尝试通常采用检索增强生成(RAG)架构,将对话历史用作外部知识源,并检索上下文相关信息以支持响应生成。 基于图的 RAG 进一步扩展了这一范式,它使用启发式规则将对话内容组织为关系图,从而捕获历史记录之间的语义依赖并改进跨会话推理。 尽管这些方法在检索方面有效,但它们通常将记忆视为静态组件,忽略人类与智能体交互固有的动态特性,因而缺少重组累积知识的机制。 此外,这类预定义的检索与链接策略可能导致信息损失,并阻碍记忆的自适应演化。 因此,近期研究转向动态智能体记忆框架,通过建模对话数据的演化特性和自适应检索来超越传统 RAG。 Mem0 通过引入显式记忆操作开启了这一转变,使智能体能够随着对话演进管理和修订已存储知识。 在此基础上,MIRIX 通过多粒度记忆索引和相关性融合增强检索组织,从而改善长期推理中的上下文对齐并减少冗余。 此外,Zep 将记忆表示为图,以捕获对话事件之间的关系依赖;这提高了可解释性,却以高昂的图构建开销和检索延迟为代价。
While these frameworks have made progress toward structured conversational memory, some key challenges still remain. (1) Coupled and redundant graph structures: Existing graph-based memory systems often intertwine semantic content with relational topology, leading to heavy, redundant, and inflexible graph representations that are difficult to adapt to dynamic human–agent interactions. (2) Scattered and unstructured retrieval: Owing to flat architectures and unguided retrieval mechanisms, conventional memory pipelines frequently return fragmented or contextually inconsistent information, which undermines reasoning coherence and produces semantically diluted responses. (3) Slow update and inference: Large, monolithic graph structures incur substantial computational overhead during incremental updates and inference, limiting their applicability in real-time interaction settings. For instance, GraphRAG requires up to 20 minutes for graph and community construction per dialogue and over 2 minutes of query latency.
尽管这些框架在结构化对话记忆方面取得了进展,但一些关键挑战仍然存在。 (1)耦合且冗余的图结构: 现有基于图的记忆系统经常将语义内容与关系拓扑相互交织,形成沉重、冗余且不灵活的图表示,难以适应动态的人类与智能体交互。 (2)分散且缺乏结构的检索: 由于架构扁平且检索机制缺乏引导,传统记忆流水线经常返回碎片化或上下文不一致的信息,从而削弱推理连贯性,并产生语义被稀释的响应。 (3)更新和推理缓慢: 大型单体图结构在增量更新和推理期间会产生大量计算开销,限制其在实时交互环境中的适用性。 例如,GraphRAG 为每段对话构建图和社区最多需要 20 分钟,查询延迟则超过 2 分钟。
To address these challenges, we propose LiCoMemory, an end-to-end agentic memory framework that enables real-time updating and retrieval. At its core, LiCoMemory introduces CogniGraph, a lightweight and semantically aware hierarchical graph that redefines the knowledge graph as a semantic indexing layer rather than a static repository. By using graph topology as a structural scaffold instead of embedding extensive content within nodes and edges, CogniGraph indexes and organizes knowledge while linking relational structures to their original textual sources for precise and context-aware reasoning. During inference, LiCoMemory integrates a unified reranking mechanism that jointly considers semantic similarity, hierarchical structure, and temporal relevance to achieve accurate and structured retrieval. Experimental results demonstrate that LiCoMemory achieves up to 23% improvement in accuracy over the second-best baseline on established long-term dialogue benchmarks (LoCoMo and LongMemEval), particularly on multi-session and temporal reasoning subsets, while significantly reducing input tokens and response latency, underscoring its efficiency.
为应对这些挑战,我们提出 LiCoMemory,一个支持实时更新与检索的端到端智能体记忆框架。 LiCoMemory 的核心是 CogniGraph,一种轻量且具备语义感知能力的层次图,它将知识图谱重新定义为语义索引层,而不是静态存储库。 CogniGraph 不在节点和边中嵌入大量内容,而是将图拓扑用作结构支架;它在索引和组织知识的同时,把关系结构链接到原始文本来源,以实现精确且具备上下文感知能力的推理。 在推理期间,LiCoMemory 集成了一种统一重排序机制,联合考虑语义相似度、层次结构和时间相关性,以实现准确且结构化的检索。 实验结果表明,在成熟的长期对话基准(LoCoMo 和 LongMemEval)上,LiCoMemory 的准确率相比次优基线最高提升 23%,尤其是在多会话和时间推理子集上;同时,它显著减少了输入 token 和响应延迟,体现出其效率。
Our main contributions are summarized as follows: (1) CogniGraph for semantic organization. We introduce a novel hierarchical graph structure that decouples knowledge storage from semantic organization, transforming the graph into a lightweight, update-friendly semantic index. (2) Hierarchy and temporally sensitive retrieval. LiCoMemory performs structured, top-down retrieval guided by hierarchical relations and temporal cues, ensuring coherent and contextually relevant knowledge selection. (3) Efficient and real-time memory operations. Our lightweight design enables incremental graph construction, fast updates, and low-latency inference during ongoing user--assistant interactions. Together, these components establish LiCoMemory as a unified, real-time memory system capable of retrieving higher-quality, more relevant knowledge and generating contextually grounded responses.
我们的主要贡献概括如下: (1)用于语义组织的 CogniGraph。 我们引入一种将知识存储与语义组织解耦的新型层次图结构,把图转变为轻量且易于更新的语义索引。 (2)层次与时间敏感检索。 LiCoMemory 在层次关系和时间线索引导下执行结构化的自顶向下检索,确保知识选择连贯且与上下文相关。 (3)高效实时的记忆操作。 我们的轻量设计支持增量图构建、快速更新,以及持续进行的用户与助手交互期间的低延迟推理。 这些组件共同将 LiCoMemory 构建为统一的实时记忆系统,能够检索质量更高、相关性更强的知识,并生成以上下文为依据的响应。
2. Related Work
2.1 Retrieval-Augmented Generation (RAG)
RAG has emerged as a foundational framework for augmenting LLMs with external memory. A typical RAG pipeline first splits prior interactions or knowledge as segments, then retrieves relevant segments during inference, and provides both the user query and retrieved content to the language model for grounded generation. Due to the highly entangled and semantically redundant nature of conversational data, conventional RAG often retrieves overlapping or loosely related content, resulting in fragmented context and limited reasoning continuity. To address these limitations, recent research has introduced Graph-based RAG to agent frameworks, where the historical interactions are pre-organized as a graph structure to improve retrieval and reasoning efficiency. Beyond flat graph representations, several frameworks further organize memory knowledge hierarchically, such as tree-based structures and community-aware architectures. These structured organizations capture cross-session dependencies, reduce redundancy, and enhance contextual coherence, paving the way for more structured and adaptive memory systems.
RAG 已成为利用外部记忆增强 LLM 的基础框架。 典型 RAG 流水线首先把先前交互或知识切分为片段,随后在推理期间检索相关片段,并同时向语言模型提供用户查询和检索内容,以生成有依据的响应。 由于对话数据高度耦合且存在语义冗余,传统 RAG 经常检索到重叠或仅有松散关联的内容,导致上下文碎片化且推理连续性有限。 为解决这些限制,近期研究将基于图的 RAG 引入智能体框架,预先把历史交互组织为图结构,以提高检索和推理效率。 除了扁平图表示,一些框架还以层次方式组织记忆知识,例如树状结构和具备社区感知能力的架构。 这些结构化组织能够捕获跨会话依赖、减少冗余并增强上下文连贯性,为更加结构化且自适应的记忆系统铺平道路。
2.2 Agent Memory Augmentation
While LLM-based agents demonstrate remarkable generative capabilities, they remain constrained by limited context windows and the absence of persistent memory, often resulting in inconsistent behavior across extended interactions. Agent memory augmentation therefore emerges as a promising direction to address this limitation, aiming to equip conversational agents with external memory systems that support long-term information retention, retrieval, and reasoning. LoCoMo introduce a RAG-style conversational framework capable of maintaining multi-session dialogue continuity through chunk-based retrieval and coherence-aware evaluation. A-MEM advances the concept of agentic memory beyond passive long-term storage by introducing a self-organizing, dynamically evolving memory architecture that autonomously constructs, links, and refines knowledge representations. LongMemEval further advances this line of research by proposing a dedicated long-term memory model and benchmark for evaluating temporal reasoning, knowledge updating, and cross-session consistency. Mem0 employs a scalable two-phase architecture (extraction and update) that dynamically stores and retrieves salient facts using a vector database, while also offering a graph-based variant that better supports long term memory maintenance and retrieval. More recently, Zep structures agent memory into knowledge graphs, improving retrieval relevance but suffering from high construction overhead and retrieval latency.
尽管基于 LLM 的智能体展现出卓越的生成能力,但它们仍受限于有限的上下文窗口和持久记忆的缺失,因而经常在长时间交互中表现出不一致行为。 因此,智能体记忆增强成为解决这一限制的一个有前景方向,其目标是为对话智能体配备支持长期信息保留、检索和推理的外部记忆系统。 LoCoMo 引入了一个 RAG 风格的对话框架,通过基于片段的检索和连贯性感知评估来维持多会话对话的连续性。 A-MEM 引入一种自组织、动态演化的记忆架构,可自主构建、链接和精炼知识表示,从而将智能体记忆的概念推进到被动长期存储之外。 LongMemEval 提出专门的长期记忆模型和基准,用于评估时间推理、知识更新和跨会话一致性,进一步推进了这一研究方向。 Mem0 采用可扩展的两阶段架构(抽取和更新),使用向量数据库动态存储和检索显著事实,同时还提供基于图的变体,以更好地支持长期记忆维护与检索。 最近,Zep 将智能体记忆组织为知识图谱,提高了检索相关性,但存在构建开销和检索延迟较高的问题。

3. Methodology
The overall workflow of LiCoMemory is shown in Figure 2. LiCoMemory initiates real-time updates and retrievals during user–assistant interactions. After each dialogue segment, the dialogue chunk with its timestamp and session ID is sent to LiCoMemory for processing, where knowledge is organized and continuously maintained through a lightweight CogniGraph optimized for incremental updates. The system either updates an existing session summary or creates a new one, extracts and deduplicates triples, and establishes cross-level links among session summaries, triples, and dialogue chunks via unique identifiers. At inference time, high-value entities are extracted from user queries in a temporally aware manner to guide top-down retrieval—from session summaries to triples and then to original chunks. Retrieved triples are re-ranked by unified session, triple, and time level relevance, and the resulting summaries, triples, and chunks are integrated into a standard prompt for augmented generation. Further workflow details are provided in the following subsections.
LiCoMemory 的整体工作流程如图2所示。 LiCoMemory 在用户与助手交互期间启动实时更新和检索。 每个对话片段结束后,带有时间戳和会话 ID 的对话块会被发送到 LiCoMemory 进行处理;系统通过为增量更新优化的轻量 CogniGraph 来组织并持续维护知识。 系统会更新现有会话摘要或创建新摘要,抽取三元组并进行去重,再通过唯一标识符在会话摘要、三元组和对话块之间建立跨层链接。 推理时,系统以时间感知方式从用户查询中抽取高价值实体,引导自顶向下的检索,即从会话摘要到三元组,再到原始对话块。 检索到的三元组会依据统一的会话级、三元组级和时间级相关性进行重排序,所得摘要、三元组和对话块则被整合进标准提示,以进行增强生成。 以下各小节提供了更多工作流程细节。
3.1 CogniGraph: A Lightweight and Semantically-Aware Graph Structure
Traditional graph-based memory representations often embed extensive semantic content directly within nodes and edges, resulting in entangled representations where structural topology and information content are inseparable. Such designs produce heavy and redundant graphs that hinder efficient updating, leading to unstructured retrieval outputs. To address this, we introduce CogniGraph, a lightweight and semantically aware hierarchical graph structure that redefines the role of a knowledge graph from a knowledge repository to a semantic indexing layer. Rather than functioning as a storage container for knowledge, CogniGraph employs its graph topology as a structural scaffold that organizes and indexes information across multiple granularities, thereby facilitating efficient retrieval and reasoning.
传统的基于图的记忆表示经常直接在节点和边中嵌入大量语义内容,形成结构拓扑与信息内容不可分离的耦合表示。 这类设计会产生沉重且冗余的图,妨碍高效更新,并导致缺乏结构的检索输出。 为解决这一问题,我们引入 CogniGraph,这是一种轻量且具备语义感知能力的层次图结构,它把知识图谱的角色从知识存储库重新定义为语义索引层。 CogniGraph 不作为知识存储容器,而是将图拓扑用作结构支架,在多个粒度上组织和索引信息,从而促进高效检索与推理。
CogniGraph is composed of three interconnected layers that progressively refine the granularity of information (See Preliminay in Figure 2). 1) Session level: Each session node stores a textual summary that captures the high-level context of a user--assistant interaction. The summary also contains a set of distilled keywords (keys) that represent the central entities, topics, or temporal markers of the dialogue session. 2) Entity-relation level: This layer constitutes a lightweight knowledge graph composed of entities and relations extracted from dialogue content. Each entity node and relation edge retains only essential identifiers without verbose descriptions. Entity-relation triples are hyperlinked to their corresponding session summaries, establishing connections between fine-grained semantic relations and their contextual origins. 3) Chunk level: The lowest layer of CogniGraph stores the original dialogue chunks from which the triples were extracted. Each chunk is also hyperlinked to the triples derived from it, ensuring bidirectional traceability between raw text and structured knowledge. From top to bottom, the information granularity increases while structural abstraction decreases, forming a coherent hierarchy that aligns semantics, context, and evidence.
CogniGraph 由三个相互连接的层组成,它们逐步细化信息粒度(见图2中的预备部分)。 1)会话层: 每个会话节点存储一段文本摘要,用于捕获用户与助手交互的高层上下文。 摘要还包含一组精炼后的关键词(keys),表示对话会话中的核心实体、主题或时间标记。 2)实体-关系层: 该层构成一个轻量知识图谱,由从对话内容中抽取的实体和关系组成。 每个实体节点和关系边仅保留必要标识符,而不包含冗长描述。 实体-关系三元组会被超链接到对应的会话摘要,从而在细粒度语义关系与其上下文来源之间建立连接。 3)对话块层: CogniGraph 的最底层存储三元组所来源的原始对话块。 每个对话块也会被超链接到从中得到的三元组,确保原始文本与结构化知识之间具备双向可追溯性。 从上到下,信息粒度增加而结构抽象程度降低,形成一个对齐语义、上下文与证据的连贯层次结构。
This hierarchical and indexing-oriented design enables CogniGraph to remain compact, easily updatable, and less redundant, while the hyperlink-based cross-layer connections ensure structured and interpretable retrieval. By organizing knowledge as a navigable semantic index rather than an overloaded repository, CogniGraph supports multi-granular reasoning, from abstract contextual understanding to fine-grained evidence retrieval, serving as the structural foundation of LiCoMemory's retrieval module and enabling efficient, semantically grounded knowledge access for long-term conversational reasoning.
这种面向层次与索引的设计使 CogniGraph 保持紧凑、易于更新且冗余更少,同时基于超链接的跨层连接确保检索具备结构且可解释。 CogniGraph 将知识组织为可导航的语义索引,而不是负载过重的存储库,因此能够支持从抽象上下文理解到细粒度证据检索的多粒度推理;它既作为 LiCoMemory 检索模块的结构基础,也为长期对话推理提供高效且以语义为依据的知识访问。
3.2 Query Processing and Integrated Rerank
To enable accurate and context-aware retrieval, LiCoMemory adopts a query processing pipeline that combines hierarchical analysis with an integrated temporally aware re-ranking mechanism (Phase 1 and 2 of Figure 2). A user query is first analyzed through entity extraction to identify salient concepts that represent the key information needs of the user. The extracted entities are then matched against the summary level of the CogniGraph. By comparing the overlap and semantic similarity between the query entities and session summary keys, LiCoMemory ranks all session summaries based on their likelihood of containing relevant information. This process yields a prioritized set of session summaries that serve as entry points for deeper retrieval within the knowledge graph. LiCoMemory then queries the entity-relation level of CogniGraph using the extracted entities as anchors to locate triples that may contain relevant contextual information. Each retrieved triple is associated with its originating session and timestamp, providing both semantic and temporal context. To compute the overall relevance of a triple, LiCoMemory integrates three complementary factors to maintain hierarchy and temporal sensitivity: session-level relevance
为实现准确且具备上下文感知能力的检索,LiCoMemory 采用一种查询处理流水线,将层次分析与集成的时间感知重排序机制相结合(图2的阶段 1 和阶段 2)。 首先通过实体抽取分析用户查询,以识别代表用户关键信息需求的显著概念。 随后,将抽取的实体与 CogniGraph 的摘要层进行匹配。 通过比较查询实体与会话摘要关键词之间的重叠和语义相似度,LiCoMemory 根据每个会话摘要包含相关信息的可能性对所有摘要进行排序。 该过程生成一组按优先级排序的会话摘要,作为在知识图谱中进行更深层检索的入口。 然后,LiCoMemory 使用抽取的实体作为锚点查询 CogniGraph 的实体-关系层,以定位可能包含相关上下文信息的三元组。 每个检索到的三元组都与其来源会话和时间戳相关联,同时提供语义与时间上下文。 为了计算三元组的整体相关性,LiCoMemory 集成三个互补因素来维持层次与时间敏感性:会话级相关性
To incorporate temporal information without overwhelming semantic relevance, we apply a Weibull-based decay function that penalizes outdated triples while retaining a long-tailed contribution for distant timestamps:
为了在不压制语义相关性的情况下纳入时间信息,我们采用一种基于 Weibull 的衰减函数,它惩罚过时三元组,同时为较远时间戳保留长尾贡献:
Here,
其中,
3.3 Real-Time Interactions

LiCoMemory supports real-time retrievals and updates throughout user-assistant interactions, which consists of two tightly coupled processes. First, the agent retrieves relevant knowledge from the existing memory graph and generates a contextually grounded response to the user query. Then, LiCoMemory performs real-time memory updates based on both the current interaction and its preceding conversational history, ensuring that the newly acquired information is seamlessly integrated into the hierarchical structure (Phase 3 of Figure 2).
LiCoMemory 在用户与助手交互的整个过程中支持实时检索和更新,其中包含两个紧密耦合的过程。 首先,智能体从现有记忆图中检索相关知识,并针对用户查询生成以上下文为依据的响应。 随后,LiCoMemory 同时依据当前交互及其之前的对话历史执行实时记忆更新,确保新获得的信息被无缝整合到层次结构中(图2的阶段 3)。
Figure 3 illustrates a practical example demonstrating how LiCoMemory performs real-time retrieval and memory update during user--assistant interactions. As introduced in Section 3.2, the user query is first parsed into structured entities (e.g., Social Media Platform, Followers, Time Period), which guide hierarchical retrieval over the CogniGraph. Relevant sessions and triples are then ranked and linked back to their source dialogue chunks, providing grounded evidence for response generation. Upon the completion of this interaction, the corresponding dialogue chunk, along with its timestamp and session ID, is transmitted to LiCoMemory for incremental update processing. The system first updates the session summary with newly acquired information. For ongoing sessions, it refines associated keywords and themes to maintain temporal coherence, while for new sessions, it creates a new summary description and its keyword set to represent the contextual core of the dialogue. Following session-level processing, the system performs triple extraction to transform the current interaction into structured knowledge units. The extracted triples are then integrated into the existing entity–relation graph and hyperlinked to their source sessions. To ensure consistency and eliminate redundancy, we employ type-aware and semantic similarity matching to detect duplicate triples. For duplicates, the system links their corresponding sources as additional hyperlinks to the existing nodes instead of creating new ones, thereby maintaining a compact and coherent graph structure. Because updates and retrieval share the same CogniGraph backbone, newly added information becomes immediately available for inference without requiring a full re-indexing process. Through continuous interaction and memory refinement, the system incrementally maintain a dynamic and temporally consistent representation of user knowledge, ensuring that each response remains contextually coherent and temporally up to date.
图3展示了一个实际示例,说明 LiCoMemory 如何在用户与助手交互期间执行实时检索和记忆更新。 如第3.2节所述,用户查询首先被解析为结构化实体(例如社交媒体平台、关注者、时间段),这些实体引导 CogniGraph 上的层次检索。 随后,相关会话和三元组会被排序并链接回其来源对话块,为响应生成提供有依据的证据。 本次交互完成后,对应的对话块连同其时间戳和会话 ID 会被传输到 LiCoMemory,以进行增量更新处理。 系统首先使用新获得的信息更新会话摘要。 对于持续进行的会话,系统会精炼相关关键词和主题以维持时间连贯性;对于新会话,系统则创建新的摘要描述及其关键词集合,以表示对话的上下文核心。 会话级处理之后,系统执行三元组抽取,把当前交互转换为结构化知识单元。 随后,将抽取的三元组整合到现有实体-关系图中,并以超链接连接到其来源会话。 为了确保一致性并消除冗余,我们采用类型感知和语义相似度匹配来检测重复三元组。 对于重复项,系统不创建新节点,而是将其对应来源作为额外超链接连接到现有节点,从而维持紧凑且连贯的图结构。 由于更新和检索共享同一个 CogniGraph 主干,新添加的信息无需完整重建索引即可立即用于推理。 通过持续交互和记忆精炼,系统逐步维护动态且时间一致的用户知识表示,确保每个响应在上下文上保持连贯,并在时间上保持最新。
4. Experiments
In this section we evaluate LiCoMemory on real-world datasets to assess its performance. In particular, we aim to answer the following research questions: Q1: How effective is LiCoMemory compared with existing memory paradigms? Q2: How does LiCoMemory perform in real-time practical scenarios? Q3: How does the components of our system affect the final result?
在本节中,我们在真实世界数据集上评估 LiCoMemory,以考察其性能。 具体而言,我们旨在回答以下研究问题:Q1: 与现有记忆范式相比,LiCoMemory 的有效性如何?Q2: LiCoMemory 在实时实际场景中的表现如何?Q3: 我们系统中的各组件如何影响最终结果?
| Model | Method | LongmemEval | LoCoMo | ||||||
|---|---|---|---|---|---|---|---|---|---|
| TR | KR | Acc. | Rec. | TR | KR | Acc. | Rec. | ||
| Llama-3.1-70B- Instruct-Turbo | LoCoMo | 4.51 ± 1.08s | 3.5 ± 0.2k | 17.60 ± 1.05% | 22.04 ± 1.12% | 4.90 ± 1.42s | 3.2 ± 0.2k | 23.63 ± 1.08% | 25.50 ± 1.15% |
| Memorybank | 8.25 ± 1.87s | 4.1 ± 0.2k | 36.40 ± 0.96% | 39.21 ± 1.01% | 7.13 ± 1.56s | 4.4 ± 0.2k | 28.80 ± 0.93% | 31.52 ± 0.97% | |
| MemOS | 3.15 ± 0.83s | 2.6 ± 0.2k | 47.80 ± 0.82% | 49.03 ± 0.85% | 3.20 ± 0.96s | 2.2 ± 0.2k | 54.10 ± 0.79% | 57.53 ± 0.81% | |
| Mem0 | 1.87 ± 0.58s | 2.3 ± 0.1k | 56.80 ± 0.71% | 61.21 ± 0.68% | 1.55 ± 0.63s | 2.1 ± 0.1k | 53.22 ± 0.74% | 57.05 ± 0.70% | |
| Mem0g | 2.51 ± 0.92s | 2.8 ± 0.2k | 55.40 ± 0.76% | 63.09 ± 0.65% | 2.11 ± 0.81s | 2.4 ± 0.2k | 55.48 ± 0.72% | 59.32 ± 0.69% | |
| A-Mem | 4.31 ± 1.26s | 4.5 ± 0.2k | 57.40 ± 0.88% | 62.18 ± 0.84% | 4.10 ± 1.68s | 4.2 ± 0.2k | 43.84 ± 0.91% | 49.17 ± 0.89% | |
| Zep | 5.22 ± 1.73s | 4.1 ± 0.2k | 60.20 ± 0.81% | 62.74 ± 0.79% | 5.31 ± 1.94s | 3.8 ± 0.2k | 40.30 ± 0.94% | 51.05 ± 0.92% | |
| LiCoMemory | 1.62 ± 0.47s | 1.6 ± 0.1k | 69.20 ± 0.62% | 72.39 ± 0.58% | 1.55 ± 0.59s | 1.3 ± 0.1k | 62.99 ± 0.71% | 64.51 ± 0.69% | |
| GPT-4o-mini | LoCoMo | 5.34 ± 1.20s | 3.5 ± 0.2k | 16.60 ± 1.02% | 21.56 ± 1.09% | 4.72 ± 1.10s | 3.3 ± 0.2k | 23.87 ± 1.06% | 24.91 ± 1.10% |
| Memorybank | 7.93 ± 1.80s | 4.1 ± 0.2k | 35.40 ± 0.95% | 38.06 ± 0.98% | 7.62 ± 1.70s | 4.5 ± 0.2k | 31.50 ± 0.92% | 33.19 ± 0.96% | |
| MemOS | 3.72 ± 0.95s | 2.5 ± 0.2k | 51.20 ± 0.78% | 52.07 ± 0.81% | 3.96 ± 1.00s | 2.2 ± 0.1k | 58.30 ± 0.75% | 62.93 ± 0.77% | |
| Mem0 | 1.89 ± 0.65s | 2.3 ± 0.1k | 62.60 ± 0.70% | 71.32 ± 0.66% | 1.75 ± 0.60s | 2.3 ± 0.2k | 54.68 ± 0.73% | 62.31 ± 0.71% | |
| Mem0g | 2.41 ± 0.85s | 2.9 ± 0.2k | 64.80 ± 0.69% | 69.53 ± 0.67% | 2.34 ± 0.80s | 2.5 ± 0.2k | 56.96 ± 0.71% | 63.14 ± 0.68% | |
| A-Mem | 4.52 ± 1.40s | 4.3 ± 0.2k | 55.00 ± 0.86% | 59.30 ± 0.84% | 4.63 ± 1.50s | 4.1 ± 0.2k | 48.59 ± 0.88% | 53.82 ± 0.86% | |
| Zep | 6.12 ± 1.60s | 4.2 ± 0.2k | 58.60 ± 0.83% | 61.02 ± 0.80% | 5.92 ± 1.50s | 3.7 ± 0.2k | 44.76 ± 0.91% | 46.51 ± 0.93% | |
| LiCoMemory | 1.74 ± 0.55s | 1.7 ± 0.1k | 73.80 ± 0.60% | 76.63 ± 0.57% | 1.61 ± 0.50s | 1.2 ± 0.1k | 67.20 ± 0.69% | 68.09 ± 0.67% | |
4.1 Experimental Setup
Dataset. The performance of LiCoMemory was evaluated on two public long-term memory benchmarks: LongMemEval and LoCoMo. LongMemEval is a comprehensive benchmark for evaluating long-term memory in conversational agents, consists of 500 questions across six types: single-session user (S.S.U.), single-session assistant (S.S.A.), single-session preference (S.S.P.), multi-session, temporal reasoning, and knowledge update. LoCoMo focuses on extremely long multi-session dialogues, containing 1,986 questions in five distinct categories: single-hop, multi-hop, temporal, open-domain and adversial reasoning. Detailed statistics can be found in the appendix.
数据集。 我们在两个公开长期记忆基准 LongMemEval 和 LoCoMo 上评估 LiCoMemory 的性能。 LongMemEval 是评估对话智能体长期记忆的综合基准,包含六种类型的 500 个问题:单会话用户(S.S.U.)、单会话助手(S.S.A.)、单会话偏好(S.S.P.)、多会话、时间推理和知识更新。 LoCoMo 聚焦于极长的多会话对话,包含五个不同类别的 1,986 个问题:单跳、多跳、时间、开放域和对抗推理。 详细统计信息见附录。
Metrics. We evaluate different methods from two perspectives: response quality and efficiency. Following prior work, response quality is measured using Accuracy (Acc.) and Recall (Rec.), with the evaluation prompts detailed in the appendix. Accuracy is assessed using the LLM-as-a-Judge protocol from LongMemEval, in which a large language model performs binary judgments of answer correctness. As partial credit is not permitted, this metric provides a more faithful, human-aligned estimate of retrieval quality. For the Adversarial subset of the LoCoMo dataset, where ground-truth answers are unavailable, all responses are labeled as “Context insufficient to answer.” Recall is defined as the proportion of ground-truth targets retrieved within the top-15 items. Efficiency is evaluated in terms of token consumption and query latency, corresponding to the total number of tokens used by the LLM during query processing and the time required to generate a complete response.
指标。 我们从响应质量和效率两个角度评估不同方法。 遵循先前工作,我们使用准确率(Acc.)和召回率(Rec.)衡量响应质量,评估提示详见附录。 准确率采用 LongMemEval 的 LLM-as-a-Judge 协议进行评估,其中大语言模型对答案正确性作二元判断。 由于不允许部分得分,该指标能够更忠实地给出与人类判断一致的检索质量估计。 对于 LoCoMo 数据集的对抗子集,由于无法获得真实答案,所有响应均被标记为“上下文不足,无法回答”。 召回率定义为在前 15 个条目中检索到的真实目标比例。 效率依据 token 消耗和查询延迟进行评估,分别对应 LLM 在查询处理期间使用的 token 总数,以及生成完整响应所需的时间。
Baselines. We compare LiCoMemory with several well-established baselines, including LoCoMo, Zep, Mem0 (Mem0g), A-Mem, Memorybank, and MemOS. Detailed introduction is listed in the appendix.
基线。 我们将 LiCoMemory 与多个成熟基线进行比较,包括 LoCoMo、Zep、Mem0(Mem0g)、A-Mem、Memorybank 和 MemOS。 详细介绍见附录。
Implementation Details. All methods are evaluated under the same settings. Llama-3-8B-Instruct serves as the primary LLM for memory construction, while BGE-M3 is adopted for text embedding to support retrieval. During answer generation, Llama-3.1-70B-Instruct-Turbo and GPT-4o-mini are utilized as generation models. All experiments are conducted on NVIDIA 80G A100 GPUs. We report results averaged over 5 independent runs to ensure reliable performance and runtime measurements. The number of retrieved memory units (
实现细节。 所有方法均在相同设置下进行评估。 Llama-3-8B-Instruct 作为记忆构建的主要 LLM,而 BGE-M3 用于文本嵌入以支持检索。 在答案生成期间,我们使用 Llama-3.1-70B-Instruct-Turbo 和 GPT-4o-mini 作为生成模型。 所有实验均在 NVIDIA 80G A100 GPU 上进行。 我们报告 5 次独立运行的平均结果,以确保性能和运行时间测量可靠。 检索记忆单元的数量(
4.2 Main Results (RQ1)
Table 1 presents a comprehensive comparison of LiCoMemory with representative memory frameworks across two long-term dialogue benchmarks using different backbone language models. Across both Llama-3.1-70B-Instruct-Turbo and GPT-4o-mini, LiCoMemory consistently achieves the highest accuracy and recall while maintaining the lowest or near-lowest query latency. Moreover, its performance remains stable across multiple runs, demonstrating strong robustness. Specifically, on LongMemEval, it surpasses the second-best baseline by 9.0% in accuracy and 9.3% in recall with Llama-3.1-70B, and by 9.0% and 5.3% respectively with GPT-4o-mini. Similarly, on LoCoMo, LiCoMemory outperforms Mem0g by 7.5% in accuracy and 5.2% in recall on Llama-3.1-70B, and achieves a 8.9% and 4.95% gain under GPT-4o-mini. The observed improvements in QA performance demonstrate the effectiveness of the proposed CogniGraph structure. In addition, the reductions in retrieval latency and retrieval volume further substantiate the advantages of its precise retrieval mechanism and lightweight, efficiency-oriented graph design. Notably, the most pronounced performance gains are observed on the LoCoMo benchmark, where retrieval latency is reduced by 10% and token consumption by 45% compared to the second-best baseline (Mem0).
表1全面比较了采用不同主干语言模型时,LiCoMemory 与代表性记忆框架在两个长期对话基准上的表现。 在 Llama-3.1-70B-Instruct-Turbo 和 GPT-4o-mini 上,LiCoMemory 均持续取得最高的准确率和召回率,同时保持最低或接近最低的查询延迟。 此外,其性能在多次运行中保持稳定,展现出很强的稳健性。 具体而言,在 LongMemEval 上,使用 Llama-3.1-70B 时,其准确率和召回率分别比次优基线高 9.0% 和 9.3%;使用 GPT-4o-mini 时则分别高 9.0% 和 5.3%。 类似地,在 LoCoMo 上,使用 Llama-3.1-70B 时,LiCoMemory 的准确率和召回率分别比 Mem0g 高 7.5% 和 5.2%;在 GPT-4o-mini 下则分别提升 8.9% 和 4.95%。 观察到的问答性能提升证明了所提出 CogniGraph 结构的有效性。 此外,检索延迟和检索量的降低进一步证实了其精确检索机制及轻量、效率导向图设计的优势。 值得注意的是,最显著的性能提升出现在 LoCoMo 基准上:与次优基线 Mem0 相比,检索延迟降低 10%,token 消耗降低 45%。
To further analyze how LiCoMemory outperforms other frameworks on long-term dialogue benchmarks, we provide a detailed breakdown of its performance across subsets with different focuses using GPT-4o-mini as the generation model, as shown in Figure 4. As illustrated in the left chart, LiCoMemory consistently surpasses the second-best baseline (MemOS) across all subsets of LoCoMo, with a large gain observed in the Temporal-Reasoning subset, where accuracy improves by 19.2%. A smaller improvement is observed on the Adversarial subset, likely due to occasional false positives arising when the correct entries are not retrieved, as reflected by the recall results in Table 1. On the LongMemEval benchmark, LiCoMemory achieves substantial gains on the Multi-Session (26.6%) and Temporal Reasoning (15.9%) subsets compared to the second best baseline (Mem0), highlighting the effectiveness of our CogniGraph structure and unified reranking mechanism in capturing temporal and cross-session dependencies.
为了进一步分析 LiCoMemory 如何在长期对话基准上优于其他框架,我们使用 GPT-4o-mini 作为生成模型,对其在不同关注重点的子集上的性能进行详细拆解,如图4所示。 如左图所示,LiCoMemory 在 LoCoMo 的所有子集上均持续优于次优基线 MemOS,其中时间推理子集的增益很大,准确率提高 19.2%。 对抗子集上的提升较小,这可能是因为没有检索到正确条目时偶尔会出现假阳性,表1中的召回结果也反映了这一点。 在 LongMemEval 基准上,与次优基线 Mem0 相比,LiCoMemory 在多会话(26.6%)和时间推理(15.9%)子集上取得显著增益,突显了我们的 CogniGraph 结构和统一重排序机制在捕获时间与跨会话依赖方面的有效性。


4.3 Real-Time Performance (RQ2)
Following the discussion in Section 3.3, we evaluate LiCoMemory in a practical interactive setting where the agent must support real-time updates and retrieval. Using Llama-3.1-70B-Instruct-Turbo as the backbone, we perform chunk-by-chunk insertion on the LoCoMo dataset to emulate real-world conversational flows. During context ingestion, we only insert dialogue chunks without triggering retrieval, and issue queries after all insertions are completed. As shown in Table 2, LiCoMemory maintains leading accuracy with minimal degradation from static to real-time insertion, while achieving the lowest token usage and latency in both context processing (LiCoMemory further reduces construction token cost by over 3 times and construction latency by more than an order of magnitude, without compromising retrieval quality. These results highlight both the efficiency benefits introduced by CogniGraph and the robustness of LiCoMemory for real-time interactive deployment.
沿着第3.3节的讨论,我们在一个要求智能体支持实时更新与检索的实际交互环境中评估 LiCoMemory。 我们使用 Llama-3.1-70B-Instruct-Turbo 作为主干,在 LoCoMo 数据集上逐块插入对话块,以模拟真实世界的对话流程。 在上下文摄取期间,我们只插入对话块而不触发检索,并在所有插入完成后发出查询。 如表2所示,从静态插入转为实时插入时,LiCoMemory 仅有极小性能下降,仍保持领先准确率;同时,它在上下文处理(LiCoMemory 在不损害检索质量的情况下,将构建 token 成本进一步降低至三分之一以下,并使构建延迟下降一个数量级以上。 这些结果同时突显了 CogniGraph 带来的效率优势,以及 LiCoMemory 用于实时交互部署的稳健性。
| Method | Accuracy | Token | Latency | ||
|---|---|---|---|---|---|
| KG | KR | TG | TR | ||
| Zep | 38.7% | 212.5k | 4.0k | 2871s | 5.71s |
| Mem0 | 54.68% | 49.3k | 2.2k | 1772s | 1.78s |
| Mem0g | 55.82% | 61.8k | 2.4k | 2081s | 2.25s |
| A-Mem | 44.12% | 30.7k | 4.1k | 209s | 4.63s |
| MemOS | 54.08% | 143.2k | 2.6k | 256s | 2.71s |
| LiCoMemory | 66.4% | 13.52k | 1.3k | 21s | 1.52s |
4.4 Ablation Study (RQ3)
We analyze the contribution of each major component of LiCoMemory through an ablation study, where individual modules are selectively removed to assess their impact across diverse evaluation scenarios. Figure 5 summarizes the results, showing that disabling different components leads to varying degrees of performance degradation, thereby revealing their complementary roles in supporting coherent long-term reasoning, temporal consistency, and effective cross-session retrieval.
我们通过消融研究分析 LiCoMemory 各主要组件的贡献,其中选择性移除单个模块,以评估它们在不同评估场景中的影响。 图5概括了结果,表明禁用不同组件会导致不同程度的性能下降,从而揭示它们在支持连贯长期推理、时间一致性和有效跨会话检索方面的互补作用。
Overall, all ablated variants exhibit clear performance drops, with the most severe degradation observed for w/o Structured retrieval. When retrieval is performed solely over extracted triples, ignoring session hierarchy and entity--relation structure, performance drops from 73.8/76.6 to 51.6/56.4 on the full dataset and from 64.7/73.5 to 40.6/48.2 in the multi-session setting, indicating fragmented retrieval and weakened factual grounding. Removing temporal weighting (w/o Temporal awareness) causes sharp declines in time-sensitive tasks, with temporal reasoning falling from 71.4/81.3 to 48.9/53.5 and knowledge update from 80.8/85.1 to 51.9/57.0, demonstrating the necessity of temporal signals for avoiding outdated evidence. Finally, disabling summary-level guidance (w/o Summary) consistently degrades performance (73.8/80.6 LiCoMemory.
总体而言,所有消融变体都出现明显性能下降,其中 w/o Structured retrieval 的下降最为严重。 当检索仅在抽取的三元组上执行,并忽略会话层次与实体-关系结构时,完整数据集上的性能从 73.8/76.6 降至 51.6/56.4,多会话设置中则从 64.7/73.5 降至 40.6/48.2,说明检索出现碎片化,事实依据也被削弱。 移除时间加权(w/o Temporal awareness)会导致时间敏感任务显著下降:时间推理从 71.4/81.3 降至 48.9/53.5,知识更新从 80.8/85.1 降至 51.9/57.0,证明时间信号对于避免过时证据是必要的。 最后,禁用摘要级引导(w/o Summary)会持续降低性能(完整数据集上从 73.8/80.6 LiCoMemory 的稳健性。
5. Conclusion
This paper presents LiCoMemory, an end-to-end agentic memory framework designed for real-time updating, retrieval, and reasoning in long-term conversational scenarios. LiCoMemory incorporates CogniGraph, a lightweight and semantically aware hierarchical graph structure that redefines the role of knowledge graphs as a semantic indexing layer rather than a static repository. By leveraging hierarchical and temporally sensitive retrieval, the system unifies session-level, relational-level, and temporal relevance to retrieve coherent and contextually aligned knowledge. Experimental results on long-term dialogue benchmarks demonstrate that LiCoMemory consistently retrieves quality information and achieves superior performance in temporal and multi-session reasoning and other complicated tasks, while significantly improving update efficiency and inference speed compared to existing baselines. In future work, we plan to extend our structure to multi-agent settings and explore adaptive memory compression strategies to further enhance scalability and reasoning capability.
本文提出 LiCoMemory,一个面向长期对话场景中的实时更新、检索和推理而设计的端到端智能体记忆框架。 LiCoMemory 纳入 CogniGraph,这是一种轻量且具备语义感知能力的层次图结构,它把知识图谱的角色重新定义为语义索引层,而不是静态存储库。 通过利用层次与时间敏感检索,系统统一会话级、关系级和时间相关性,以检索连贯且与上下文对齐的知识。 长期对话基准上的实验结果表明,LiCoMemory 能够持续检索高质量信息,并在时间推理、多会话推理及其他复杂任务上取得更优性能;与现有基线相比,它还显著提高了更新效率和推理速度。 未来,我们计划把该结构扩展到多智能体环境,并探索自适应记忆压缩策略,以进一步增强可扩展性和推理能力。
6. Limitations
The current LoCoMo framework is limited to single-modality conversational data. Although it effectively models long-term structure within text-based interactions, it cannot incorporate additional modalities such as images, audio signals or structured sensor data. This restriction narrows its applicability in real-world settings where multimodal grounding is essential for maintaining coherent memory across heterogeneous inputs.
当前 LoCoMo 框架仅限于单模态对话数据。 尽管它能够有效建模基于文本交互中的长期结构,但无法纳入图像、音频信号或结构化传感器数据等其他模态。 这一限制缩小了它在真实世界环境中的适用范围;在这些环境中,多模态依据对于跨异构输入维持连贯记忆至关重要。
Another limitation lies in the LLM-dependent graph construction process. Building and refining the memory graph requires invoking large language models for abstraction, relation inference, and coherence evaluation. This dependence on large language models is not unique to LoCoMo but represents a broader challenge shared by many LLM-based memory organization methods. As the volume of conversational history scales up, the number of required model calls grows correspondingly, leading to substantial computational and monetary cost. This poses practical challenges for deploying LoCoMo in large-scale or high-throughput applications.
另一个限制在于依赖 LLM 的图构建过程。 构建和精炼记忆图需要调用大语言模型来执行抽象、关系推断和连贯性评估。 这种对大语言模型的依赖并非 LoCoMo 独有,而是许多基于 LLM 的记忆组织方法共同面临的更广泛挑战。 随着对话历史规模扩大,所需模型调用次数也会相应增长,导致大量计算与资金成本。 这给在大规模或高吞吐量应用中部署 LoCoMo 带来了实际挑战。