LLM agents on long-horizon tasks fail in recurring, procedural ways. They mis-paginate an API, resolve the wrong entity, or answer when no answer was asked. We built a pipeline that lets an agent learn from its own history. It first mines short lessons from the agent's own trajectories, one to three per episode. It then consolidates those lessons into a smaller set of guidelines, where each guideline records how many lessons it merged. At inference the agent receives either all guidelines or a selected subset. The pipeline ships in the open-source altk-evolve library and is deployed in IBM's CUGA agent and watsonx Orchestrate platform. We report what we learned building, measuring, and productizing it. Our primary instrument is the AppWorld benchmark, across models spanning 40--92% baseline task completion. The central finding is that the right amount of memory is a property of the model, not the memory. A strong model keeps improving as guidelines are added. DeepSeek-V3.2 gains +9.5 points of task completion and +16.1 points of scenario completion with its full 191-guideline set. A weak model gains less from the same full set than from a small selected subset. gpt-oss-120b starts at 39.9% task completion. It reaches 51.2% with all 199 of its guidelines but 55.4% (mean of two runs) with a selected subset of about 29. Around that result we report what went wrong: a high-support guideline that backfired, provenance silently dropped during consolidation, a swallowed API error that failed every task while producing a plausible log, and a baseline confound that nearly produced a misleading comparison with a prior method. We distill these into recommendations for teams deploying agent memory.
Figures & tables
Figure 1: Dose–response on test_normal . Left: a strong model keeps improving as the injected guideline set grows from 0 to all 191 (“retr.” = 47 high-support guidelines plus 10 retrieved per task). Adjacent points differ by two to four tasks, within noise. The endpoints differ by 16. Right: a weak model gains most from about 29 selected guidelines (mean of two runs, bar shows both). All 199 are no better than a 24-guideline core.
Model (split)
Metric
Easy
Medium
Hard
DeepSeek-V3.2 (normal)
TGC
93.0 → 94.7
81.2 → 97.9
66.7 → 77.8
SGC
84.2 → 84.2
62.5 → 93.8
47.6 → 66.7
gpt-oss-120b (normal)
TGC
66.7 → 82.5
35.4 → 56.2
19.1 → 31.8
SGC
42.1 → 57.9
18.8 → 50.0
4.8 → 9.5
Claude Opus 4.6 (challenge)
TGC
73.6 → 95.8
72.0 → 78.0
73.3 → 83.1
SGC
66.7 → 91.7
58.0 → 70.0
61.5 → 72.3
Table 1: Baseline → best memory configuration, by difficulty tier. For gpt-oss this is the first of its two retrieval runs (56.0 TGC). Capable models gain most on the middle tier. The hard tier is a ceiling for the weak model.
Fixed: all
Best on test
Model
Base
TGC
Δ
Config (#)
TGC/SGC
Δ
GPT-5.5
92.3
95.2
+2.9
all (207)
95.2/89.3
+2.9
Opus 4.6
90.5
–
–
lossy (12) †
94.6/94.6
+4.1
GLM-5
87.5
87.5
0.0
all (72)
87.5/80.4
0.0
DeepSeek-V3.2
79.8
89.3
+9.5
all (191)
89.3/80.4
+9.5
Gemma-4-31B ∗
63.4
64.6
+1.2
all (87)
64.6/45.5
+1.2
Table 2: Memory per model on test_normal . Each model mined its own memory. “Fixed: all” injects every guideline, a rule set before any test run. “Best on test” was chosen among the configurations run on test_normal . † Only the 12-guideline compressed set was run for Opus. ∗ On the 164-task subset its memory runs used (62.5 baseline on all 168). ‡ TGC is the mean of two runs (56.0, 54.8). SGC is from the first.
System
Guidelines
TGC
SGC
Tok/task
DeepSeek-V3.2
ACE-ReAct, no memory
0
72.0
57.1
221K
ACE-ReAct + ACE
106
80.4
73.3
634K
ReAct, no memory
0
79.8
64.3
148K
ReAct + ours (all)
191
89.3
80.4
263K
gpt-oss-120b
Table 3: Comparison with ACE on test_normal . ACE was run in-house on the same models and splits. Note the differing no-memory baselines on DeepSeek (Insight 6). ‡ Mean of two runs (56.0, 54.8). SGC is from the first.
Method
TGC
SGC
Steps/Task
Base CUGA
71.03
54.76
9.63
Ours (lossless)
72.42
58.93
9.31
Δ vs. base
+1.39
+4.17
− 0.32
Table 4: CUGA with the GPT-4.1 model on AppWorld, mean over three trials. Lossless memory improves both completion metrics (TGC over 168 tasks, SGC over scenarios) while slightly reducing steps per task. Base CUGA passes 119.3 tasks and 30.7 scenarios on average. Lossless passes 121.7 and 33.0.
Metric
Baseline
Ours (sup3)
Δ
Mean accuracy
51.7%
55.8%
+4.1
pass^3 (all 3 trials pass)
27.5%
32.5%
+5.0
Avg turns / task
31.3
30.8
− 0.5
Table 5: CUGA with the GPT-4.1 model on the τ -bench retail split (40 test tasks), mean over three trials. Ours here is the sup3 configuration with 12 guidelines. It improves both mean accuracy and the stricter pass^3 measure (which credits a task only when all three of its trials pass) at slightly fewer turns per task.
Arm
Guid.
TGC
SGC
Steps
Tok/task
No memory
0
87.8
84.8
33.8
219K
sup3
29
88.4
83.9
33.8
234K
Lossless
164
93.2
88.4
33.3
297K
Table 6: CUGA with GLM-5.3-Flash on AppWorld test_normal , mean of two runs per arm. TGC ranges: no memory 87.5–88.1, sup3 87.5–89.3, lossless 92.9–93.5. The model mined its own guidelines from CUGA’s train and dev runs.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 2: Source task in watsonx Orchestrate (E-1042). Its trajectory yielded a guideline to convert unsupported receipts before submission.
Figure 3: Cross-task transfer in the expense-claim workflow. Top: the source task invokes submit_expense_claim twice (13 steps, 18.53 s). Repeated calls can be dangerous when tools have expensive side effects, as in finance or insurance. Bottom: on a different task, a critical-memory node retrieves the learned procedure. The assistant converts the TIFF receipt before submitting once (10 steps, 11.35 s), an observed latency reduction of approximately 39%. This demonstrates transfer across related task instances. The timing difference is descriptive, not a controlled estimate.
All experiments in this program were designed, executed, and adversarially verified by the PRIMA multi-agent research-and-verification system [1] under the authors’ direction.