Manuscript Offprint

arXiv:2609.03915

RuleMem: Active Rule Memory for Long-Term Conversational Agents

Xingyuan Zeng, Zuohan Wu, Quanming Yao, Yue Wang, Wei Liu, Libin Zheng, Jiuke Wang, Jian Yin

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Question answering agents in long-term conversations must reason over massive, temporally dispersed dialogue histories. However, existing memory mechanisms primarily treat past information as passively stored facts, leading to semantic gaps and unreliable reasoning. To address this limitation, we propose RuleMem, a rule-based memory framework that induces reusable logical rules from historical interactions to actively guide both evidence retrieval and reasoning. Specifically, RuleMem constructs natural-language Horn clauses from conversations and validates them via a Rule Perplexity Consistency (RPC) mechanism. These induced rules enable the retrieval of semantically distant evidence while providing an explicit logical structure for answer generation. We conducted a comprehensive evaluation of RuleMem on two long-term conversational benchmarks, LoCoMo and LongMemEval_s*. In a rigorous comparison against 14 baselines on LoCoMo, RuleMem achieved the highest accuracy, exceeding the baseline average by 27.47 points (a 54.3% relative improvement).

Introduction

Question answering (QA) over long-term conversations (Maharana et al. 2024) requires agents to reason across massive, unstructured, and temporally dispersed dialogue histories. To overcome the limitations of finite context windows and the difficulties in updating the parametric memory (Wang et al. 2025c) of large language models (LLMs), external memory modules have become standard components of contemporary agents (Hu et al. 2025). These modules enable agents to store past interactions, maintain persistent user or task-related information, and retrieve relevant memories during inference (Gutiérrez et al. 2025).

However, QA over long-term conversations faces two core challenges: evidence retrieval across semantic gaps (Nguyen 2010) and reliable reasoning over the retrieved evidence (Trivedi et al. 2023). For example, given the question “Why was Alice absent from the meeting?”, the relevant historical evidence might never explicitly mention the word “absent.” Instead, the system should reason based on the record “Alice booked a vacation” for the final answer.

Existing memory designs remain superficial and do not fully address both challenges simultaneously. We categorize existing agent memory paradigms into two levels of abstraction: fact memorization and fact organization. The first level, fact memorization, focuses on the direct storage and similarity-based retrieval of dialogue snippets or instance-level facts (as exemplified by systems including MemGPT (Packer et al. 2023), Mem0 (Chhikara et al. 2025), and LangMem.) These methods depend heavily on lexical or shallow semantic overlaps between the current query and stored memories. Consequently, they frequently suffer from recall failures due to underlying semantic gaps. The second level, fact organization, goes beyond isolated memory entries by introducing structured representations and compressed summaries. For instance, Zep (Rasmussen et al. 2025) and Mem0 ∘^{\circ} (Chhikara et al. 2025) structure dialogue histories into temporal knowledge graphs to establish structural connections among facts; meanwhile, A-MEM (Xu et al. 2025) and MemInsight (Salama et al. 2025) construct Zettelkasten-style (Luhmann 1981) semantic networks and feature-annotated hierarchical summaries, respectively, to correlate and summarize fragmented snippets. Although these structural connections facilitate the traversal of related facts, they remain confined to the instance level. As the memory scale expands, dense instance connections inevitably introduce query-irrelevant noise. Consequently, LLMs have to infer on their own which facts serve as valid premises and what conclusions they can support. When confronted with lengthy, loosely organized contexts, this deductive reasoning process frequently results in broken logic chains (Yoran et al. 2024; Jin et al. 2025) or hallucinations (Liu et al. 2024), a phenomenon we term reasoning failure.

Observing the limitations above, we propose memory exploitation on a higher level of abstraction, rule induction. This idea is drawn from human cognition: memory does not merely record or organize fragments; rather, it induces rules from specific observations (Erickson and Kruskche

∗^{*}Corresponding author.

Copyright © 2027, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved.

Cognitive Abstraction

Figure

(a) Fact-memorization methods

(b) Fact-organization methods

(c) Our rule-induction method

Figure 1: Comparison of three paradigms in agent memory. Fact memorization relies on surface similarity to retrieve isolated snippets. Fact organization builds instance-level structures (e.g., Zettelkasten and knowledge graphs) but introduces noise during complex reasoning. Our proposed rule induction extracts reusable rules from specific facts, bridging semantic gaps for implicit evidence retrieval and providing a logical skeleton for explicit reasoning.

1998). After observing that travel plans often lead to meeting absences, humans induce an implicit, reusable rule from specific observations: “If a person has a recent travel plan, then they may be unable to attend a scheduled event.” When faced with a new question about “absence”, this rule not only indicates what clues should be recalled but also provides a logical skeleton for interpreting the evidence. Although recent works in sequential decision-making have begun to explore learning workflows (Wang et al. 2025d; Zhao et al. 2024; Shinn et al. 2023), the abstraction and learning of inductive rules to assist memory reasoning in QA tasks remain underexplored.

Inspired by this, we propose the RuleMem framework, a rule memory framework for reasoning in question-answering agents. Unlike existing methods where memory passively serves as a recalled object, we propose a novel format as rule memory: it induces reusable logical rules from historical conversations to actively and explicitly guide evidence retrieval and logical deduction for subsequent queries. Specifically, we formulate the rule memory using natural-language Horn clauses (Horn 1951), combining the structural rigor of formal logic with the semantic flexibility of natural language. At query time, these rules serve two primary roles. First, they guide retrieval. By using rule antecedents as retrieval cues, the model can identify underlying evidence that is semantically distant yet logically relevant, thereby reducing retrieval failures. Second, they support reasoning. The matched rules serve as explicit major premises (Johnson-Laird 2008), providing rigorous logical support to connect scattered facts with the final conclusion, thereby mitigating reasoning failures.

Since directly prompting LLMs to induce rules often yields over-generalized or hallucinated results (Huang et al. 2023; Ji et al. 2023), RuleMem introduces a Rule Perplexity Consistency (RPC) filtering mechanism. By measuring reductions in conditional perplexity (Bengio et al. 2003) to evaluate

the consistency between internal priors and external factual evidence, RPC effectively filters out unreliable rules to ensure high-quality rule memory. The main contributions of this paper are summarized as follows:

  • We propose RuleMem, a rule memory framework that turns memory from a passively recalled object into an active guide for evidence retrieval and logical deduction.
  • We introduce RPC to verify the quality of induced rules. RPC uses reductions in conditional perplexity to approximate rule support in a continuous semantic space, jointly evaluating model self-consistency and external factual consistency.
  • We evaluate RuleMem on multiple long-term conversation QA benchmarks. Experimental results show that RuleMem alleviates recall and reasoning failures inherent in existing methods, outperforming mainstream memory baselines.

References (50)