Long-term memory is crucial for personalized responses and long-horizon agent interactions. Existing methods often rely on LLMs to compress or rewrite dialogue histories and use the transformed memories as retrieval evidence. Despite the progress in organizing fragmented contexts, two major drawbacks persist: (1) information loss from compression, which discards fine-grained but later useful details, and (2) semantic drift from rewriting, which erodes the original tone and situated context. In this work, we propose a novel Human-profile Enhanced Retrieval Optimization framework for long-term agent memory (HERO). Specifically, HERO converts the dialogue history into a traceable heterogeneous memory graph that preserves raw dialogue text as evidence for reasoning, thereby mitigating information loss. For retrieval, HERO extracts initial anchors from the current query and incorporates human profiles via an iterative graph traversal; these anchors and profiles provide guidance signals that adaptively activate the most informative regions of the graph. Experiments on two benchmark datasets show that HERO outperforms strong baselines on both factual and personalized reasoning, while providing more faithful access to raw dialogue evidence.
Figures & tables
Figure 1: Overview of the proposed HERO framework. Left: Memory Construction. User dialogues are processed to extract Episodic Traces, which are further organized into Episodic Units and Episodic Cues to form the Episodic Layer. In parallel, Profile Insights and corresponding Profile Cues are derived from Episodic Traces to construct the Profile Layer. Episodic Cues and Profile Cues jointly constitute the cue nodes in a heterogeneous memory graph. Right: Memory Retrieval. Given a user query, entities are first extracted and matched against the cue nodes in the graph to obtain an initial candidate set. Through iterative expansion via Cue–Episodic Unit and Cue–Profile Insight bridges, additional relevant cue nodes are activated and incorporated into the Personalized PageRank initialization. In this process, Episodic Units support explicit semantic linking, while Profile Insights provide implicit, profile-consistent semantic connections.
Method
Multi-hop
Temporal
Open-domain
Single-hop
Overall Average
ACC
F1
BLEU-1
ACC
F1
BLEU-1
ACC
F1
BLEU-1
ACC
F1
BLEU-1
ACC
F1
BLEU-1
HERO
85.11
43.52
32.57
86.60
63.63
57.82
72.92
34.67
30.13
91.20
59.81
52.15
87.99
56.06
48.38
CAM
76.60
29.89
14.72
76.32
40.34
35.51
66.67
19.37
15.57
87.40
30.70
24.55
81.82
31.85
24.48
EverMemOS
81.91
41.55
28.31
83.80
59.08
52.09
69.79
25.76
19.33
86.44
43.78
36.06
84.03
45.48
36.94
LinearRAG
52.13
28.83
21.11
53.27
41.50
36.82
55.21
22.44
16.73
66.35
44.70
39.24
60.32
39.74
34.01
MemoryOS
57.45
35.11
26.62
44.86
32.05
26.68
53.13
23.57
12.77
74.67
52.10
45.47
63.96
43.03
36.06
Table 1: Performance Comparison on the LoCoMo benchmark. All values represent the performance metric for each task (e.g., accuracy %). Best results are highlighted in bold.
Category
R@5
R@10
Single-hop
0.935
0.960
Multi-hop
0.915
0.947
Temporal
0.935
0.953
Open-domain
0.604
0.667
Overall
0.910
0.938
Table 2: Retrieval quality on the LoCoMo benchmark.
Question & Gold Answer
Original Context
Generated Memory
Q: What did Evan start painting due to a friend’s gift? A: forest scene
Evan shared a photo of a painting of a forest scene on an easel, and said, “Thanks, Sam! It all started when a friend of mine gave me this painting one day, it inspired me a lot and that’s when I started painting…”
Memory Content: Evan thanked Sam and mentioned starting painting classes a few days ago. Evan shared a forest painting, inspired by a gift from a friend.
Q: How often does Audrey take her pups to the park for practice? A: Twice a week
Audrey shared a photo of a group of dogs sitting on a dirt road and said, “…it’s a great physical and mental workout. I take them to the park twice a week for practice—it’s been a great bonding experience…”
Memory Content: Audrey highlighted her twice-weekly agility classes and the positive impact on her dogs’ social and physical development.
Table 3: Case study comparing original context and generated memory on the LoCoMo benchmark.
Method
Generalize to New Scenarios
Provide Preference-Aligned Recommendations
Recall User Shared Facts
Acknowledge Latest User Preferences
Revisit Reasons behind Preference Updates
Suggest New Ideas
Track Full Preference Evolution
Overall Avg
HERO
82.46
80.00
68.99
76.47
87.88
37.63
72.66
70.63
CAM
70.18
54.55
65.89
76.47
75.76
36.56
61.87
61.63
Mem0
73.68
72.73
61.24
70.59
79.80
35.48
68.34
64.52
EverMemOS
80.70
72.73
68.99
76.47
83.84
22.58
71.22
66.38
LinearRAG
68.42
74.55
72.09
70.59
81.82
21.51
71.94
65.35
MemoryOS
82.46
67.27
65.12
70.59
86.87
22.58
71.94
65.70
Table 4: Performance comparison on the PERSONAMEM benchmark. All values represent the performance metric for each task. Best results are highlighted in bold.
Figure 2: Ablation Studies of HERO.
Figure 3: Performance–efficiency trade-off during retrieval on the LoCoMo benchmark.
Hyperparameter
Value
Acc
F1
τalias
0.6
0.818
0.552
0.7
0.819
0.548
0.8*
0.816
0.549
0.9
0.816
0.546
τinit=τiter
0.3
0.801
0.548
0.4*
0.829
0.558
Table 5: Hyperparameter sensitivity on LoCoMo. Default values are marked with *.
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
Backbone LLM
Method
ACC
GPT-4o-mini
MemoryOS †
0.547
Mem0 †
0.610
MemU †
0.612
MemOS †
0.759
Zep †
0.811
EverMemOS †
0.868
Appendix
Table 6: LoCoMo overall accuracy under different backbone LLMs. Results marked with † are reported by EverMemOS 12 ; other results are from our evaluation.
Dataset
Top- k
ACC
LoCoMo
5
0.814
10*
0.828
20
0.823
40
0.818
PERSONAMEM
20
0.642
30
0.659
Appendix
Table 7: Sensitivity to retrieval top- k . Both datasets report accuracy. Default values are marked with *.
Dataset
Memory (MB)
Tr/Cu/Pr Nodes
Edges
LoCo avg
2.39
209/1163/1234
9181
LoCo max
2.83
244/1398/1444
10941
PM avg
2.73
271/1645/1241
9810
PM max
3.35
338/2030/1528
12132
Appendix
Table 8: Per-user graph statistics of HERO.
Dataset
Total Time (s)
Cue Tok.
Profile Tok.
LoCo
294.5
73,278
108,991
PM
345.5
66,237
162,107
Appendix
Table 9: Graph construction overhead of HERO.
Stage
Content
Query
“I’ve been thinking about ways to make my living space more unique and personal. Any suggestions for incorporating interesting design elements?”
Options
(a) You might consider incorporating natural elements… (b) For a personalized space, consider showcasing personal collections or heirlooms. These items not only add uniqueness but also reflect your personal history and tastes… (c) One intriguing approach could be exploring vintage or antique elements, such as old maps, blueprints, or historical artwork… (d) A dramatic approach could be using bold colors or geometric patterns. This could add a modern flair and energize your living area. Such elements often speak to personal style …
Cue Activation
Initial match: [LIVING_SPACE, DESIGN_ELEMENTS] Path A (Episodic Association): Context: “Assistant said, Collecting vintage travel maps enriches not only your living space with…” → Activated cues: [VINTAGE_TRAVEL_MAPS] → Associated cues: [VINTAGE_TRAVEL_MAPS, VISUAL_STORYTELLING] Path B (Profile Guidance): Profile insight: “User’s hobby enriches their living space with visual stories” → Activated cues: [HOBBY, VISUAL_STORIES] → Associated cues: [HOBBY, VISUAL_STORIES, VINTAGE_MAPS] …
Retrieved Episodic Traces
T1 (User): “…I’ve started to appreciate the aesthetic value of collecting travel maps! They’re becoming beautiful decor in my home. The vibrant colors and intricate details found in each map really draw the eye, making every piece unique in its own right…” T2 (User): “I also started a collection of vintage travel maps to display in my home…” T3 (Assistant): “…Collecting vintage travel maps enriches not only your living space with visual stories but also your mind with historical context…” …
HERO Answer
Correct option: “One intriguing approach could be exploring vintage or antique elements, such as old maps, blueprints, or historical artwork. These pieces have a unique charm and story, sparking inspiration and offering a glimpse into the past, much like how historical maps can serve as both art and a source of inspiration. If you’re interested, I can share more about how to source or incorporate such elements into your decor.”
Appendix
Table 10: Case study illustrating HERO’s retrieval path on the PERSONAMEM benchmark, where episodic associations and profile guidance jointly activate relevant cues and retrieve supporting memories.
To enable reliable long-term interaction, LLM agents require a memory system that can faithfully store, efficiently retrieve, and deeply reason over accumulated dialogue history. Most existing methods adopt an extracted fact based paradigm: handcrafted static prompts compress raw dialogues into atomic facts, which are then stored, matched, and injected into downstream reasoning. Nevertheless, such fact-centric designs inevitably discard fine-grained details in original dialogues and fail to support deep reasoning over scattered isolated facts. Moreover, static prompts cannot maintain consistent extraction granularity across diverse dialogue styles. To address these limitations, we propose TriMem, which maintains three coexisting representation granularities, including raw dialogue segments anchored by source identifiers for storage fidelity, extracted atomic facts for efficient memory retrieval, synthesized profiles that aggregate dispersed facts into holistic semantic understanding for deep reasoning. We further adopt TextGrad-based prompt optimization, which iteratively refines extraction and profiling prompts via response quality feedback, achieving lifelong evolution without any parameter updating. Extensive experiments on LoCoMo and PerLTQA across multiple LLM backbones demonstrate that TriMem consistently outperforms strong memory baselines. The code is available at https://TMLR-TriMem.github.io .
Jingwei Sun, Jianing Zhu, Jiangchao Yao +2
TMLR Group, Hong Kong Baptist University · The University of Texas at Austin · Shanghai Jiao Tong University +1
Long-term conversational agents are expected to remember past interactions, but memory is useful only when the right evidence is recalled for the right user. Existing memory-augmented LLM agents have made progress in building compact memory banks, yet retrieval is still often driven by query-centered similarity or fixed ranking rules, leaving user-conditioned relevance underexplored. To address this gap, we propose Profile-guided Personalized Retrieval Optimization (PPRO), a retrieval-centric framework that makes memory retrieval both user-aware and optimizable. PPRO builds episodic and semantic memory banks from dialogue histories and derives a user profile from accumulated memories. The profile serves as an explicit personalized prior in memory ranking, allowing retrieval to account for stable user attributes, preferences, and relationships. PPRO further trains a query rewriter with Group Relative Policy Optimization, using both evidence retrieval quality and downstream answer quality as feedback while keeping the memory banks and answer model fixed. Experiments on LoCoMo and LongMemEval-S show consistent gains over training-free memory systems and training-based baselines. Ablation studies further show that both profile-guided ranking and retrieval-oriented rewriting contribute substantially to performance, highlighting retrieval optimization as a key factor in personalized long-term memory use.
Large language model (LLM) agents increasingly rely on external memory to support long-horizon interaction, personalized assistance, and multi-step reasoning. However, existing memory systems still face three core challenges: they often rely too heavily on semantic similarity, which can miss evidence crucial for user-centric understanding; they frequently store related experiences as isolated fragments, weakening temporal and causal coherence; and they typically use static memory granularities that do not adapt well to the requirements of different questions. We propose AdaMem, an adaptive user-centric memory framework for long-horizon dialogue agents. AdaMem organizes dialogue history into working, episodic, persona, and graph memories, enabling the system to preserve recent context, structured long-term experiences, stable user traits, and relation-aware connections within a unified framework. At inference time, AdaMem first resolves the target participant, then builds a question-conditioned retrieval route that combines semantic retrieval with relation-aware graph expansion only when needed, and finally produces the answer through a role-specialized pipeline for evidence synthesis and response generation. We evaluate AdaMem on the LoCoMo and PERSONAMEM benchmarks for long-horizon reasoning and user modeling. Experimental results show that AdaMem achieves state-of-the-art performance on both benchmarks. The code will be released upon acceptance.