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.
Figures & tables
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.
Figure 2: The overall architecture of MemCompile
Single-Hop
Multi-Hop
Temporal
Open-Domain
Overall
Method
F1 ↑
BLEU-1 ↑
J ↑
F1 ↑
BLEU-1 ↑
J ↑
F1 ↑
BLEU-1 ↑
J ↑
J ↑
F1 ↑
BLEU-1 ↑
J ↑
Tokens (K)
LoCoMo
37.81
26.23
57.07
20.97
11.09
48.58
34.79
15.46
38.01
41.67
33.85
20.88
50.58
827.20
MemoryBank
17.85
12.13
46.61
11.25
8.20
28.01
14.26
9.60
34.27
23.96
15.76
10.80
39.22
926.98
A-Mem
33.87
27.64
54.10
21.17
15.40
43.26
34.13
29.98
34.89
32.29
31.45
25.77
46.75
11,687.58
Mem0
54.95
44.71
82.40
36.02
25.25
60.99
30.36
29.69
33.02
50.00
45.79
37.57
66.17
55,300.30
MemoryOS
49.72
43.58
66.47
37.15
26.87
60.99
41.99
36.32
34.58
51.04
45.55
38.70
57.86
19,207.67
Table 1: LoCoMo category and overall results . Best results are bold and second-best results are underlined. Tokens exclude judging and embedding.
Overall
Setting
F1 ↑
BLEU-1 ↑
Recall ↑
Judge ↑
A0 Full system
55.94
48.65
85.50
80.52
A1 w/o frontier
51.78
44.87
80.84
74.94
A2 w/o scheduler and frontier
42.00
36.01
51.99
60.91
A3 w/o scheduler, with frontier
51.91
44.75
76.55
75.26
A4 Cell-only route
50.64
43.85
69.85
71.88
Table 2: Controlled pipeline-path ablations on LoCoMo . A1 retains the packet anchors returned by Complementary Packet Scheduling but disables subsequent semantic-frontier expansion. A2 and A3 replace the scheduled anchors with deterministic dialogue-level MMR Top-10 anchors, the scoring function and weights are detailed in Appendix B.3 . A7 directly selects the dense cosine Top-10 SourcePackets and presents their claim bundles to the Reader.
Figure 3: RQ1 quality-cost comparison , blue squares form the empirical Pareto frontier.
Controlled stage ( K=10 )
Unique ↑
DBR ↓
Gold ↑
Δ Gold vs. previous (95% CI)
Robust
Unnormalized claim top- K
7.690
23.08
48.89
—
—
Exact-text deduplication
7.742
22.56
48.56
−0.33 [ −0.87 , 0.21]
—
Source-normalized top- K
9.988
0.00
51.91
+3.35 [2.45, 4.26]
†
+ Complementary source scheduler
9.988
0.00
80.84
+28.93 [26.81, 31.14]
†
Table 3: Controlled source selection at K=10 . Gold Recall and DBR are percentages. Gold differences are percentage points with paired question-bootstrap 95% CIs; † means that both question-level and conversation-cluster CIs exclude zero.The source-normalized Top- K ranks packets directly by the maximum claim score.
Fixed-packet view
F1 ↑
BLEU-1 ↑
Judge ↑
Representative claim
40.68
35.13
57.01
Raw SourcePacket
53.00
46.01
75.32
Full claim bundle
55.94
48.65
80.52
Table 4: Reader-view ablation at identical packet Recall (85.50%).
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Depth
Eligible N
Unique
DBR ↓
Affected
Max-source μ /P95/max
Top-10
1,539
7.69
23.08%
84.21%
2.42/4/6
Top-20
1,537
14.60
27.02%
97.27%
3.18/5/7
Top-40
1,533
26.94
32.66%
100.00%
4.12/6/8
Appendix
Table 5: Pre-normalization aliasing at three retrieval depths. DBR and Affected are percentages. Max-source reports the mean, 95th percentile, and global maximum number of slots occupied by one source.
Figure 4: Category-level effects of source normalization, complementary scheduling, and source-scoped claim-bundle compilation. (a) Gold Source Recall after exact-text deduplication, source-ID normalization, and complementary source scheduling. (b) Judge Accuracy across the controlled stages and the fixed-source claim-bundle reader view.
Figure 5: Cell-placement contribution to recall. Bars are gains over Flat construction; translucent bands and dashed endpoints show conversation-bootstrap 95% intervals.
Component
Setting
Value
Models
construction, intent, scheduling, answer
gpt-4o-mini
dense retrieval
text-embedding-3-small
temperature / maximum completion
0 / 2,048 tokens
Cell construction
layout / token cap / item cap
bounded lexical Cell / 360 / 12
β,γ,η / new-Cell penalty
1.4, 1.0, 0.45 / 0.65
entropy weight / entropy threshold
0.4 / 1.8
Appendix
Table 6: Configuration of the reported MemCompile experiment.
Figure 6: Post-hoc frontier sensitivity around the fixed reported configuration.
Category
MemCompile
LightMem Fang et al. (2026)
Mem0 Chhikara et al. (2025)
J ↑
J ↑
J ↑
SSU
91.43
84.29
90.00
MS
54.14
57.14
65.41
TR
72.18
51.88
48.12
KU
78.21
76.92
74.36
SSA
94.64
33.93
44.64
Appendix
Table 7: Judge accuracy (%) on LongMemEval-S. Best category-level results are bold. SSU, MS, TR, KU, SSA, and SSP denote single-session user, multi-session, temporal reasoning, knowledge update, single-session assistant, and single-session preference, respectively.
Stage
Total tokens
Tokens/question
Share of non-Judge total
Fact extraction
1,578,484
1,025
5.9%
Metadata extraction
12,492,607
8,112
46.8%
Cold-build subtotal
14,071,091
9,137
52.7%
Query intent
313,178
203
1.2%
packet scheduler
6,170,000
4,006
23.1%
frontier reranker
4,380,000
2,844
16.4%
Appendix
Table 8: Generation-token accounting for MemCompile on the 1,540 LoCoMo questions. Totals include prompt and completion tokens from unique successful LLM calls; Judge and embedding usage are excluded. Per-question costs amortize each total over all 1,540 questions, and shares are rounded independently.
Under a limited context budget, a long-term agent must recall not merely memories that are individually relevant, but evidence that is collectively sufficient for the current query. Conventional memory access retrieves, scores, and truncates memories, often spending multiple context slots on redundant facts while leaving complementary evidence behind. We cast the read phase of long-term memory as query-conditioned evidence composition: each memory is valued by what it adds beyond the evidence already selected. We instantiate this operation with MemPursuit, a training-free mechanism that uses the residual of a sparse convex query reconstruction as a representation-space proxy for what the current memory set is missing. By reusing the query and candidate embeddings already available from retrieval, MemPursuit progressively composes nested evidence contexts without invoking a language model or cross-encoder to score each query--memory pair. The effectiveness of our method is verified on 3 popular benchmarks in comparison to strong baselines. In fixed-budget LoCoMo experiments, MemPursuit improves end-to-end accuracy by 7.2 percentage points at Top-10 and 5.5 percentage points at Top-20, with consistent gains across multiple memory frameworks, while achieving a 32.9× speedup in median reranking latency over fully batched BGE-v2-m3. Our implementation is available at https://github.com/FengQi-HITSZ/MemPursuit.
Qi Feng, Jicong Fan
School of Data Science, The Chinese University of Hong Kong, Shenzhen
Efficient long-term conversational memory requires retrieving sufficient evidence without indiscriminately expanding the context presented to the language model. This is challenging because relevant evidence may be distributed across multiple sessions, while compression may discard details needed for answering. Different queries therefore require different forms of memory access. To capture these demands, we formulate memory access along two dimensions: discovery breadth, which controls how broadly evidence is searched, and reading fidelity, which controls whether evidence is read in compact form or recovered from the original conversation. Based on this formulation, we introduce JustMem, which stores conversation history as compact atomic memories and adapts memory access along these two dimensions to each query. Specifically, LOOKUP handles local evidence, COMPOSE broadens discovery for distributed evidence, and REPLAY increases reading fidelity for fidelity-sensitive evidence. On LoCoMo and LongMemEval-S, JustMem achieves the highest mean accuracy and retrieval recall among the compared memory systems while using substantially fewer generative-model tokens for memory construction and inference.
Long-term conversational agents must answer user queries by recalling information from extended dialogue histories, yet directly using the full history is costly and often unreliable, while compressed memory units may lose fine-grained evidence needed for question answering. Motivated by the reconstructive view of autobiographical memory, we propose CueMem, a cue-guided framework that treats extracted memory records as retrieval cues rather than self-contained evidence and reconstructs query-relevant dialogue context from their source turns. During memory construction, CueMem extracts fine-grained memory cues from dialogue turns and links each cue to its source turn. At query time, it retrieves query-relevant cues, maps them to source-turn anchors, and expands from these anchors over a turn graph that captures temporal proximity and semantic relatedness, reconstructing a compact evidence context from the original dialogue for LLM answer generation. Experiments on LoCoMo and LongMemEval show that CueMem consistently outperforms representative long-term memory baselines. Further analyses show that graph-based context reconstruction helps recover supporting dialogue evidence while reducing query-time input tokens and latency compared with the full-history LLM setting. These results highlight retrieval cues as an effective alternative to self-contained memory evidence for long-term conversational question answering.
Changjian Wang, Rongzhen Li, Weili Guan +3
Mashang Consumer Finance Co., Ltd. · Harbin Institute of Technology, Shenzhen