Large language model (LLM) agents increasingly operate over long Web interaction histories, making memory management critical for reliable and efficient decision making. Existing methods primarily optimize storage, retrieval, or compression, but the memories most semantically relevant to the current state are not necessarily those that most improve the agent's action. We introduce MemCredit, a decision-centric memory framework that shifts memory selection from semantic relevance to decision utility. MemCredit estimates the state-, reference-context-, and policy-conditional marginal contribution of individual memories through controlled counterfactual interventions, and distills these intervention-derived credits into a lightweight utility estimator. At inference time, semantic relevance is used only for high-recall candidate generation, while predicted utility arbitrates which memories are retained under a fixed token budget, without modifying the underlying agent policy or requiring additional environment interaction. We evaluate MemCredit on ALFWorld and WebShop against representative memory baselines. On ALFWorld, MemCredit achieves 86.57 SR@50 under a 500-token historical-memory budget, compared with 65.67% for BM25 retrieval. Counterfactual analysis further shows that memory utility is sparse, strongly state dependent, and poorly captured by semantic relevance. These results suggest that decision utility provides a more effective principle than relevance alone for long-horizon agent memory management.
Figures & tables
Figure 1. Motivation of MemCredit. Semantic relevance does not necessarily imply decision utility. A memory that appears less related to the current observation may be critical for avoiding an incorrect action, whereas a highly relevant memory can be redundant.
Figure 2. Performance–memory Pareto comparison on WebShop. MemCredit achieves the highest task score while using only 152.1 memory tokens per decision, about 2.8× fewer than MemArbiter and approximately 3.9× fewer than retrieval-based alternatives. The desirable region is the upper left: higher task performance with lower memory cost.
Figure 3. Overview of MemCredit. Interaction histories are organized into atomic memories, whose policy-conditional decision utility is estimated through controlled counterfactual interventions and distilled into a lightweight utility estimator. At inference time, semantic relevance provides high-recall candidates, while predicted utility arbitrates memory selection under a fixed token budget for the unchanged agent policy.
Memory Budget
Method
Task-wise SR@50 (%)
Overall ↑
Recovery ↑
Failed Rep. ↓
Pick (24)
Look (18)
Clean (31)
Heat (23)
Cool (21)
Pick Two (17)
500
Flat Recency
70.83
61.11
58.06
52.17
57.14
41.18
57.46
40.8
43.2
BM25
87.50
83.33
74.19
47.83
57.14
35.29
65.67
46.3
38.5
Dense Retrieval
87.50
83.33
77.42
60.87
66.67
47.06
71.64
53.7
32.1
Failure-Aware
83.33
88.89
74.19
56.52
66.67
47.06
70.15
59.6
27.6
State-Aware Retrieval
91.67
88.89
80.65
65.22
71.43
52.94
76.12
63.4
24.5
Table 1. Performance on 134 unseen ALFWorld tasks under two historical-memory budgets. We report SR@50 (%) overall and across six task categories, with category sizes shown in parentheses. Recovery and failed-action repetition characterize post-failure behavior.
Method
Score ↑
Mem. Tokens ↓
Repeat Search ↓
Invalid Act. ↓
Steps ↓
History-based
Full / Truncated History
0.356
599.1
0.278
0.353
12.9
Flat Recency
0.328
490.3
0.292
0.357
13.0
Relevance-based Retrieval
BM25
0.407
597.0
0.260
0.352
12.8
Dense Retrieval
0.451
596.8
0.252
0.346
12.7
Table 2. Overall performance on WebShop. Score denotes the official WebShop task score, and memory tokens are averaged over decision steps. Lower memory usage, repeated-search rate, invalid-action rate, and trajectory length are better.
Figure 4. Cross-model generalization on ALFWorld. Cross-model comparison under a fixed 500-token memory budget for (a) SR@15 and (b) SR@50. Only the action-generation model is changed; all other agent components and evaluation settings remain fixed.
Quantity
Estimate [95% CI]
Relevance–utility alignment
Combined Spearman ρ
−0.011[−0.073,+0.077]
Dense-only Spearman ρ
−0.191
Broad-only Spearman ρ
+0.135[+0.062,+0.209]
Utility concentration
Mean memory credit
+0.054[+0.030,+0.080]
Table 3. Summary of counterfactual memory-utility analysis. Confidence intervals are obtained by task-clustered bootstrap.
Figure 5. Counterfactual analysis of memory decision utility. (a) Relevance–utility association changes across task coverage and is near zero on the combined set. (b) Mean memory credit varies substantially across decision states, with the strongest effect after failures. (c) Decision utility is highly sparse: most interventions produce no measurable change. Error bars denote task-clustered 95% bootstrap confidence intervals.
Feature Set
Spearman ↑
AUPRC ↑
AUROC ↑
Relevance-only
−0.031
0.097
0.483
Content-only
+0.016
0.122
0.493
Failure-only
+0.095
0.184
0.658
Full
+0.220
0.270
0.744
Shuffled labels
+0.048
0.146
–
Table 4. Task-disjoint prediction of intervention-derived decision utility using 5-fold GroupKFold by task ID. The shuffled-label model serves as a negative control for spurious fitting.
Variant
SR@50 (%) ↑
Scoring strategy
Relevance-only (BM25)
65.67 ( −18.66 )
Failure-only heuristic
70.15 ( −14.18 )
Relevance + utility ( λ=0.5 )
78.36 ( −5.97 )
Utility-only (full features)
84.33 ( + 0.00)
Utility features
Table 5. Ablation of MemCredit on ALFWorld under a 500-token memory budget. Δ is measured relative to utility-only ranking with full features.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Method
Δ SR (pp)
Recovery (%)
Failed Rep. (%)
Flat Recency
−8.21
40.8
43.2
Dense Retrieval
+5.97
53.7
32.1
Failure-Aware Retrieval
+4.48
59.6
27.6
State-Aware Retrieval
+10.45
63.4
24.5
MemArbiter
+17.17
68.2
22.4
MemCredit (hybrid)
+12.69
69.7
20.6
Appendix
Table 6. ALFWorld budget-500 comparison relative to BM25 (65.67% SR@50). All 134 tasks have valid paired records. Recovery denotes the post-failure recovery rate and Failed Rep. the failed-action repetition rate; both are taken from the main comparison.
Quantity
Estimate [95% CI]
Mean memory credit
+0.054 [ +0.030 , +0.080 ]
Spearman (relevance, utility), combined
−0.011 [ −0.073 , +0.077 ]
Spearman, dense-only (11 tasks)
−0.191
Spearman, broad-only (44 tasks)
+0.135 [ +0.062 , +0.209 ]
Q1–Q5 relevance-quintile utility gap
−0.009 [ −0.072 , +0.069 ]
Utility zero-share
0.869
Appendix
Table 7. Decision-utility causal statistics (combined set). “Decision utility” is the credit of including one memory item relative to the reference context; positive means inclusion improves the decision, and the reported statistics use the single-removal reference context S=Ct∖{mi} .
State type
Mean credit [95% CI]
Zero share
failure_context
+0.176 [ +0.077 , +0.257 ]
0.722
normal_progress
+0.060 [ +0.007 , +0.120 ]
0.863
repeat_risk
+0.035 [ −0.019 , +0.080 ]
0.923
constraint_sensitive
+0.033 [ −0.010 , +0.079 ]
0.900
reference_sensitive
+0.023 [ −0.023 , +0.076 ]
0.853
subgoal_transition
−0.005 [ −0.036 , +0.031 ]
0.962
Appendix
Table 8. Mean memory credit by state type (combined set).
Figure 6. ALFWorld performance across baseline failure density. Tasks are partitioned into terciles using failure density measured from frozen BM25 trajectories, and the same partition is used for both methods. MemCredit consistently improves over BM25 across all three groups. Error bars denote task-bootstrap 95% confidence intervals; annotations report paired SR@50 differences and their 95% confidence intervals.