HyperHarness: Learning to Generate Personalized Agent Harnesses from User Histories
Organizations: University of Notre Dame · UC Santa Barbara · Microsoft
Abstract
Personalized LLM agents rely on an agent harness, the surrounding memory and control code, to connect user history with downstream decisions. Existing methods typically employ either a single shared memory workflow across all users, which is efficient to deploy but cannot adapt how evidence is retrieved and interpreted across diverse histories, or per-user harness optimization, which customizes behavior for each user but requires costly repeated candidate evaluation at deployment and suffers from sparse, noisy supervision in raw logs. To address this trade-off, we present HyperHarness, a framework that learns a shared history-to-harness generator to synthesize executable, user-specific retrieval and answer-guidance code directly from user histories. Given a user's permitted history, HyperHarness prompts a construction LLM to write personalized retrieval and guidance functions, while downstream task scores across training users supervise iterative refinements to the shared generator without reference harnesses or answering-model updates. At deployment, the frozen generator constructs a harness for each unseen user in a single pass from history alone, eliminating per-user task-scored search. Across three benchmarks (PersonaMemv3, Mem-PAL, and MemoryCD) and three answering models (Qwen3.5-9B, Qwen3.8-27B, and GPT-5.6-Luna), HyperHarness achieves the highest aggregate score in seven of nine settings and ranks second in the remaining two, improving over the strongest baselines by up to 5.95 points while cutting matched answer-time tokens by 90.32% over long-context prompting. Analyses show that optimization tailors context allocation to each executor, transfers to unseen user clusters, and amortizes adaptation costs.
Figures & tables
| Qwen3.5-9B | Qwen3.8-27B | GPT-5.6-Luna | ||||
| Method | Score | Score | Score | |||
| PersonaMemv3 | ||||||
| No History | 45.54 | 0.79 | 47.46 | 0.84 | 53.90 | 0.69 |
| Long Context | 48.56 | 38.23 | 51.66 | 38.24 | 55.81 | 38.01 |
| BM25 | 46.79 | 4.42 | 51.40 | 4.47 | 56.00 | 4.21 |
| Rolling Memory | 44.51 | 23.97 | 49.03 | 24.12 | 57.79 | 22.21 |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| PersonaMemv3 | Mem-PAL | MemoryCD | ||||
|---|---|---|---|---|---|---|
| Measure | Train | Test | Train | Test | Train | Test |
| Users | 25 | 75 | 50 | 50 | 100 | 223 |
| Items | 1,860 | 5,700 | 418 | 408 | 1,200 | 2,676 |
| Mean items per user | 74.40 | 76.00 | 8.36 | 8.16 | 12.00 | 12.00 |
| MemoryCD | Qwen3.5-9B | Qwen3.8-27B | GPT-5.6-Luna | |||
|---|---|---|---|---|---|---|
| Measure | Initial | Optimized | Initial | Optimized | Initial | Optimized |
| TEST score | 35.52 | 36.97 | 35.26 | 37.88 | 38.72 | 39.43 |
| History characters (k) | 10.09 | 9.93 | 10.12 | 10.12 | 10.12 | 10.12 |
| Guidance characters | 486.3 | 251.5 | 485.6 | 577.0 | 478.8 | 326.3 |
| Reads evidence (% programs) | 91.7 | 0.0 | 71.7 | 87.4 | 70.9 | 3.6 |
| Input tokens | 3,642.12 | 3,569.62 | 3,623 | 3,654 | 3,472 | 3,449 |
| MemoryCD | Mem-PAL | PersonaMemv3 | ||||
|---|---|---|---|---|---|---|
| Method | Qwen3.5-9B | Qwen3.8-27B | Qwen3.5-9B | Qwen3.8-27B | Qwen3.5-9B | Qwen3.8-27B |
| No History | 30.62 | 27.41 | 23.10 | 27.67 | 46.09 | 51.01 |
| Long Context | 33.23 | 34.94 | 28.38 | 25.44 | 46.51 | 51.42 |
| BM25 | 31.15 | 29.87 | 25.61 | 30.04 | 46.14 | 50.39 |
| Rolling Memory | 22.33 | 29.16 | 31.86 | 27.37 | 46.43 | 46.11 |
| Mem0 with RAG | 30.80 | 27.64 | 22.92 | 27.41 | 39.27 | 47.33 |
| Rollout tokens (M) | ||||
|---|---|---|---|---|
| Benchmark | Model | HyperHarness | Meta-Harness | GEPA |
| Qwen3.5-9B | 45.67 | 322.95 | 502.92 | |
| PersonaMemv3 | Qwen3.8-27B | 81.07 | 1,014.91 | 427.10 |
| GPT-5.6-Luna | 39.82 | 444.94 | 321.59 | |
| Qwen3.5-9B | 39.96 | 100.03 | 118.09 | |
| Mem-PAL | Qwen3.8-27B | 37.24 | 330.01 | 99.41 |
| Dimension | Neural Hypernetworks (e.g., PEFT Generation) | HyperHarness (Harness Generation) |
|---|---|---|
| Conditioning input | Task embedding, prompt description, or textual user profile/history | Permitted raw user interaction history |
| Generated artifact | Continuous weights or low-rank adapters ( ) | Discrete executable retrieval and guidance code ( ) |
| Generator parameterization | Continuous neural weights trained end-to-end by gradient descent | Discrete prompts, code, and resources driving a frozen builder LLM |
| Training signal | Backpropagated downstream loss through generated weights | Derivative-free cross-user optimization from downstream task scores |
| Executor requirements | White-box access to a specific open-weight checkpoint and architecture | Frozen open-weight or hosted black-box executor via API/context |
| Mechanism of adaptation | Modulates internal hidden representations and output distributions | Controls memory indexing, multi-query retrieval, filtering, and prompt guidance |
| (a) PersonaMemv3 | ||||||
| Method | Personalization | Recommendation | Restraint | Agentic & Proactive | Overall | |
| Qwen3.5-9B | ||||||
| No History | 42.89 | 26.89 | 69.48 | 38.33 | 45.54 | 0.79 |
| Long Context | 46.34 | 36.65 | 63.03 | 44.94 | 48.56 | 38.23 |
| BM25 | 47.25 | 32.46 | 66.88 | 38.02 | 46.79 | 4.42 |
| Rolling Memory | 43.09 | 35.69 | 59.92 | 36.62 | 44.51 | 23.97 |
| (b) Mem-PAL | ||||||
|---|---|---|---|---|---|---|
| Method | Work & Study | Health & Wellness | Family & Social | Daily Life & Leisure | Overall | |
| Qwen3.5-9B | ||||||
| No History | 25.04 | 27.59 | 21.67 | 26.11 | 27.08 | 3.98 |
| Long Context | 29.66 | 30.03 | 23.18 | 33.33 | 28.96 | 32.72 |
| BM25 | 25.74 | 29.74 | 26.44 | 21.39 | 27.43 | 5.02 |
| Rolling Memory | 24.53 | 29.35 | 26.61 | 35.00 | 28.92 | 63.82 |
| (c) MemoryCD | ||||||
| Method | Item Ranking | Rating Prediction | Review Summarization | Review Generation | Overall | |
| Qwen3.5-9B | ||||||
| No History | 17.52 | 81.50 | 18.22 | 13.12 | 32.59 | 0.96 |
| Long Context | 19.95 | 85.99 | 18.16 | 15.66 | 34.94 | 32.51 |
| BM25 | 16.48 | 83.56 | 18.67 | 13.68 | 33.09 | 2.54 |
| Rolling Memory | 11.50 | 51.46 | 18.06 | 12.32 | 23.34 | 35.40 |
Agent Harness Optimization
Agent harness optimization improves the prompts, tools, memory, workflows, and control code that shape how AI agents act.
See all 220 papers