Manuscript Offprint

arXiv:2610.11920

Event-Centric Memory with Query-Aware Graph Augmentation for Long-Term Conversational Agents

Yichen Liu, Chunfeng Yuan, Haowei Liu, Wenjuan Li, Zefeng Lin, Bing Li, Xu Chen, Weiming Hu

Yichen Liu, Chunfeng Yuan, Haowei Liu, Wenjuan Li, Zefeng Lin, Bing Li, Xu Chen, and Weiming Hu

Abstract—For persistent and personalized conversational agents, memory systems can enable them to remember, update, and reason over long histories by storing past interactions and retrieving relevant information. Existing memory systems typically follow two paradigms: flat-structured memory and graph-based memory. The former is lightweight but leaves event relations and state updates implicit, while the latter explicitly models memory structure but incurs additional construction cost and introduces irrelevant relations over long histories. To address these limitations, we propose QGMEM, a novel memory construction and activation framework motivated by human memory, in which experience is organized into events and query-relevant events are modeled by graph as working memory. QGMEM converts long dialogue histories into event-indexed atomic memory units that preserve individual experiences and consolidates related units into dynamic memory traces that retain state trajectories and current states. When a query arrives, hybrid memory retrieval gathers complementary candidate memories, and query-aware reranking activates the most relevant units as a compact working memory. To expose relational dependencies in the working memory and support conflict-aware reasoning, QGMEM organizes the working memory as a local graph, which is then encoded as a graph token and provided to the LLM together with the textual working memory to improve evidence utilization during answer generation. Experiments across six benchmarks validate the framework and show consistent gains in retrieval, multi-hop evidence composition, conflict resolution, and ultra-long dialogue reasoning with compact contexts and moderate inference cost.

Index Terms—Long-term memory, conversational agents, graph-based memory.

I. INTRODUCTION

Maintaining continuity across long-term interaction between humans and agents remains a pivotal milestone towards personalized and autonomous artificial intelligence. Personal assistants, companion dialogue systems, and task-oriented agents are expected to remember user preferences, interpersonal relations, schedules, and later updates across many turns or sessions. Since such information cannot always fit into the model context [1], an agent needs memory mechanisms that preserve past interactions, track evolving states, identify relevant memory, and organize their relations for answer generation. Therefore, recent works [2]–[4] introduce long-term memory systems that store historical interactions as persistent external memory and retrieve relevant memory units when answering user queries.

Existing memory systems mainly follow two organizational paradigms, as illustrated in Figure 1(a) and (b). Flat-structured memory stores historical information as turns, sessions or summaries [3]–[5]. This paradigm is lightweight and easy to maintain, but relations among events and state changes are usually left implicit. Graph-based memory explicitly represents entities, events, and states as graph structures [6]–[8]. Such structures support relational reasoning, but constructing and retrieving graph structures over long histories introduces additional cost and even irrelevant relations. Consequently, existing long-term conversational memory systems struggle to simultaneously achieve lightweight persistent storage and explicit relational organization.

These limitations motivate a memory architecture that combines persistent storage with query-time relational organization: long-term memory preserves events and their evolving states, whereas working memory constructs a relational structure over query-relevant events. This view is consistent with classic research in cognitive psychology on event cognition, which suggests that people represent continuous experience as a sequence of events, update the current event in working memory, and retrieve relevant past events from long-term memory [9]–[11]. Motivated by this perspective, we propose Query-aware Graph-augmented Memory (QGMEM), which combines event-centric memory storage with query-time relational organization, as illustrated in Figure 1(c). QGMEM first converts dialogue histories into event-indexed atomic memory units with traceable source content, each representing an independently interpretable event or state and indexed by explicit event attributes, including entities, locations, and factual time. Related units are then consolidated into dynamic memory traces that preserve state trajectories and current states, thereby making state updates explicit and distinguishing current facts from superseded ones. To improve the retrieval quality of answer-bearing memories, hybrid memory retrieval integrates lexical, semantic, and event-attribute relevance using reciprocal rank fusion (RRF) [12]. Query-aware reranking removes irrelevant and superseded candidates, yielding a compact working memory concentrated on the current query. To model relational dependencies within the activated working memory, QGMEM constructs a local memory

• Y. Liu, C. Yuan, W. Li, Z. Lin, B. Li, and W. Hu are with the State Key Laboratory of Multimodal Artificial Intelligence Systems, Institute of Automation, Chinese Academy of Sciences, Beijing 100190, China.

• Y. Liu, C. Yuan, B. Li, and W. Hu are also with the School of Artificial Intelligence, University of Chinese Academy of Sciences, Beijing 100049, China.

• C. Yuan, W. Li, Z. Lin, B. Li, and W. Hu are also with the Beijing Key Laboratory of Super Intelligent Security of Multi-Modal Information, Beijing, China.

• H. Liu is with Alibaba Group, China.

• B. Li is also with PeopleAI Inc., Beijing 100190, China.

• X. Chen is with the Gaoling School of Artificial Intelligence, Renmin University of China, Beijing 100872, China.

• W. Hu is also with the School of Information Science and Technology, ShanghaiTech University, Shanghai 201210, China.

• Corresponding author: Chunfeng Yuan (e-mail: cfyuan@nlpr.ia.ac.cn).

(a) Flat-Structured Memory

Figure

✓ Lightweight representation and efficient memory access

✗ Coarse chunks obscure relations and updates between events

(b) Graph-based Memory

Query-relevant subgraph

Figure

✓ Explicit relations support multi-evidence reasoning

✗ Irrelevant structure increases construction and traversal cost

(c) QGMem

Figure

Activated Working Memory Local Memory Graph

✓ Event-indexed memories preserve fine-grained facts and updates

✓ Query-local graphs retain relations with less structural noise

Fig. 1. Comparison of flat-structured memory, graph-based memory, and QGMEM.

graph from the facts of the selected memory units. Then, a relation-aware graph encoder is employed to encode the local memory graph, and the resulting graph-level representation is projected into the LLM embedding space. The graph token is supplied to the LLM together with the textual working memory, enabling multi-hop evidence composition based on both memory content and relational information.

The resulting framework is designed to reconcile three objectives in long-term conversational memory: preserving verifiable historical evidence, exposing query-relevant relations, and maintaining a compact generation context. Figure 2 provides an empirical view of this balance by comparing QGMEM with retrieval-augmented generation (RAG) and representative flat-structured and graph-based memory systems in terms of retrieval quality, answer quality, and context efficiency. Flat-structured systems maintain compact contexts but exhibit lower retrieval or answer quality, whereas graph-based systems do not simultaneously attain high retrieval and answer quality. In contrast, QGMEM achieves an nDCG@10 of 82.50% and an LLM-judged score of 82.77% with 598.19 retrieved-context tokens. These results show that QGMEM improves the prioritization and utilization of answer-supporting memories while maintaining a compact context for generation.

We conduct main experiments on six long-term memory benchmarks. LoCoMo [13] and LongMemEval-S [14] evaluate accurate retrieval and multi-hop evidence composition, while Fact-SH and Fact-MH from MemoryAgentBench [15] evaluate conflict resolution. BEAM-100K and BEAM-500K [16] assess scalability over ultra-long dialogue histories. We further extend the BEAM evaluation to 1M and 10M tokens to examine performance under extreme context lengths. Overall, QGMEM consistently outperforms state-of-the-art systems. Further evaluations show that these gains remain consistent across two open-weight backbones, Qwen3-8B and Llama3.1-8B-Instruct, and one closed-source backbone, GPT-4o-mini [17]–[19]. In-depth ablation experiments confirm the effectiveness of the key components in QGMEM. Additional efficiency, scalability, hyperparameter sensitivity, and case analyses characterize the computational cost, robustness, and retrieval performance of QGMEM from complementary perspectives.

Figure

Fig. 2. Comparison of retrieval quality, LLM-judged answer score, and retrieved-context size on LoCoMo with Qwen3-8B. Colors distinguish the retrieval-augmented baseline, flat-structured memory, graph-based memory, and QGMEM. The horizontal axis denotes normalized discounted cumulative gain at rank 10 (nDCG@10), the vertical axis denotes the LLM-judged score, and bubble area denotes the average number of retrieved-context tokens. Higher axis values and smaller bubble areas indicate better overall performance.

The main contributions of this work are summarized as follows:

• We introduce an event-centric memory framework for persistent conversations that integrates fine-grained event storage, evolving-state consolidation, query-aware activation, and relational evidence organization within a unified memory lifecycle.

• We represent conversational experience using traceable atomic memory units and dynamic memory traces, preserving both historical states and currently valid information as the dialogue evolves.

• We organize query-relevant memories into a compact working memory and encode their local relational topology jointly with source-grounded textual evidence, supporting evidence composition without maintaining a graph over the complete dialogue history.

• We evaluate the framework across six benchmarks and multiple LLM backbones, examining answer quality, retrieval effectiveness, conflict-sensitive reasoning, long-context scalability, and computational cost.

References (55)