arXiv:2610.23313cs.AIOct 2026

Manuscript Offprint

arXiv:2610.23313

From Memory Hits to Answerable Evidence: Query-Conditioned Memory Compilation for Long-Term Agent Memory

Shangze Li, Yanyu Yao, Derong Xu, Zhi Zheng, Tong Xu

Abstract

Long-term agent memory requires recovering answer-relevant evidence dispersed across turns and sessions. Existing systems increasingly use structured memories and adaptive retrieval, yet often pass retrieved or expanded units directly to the reader, coupling memory addressing with evidence presentation and leaving the final context redundant or incomplete. To address this gap, we propose MemCompile, a query-conditioned evidence compilation framework for long-term conversational memory. Given a query, the Address Plane locates relevant support through compact source-linked descriptors and capacity-aware Cells, while a normalization boundary resolves heterogeneous retrieval hits to stable SourcePacket identities. Its Evidence Plane then allocates a bounded evidence budget across complementary packets, admits limited additional support, and renders the retained claims associated with each selected packet into an answer-ready context. MemCompile achieves 80.52% Judge Accuracy on LoCoMo and extends the empirical quality-cost Pareto frontier to a higher-quality regime. Its strong performance on LongMemEval-S further suggests that the benefits of query-conditioned compilation generalize across long-term conversational-memory benchmarks. The implementation code is publicly available at https://github.com/MINE-USTC/MemCompile

1 Introduction

Long-term memory is essential for interactive agents to sustain coherent, personalized, and reliable behavior across sessions. By carrying forward user preferences, past events, commitments, and evolving states, it allows an agent to respond in light of what has happened before (Maharana et al., 2024; Wu et al., 2025). However, the information needed for a new query may be distributed across

Figure

Figure 1: Motivation and overview of MemCompile. Existing memory systems face different trade-offs in retrieval units and evidence representation. MemCompile addresses these challenges through source-normalized retrieval, complementary evidence selection, and packet-scoped reader-view compilation.

distant turns and sessions or revised by later interactions. Persistent interaction therefore depends not only on retaining past information, but also on making the relevant parts of an accumulated history accessible when needed.

Foundational long-term memory systems addressed this need by extracting and retrieving salient records, including persistent memories and atomic conversational facts (Zhong et al., 2023; Chhikara et al., 2025). Subsequent work improved access by compressing dialogue into facts, notes, summaries, profiles, and events, and by organizing these representations in graphs or hierarchies (Xu et al., 2025; Rasmussen et al., 2025; Liu et al., 2026; Yao et al., 2026). As retrieval representations became increasingly compact and structured, recent work began to distinguish the units used to locate memory from the evidence exposed to the reader. AnchorMem reconstructs immutable contexts from retrieved fact anchors, xMemory adaptively discloses segments or raw messages from a hierarchy, and MemIR projects heterogeneous retrieval cues into provenance-scoped claim bundles (Shen et al., 2026; Hu et al., 2026; Jin et al., 2026). Together, these developments move long-term memory systems from improving addressability toward separating memory location from evidence presentation.

However, this separation remains incomplete: the retrieved representation, or the expansion attached to it, still largely determines the context presented to the reader. Existing systems therefore do not fully separate two decisions: which underlying conversation sources should receive the limited evidence budget, and how evidence from those sources should be represented for answer generation. This coupling is problematic because the two decisions favor different properties. Address representations should be compact, discriminative, and broad enough to support reliable recall, whereas reader evidence should preserve relevant qualifications, connect complementary facts, and avoid unnecessary context. When a single unit serves both purposes, the system must accept a fixed trade-off. As illustrated in Figure 1, an atomic claim may be easy to retrieve but may omit causal relationships or sibling facts from the same source. A raw turn preserves such details but may reintroduce noise, such as greetings and irrelevant dialogue, whereas a hierarchy node can provide an effective navigation unit without matching the granularity required for answer generation. Moreover, without an explicit source-level boundary, multiple claims or retrieval channels may allocate context budget repeatedly to the same underlying source. This coupling not only creates avoidable quality loss after successful retrieval, but also makes it difficult to distinguish failures of source recovery from failures of evidence presentation.

In this paper, we propose MemCompile, a source-normalized evidence compiler for long-term conversational memory. Its central principle is to locate relevant information through compact representations and allocate the evidence budget at the level of original dialogue turns while generating from a separately compiled reader view. MemCompile realizes this principle through an Address–Evidence two-plane architecture. The Address Plane organizes source-linked atomic descriptors into capacity-bounded Cells and combines diminishing-benefit Cell routing with lexical retrieval to construct primary source candidates while a broader dense packet pool supplies proposals for bounded semantic refinement. An explicit normalization boundary resolves these heterogeneous results to stable SourcePacket identities, ensuring that one underlying source occupies one evidence unit regardless of how many descriptors or channels locate it. The Evidence Plane then selects complementary packet identities, preserves the initial anchors while admitting bounded additional support, completes evidence within each selected packet, and compiles the result into a reader-facing view. By separating packet selection from textual rendering, MemCompile can optimize and evaluate source recovery and evidence presentation as distinct decisions.

Our main contributions are summarized as follows:

• We formulate long-term memory serving as query-conditioned evidence compilation, distinguishing two decisions that are commonly coupled: which underlying sources receive the evidence budget and how evidence from those sources is represented to the reader.

• We introduce MemCompile, an Address–Evidence two-plane architecture that addresses memory through compact derived views, allocates evidence budget at the level of immutable SourcePackets, and generates from a separately compiled reader view.

• Comprehensive evaluations on long-term memory benchmarks demonstrate that MemCompile consistently outperforms state-of-the-art baselines while extending the empirical quality–cost Pareto frontier. On the Lo-CoMo benchmark, packet-scoped compilation improves F1 by 15.26 points and Judge Accuracy by 23.51 points over representative-claim rendering.