MemAgent: Learning to Manage Heterogeneous Memory Providers for LLM Agents
Organizations: Tsinghua University · Tencent
Abstract
Current agents remain largely stateless across tasks, limiting their ability to continually improve from prior interactions and making memory essential for long-horizon agentic behavior. Existing memory methods seek to reuse past experience, but most rely on a single memory representation (e.g., trajectories, reflections, skills, structured knowledge) whose effectiveness varies across task distributions. Rethinking this design space, we evaluate 13 memory methods and find that no single method generalizes across benchmarks, revealing the potential of managing heterogeneous memory providers. We formulate agent memory as a routing problem in which a memory agent decides which memory provider to retrieve from, whether to inject short-term memory, and which providers should store the resulting experience. Based on this perspective, we propose MemAgent, featuring a content-aware routing architecture and a training-data synthesis pipeline. The routing architecture combines content-aware probing before retrieval, short-term memory gating during execution, and selective multi-provider storage, while the training pipeline synthesizes phase-specific supervision for routing decisions. Across GAIA, WebWalkerQA, and xBench-DS, MemAgent improves average accuracy by 10.0% and outperforms every individual memory method across all three benchmarks. These gains come with less than 0.3% routing overhead and a 12% reduction in average task steps.
Figures & tables
| Method | GAIA | WebWalkerQA | xBench-DS | Avg. | |||
|---|---|---|---|---|---|---|---|
| Overall | Level 1 | Level 2 | Level 3 | ||||
| No Memory | 58.8 | 73.6 | 54.7 | 42.3 | 69.4 | 69.0 | 65.7 |
| Individual memory methods | |||||||
| Agent-KB ( Tang et al., 2025 ) | 60.0 +1.2 | 73.6 | 54.7 | 50.0 | 70.0 +0.6 | 71.0 +2.0 | 67.0 +1.3 |
| LightWeight ( Zhang et al., 2026a ) | 59.4 +0.6 | 67.9 | 61.6 | 34.6 | 73.5 +4.1 | 73.0 +4.0 | 68.6 +2.9 |
| ExpeL ( Zhao et al., 2024 ) | 61.8 +3.0 | 73.6 | 61.6 | 38.5 | 77.1 +7.6 | 74.0 +5.0 | 71.0 +5.2 |
| Component | Per-task cost | Notes |
|---|---|---|
| Memory injection (tokens inserted into context): | ||
| Begin (long-term retrieval) | 370 tokens | median 268, max 2.2K |
| In (short-term, per step) | 210 tokens | 3.8 steps/task triggered |
| Total injected per task | 1.2K tokens | 0.5% of task tokens |
| Routing cost (MemAgent-specific): | ||
| Probe (13 providers, parallel) | 75 ms | one-time at Begin |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Provider | Memory Paradigm | Storage Strategy | Retrieval Mechanism |
|---|---|---|---|
| Voyager ( Wang et al., 2024 ) | Exploration memory | Refined trajectory summaries with embeddings | Semantic search over task similarity |
| ExpeL ( Zhao et al., 2024 ) | Experience learning | Dual-path: insights from all outcomes + refined trajectories from successes | Hybrid insight + trajectory retrieval |
| Generative ( Park et al., 2023 ) | Scored memory pool | Task queries + trajectory summaries | Vector retrieval + LLM importance scoring |
| DILU ( Wen et al., 2024 ) | Query-trajectory mapping | Query embeddings + trajectory summaries | Semantic search on query similarity |
| AWM ( Wang et al., 2025c ) | Workflow templates (SOPs) | LLM-induced abstract workflow patterns | Vector search over workflow templates |
| Mobile-E ( Wang et al., 2025b ) | Keyword-indexed tips | Tips (text) + Shortcuts (structured sequences) | Keyword-based retrieval |
| Provider | Emb. | LLM-R | Key Parameters | |
|---|---|---|---|---|
| Voyager ( Wang et al., 2024 ) | ✓ | 1 | ✗ | Pure semantic search; returns 6-sentence max trajectory summary with hierarchical distillation |
| ExpeL ( Zhao et al., 2024 ) | ✓ | 3 | ✗ | Hybrid search: TF-IDF 0.3, semantic 0.7; dual-path insight + trajectory retrieval |
| Generative ( Park et al., 2023 ) | ✓ | 3 1 | ✓ | Semantic search returns 3 candidates; LLM importance scoring selects top-1; 150 words output |
| DILU ( Wen et al., 2024 ) | ✓ | 1 | ✗ | Pure semantic search on query embeddings; ultra-concise step format ( 150 words) |
| AWM ( Wang et al., 2025c ) | ✓ | 1 | ✗ | Pure embedding search; abstract workflow templates with entity generalization; 200 words |
| Mobile-E ( Wang et al., 2025b ) | ✗ | 2+2 | ✗ | Jieba keyword tokenization; 2 tips + 2 shortcuts; structured action sequences |
| Phase | Dimension | Weight | Dir. | Description |
| Begin | Utilization | 0.6 | Did the task agent reference or use information from the retrieved memory in its subsequent actions? | |
| Relevance | 0.4 | How relevant was the retrieved memory to the specific task? | ||
| In ( Query ) | Helpfulness | 0.4 | Did the agent use information from the injected short-term memory? | |
| Progress | 0.4 | Did the injection help advance the task? | ||
| Noise | 0.2 | Did the injection distract or confuse the agent? | ||
| In ( NoOp ) | Appropriateness | 0.5 | Was skipping retrieval a reasonable choice given the current state? |
| Phase | Dimension | 0 (lowest) | 2–3 (borderline) | 5 (highest) |
|---|---|---|---|---|
| Begin | Utilization | Memory completely ignored | Some overlap, likely coincidental | Agent directly built upon specific memory content |
| Begin | Relevance | Completely irrelevant domain | Somewhat related, not specifically useful | Perfectly targeted, critical information |
| In (Query) | Helpfulness | No reference to injected content | Minor overlap, uncertain attribution | Agent directly leveraged specific injected details |
| In (Query) | Noise | No distraction | Some off-topic exploration triggered | Agent clearly confused, pursued wrong direction |
| In (NoOp) | Appropriateness | STM had highly relevant content that should have been retrieved | Borderline; STM has marginal content | STM empty or clearly irrelevant; NoOp optimal |
| In (NoOp) | Missed Opp. | Nothing valuable missed | Missed non-critical information | Missed critical information; retrieval would have been breakthrough |
| Section | Min to Show | Max Items | Priority |
|---|---|---|---|
| Collected Data | 2 facts | 8 | Highest |
| Pages Visited | 3 URLs | 15 | Medium |
| Recent Searches | 4 queries | 8 | Lowest |
| Provider | Storage Description | Retrieval Description | Gate |
|---|---|---|---|
| LightWeight | Extracts strategic (planning/decisions) and operational (tools/techniques) memories after task success | Provides long-term strategic/operational experience | Success |
| Agent-KB | Summarizes trajectories into structured fields: Agent Planning, Search Agent Planning, Agent Experience | Student Guidance (reference plans) and Teacher Guidance (lessons learned) | Success |
| SkillWeaver | Analyzes trajectories to identify core algorithms, generates generalized Python functions | Matches relevant skills, dynamically wraps them as tools | Success |
| ExpeL | Extracts Insights (Tips or Warnings) from all outcomes; stores refined trajectories on success | Hybrid retrieval of Insights and successful trajectories | All |
| Voyager | Generates trajectory summaries from all outcomes, stored as JSON with embeddings | Semantic search for most similar historical tasks | All |
| DILU | Stores query embeddings and trajectory summaries from both successes and failures | Semantic search on query similarity | All |
| Method | Overall | L1 | L2 | L3 |
|---|---|---|---|---|
| Qwen3.5-4B w/o Training | 63.6 | 71.7 | 67.4 | 34.6 |
| MemAgent (Qwen3.5-4B) | 69.7 | 83.0 | 67.4 | 50.0 |
| Qwen3.5-9B w/o Training | 63.6 | 75.5 | 61.6 | 46.2 |
| MemAgent (Qwen3.5-9B) | 70.9 | 81.1 | 69.8 | 53.8 |
| Correct | GAIA | WebWalkerQA | xBench-DS |
|---|---|---|---|
| 0 (unsolvable) | 12.7% | 10.6% | 6.0% |
| 1–2 (routing-critical) | 12.1% | 6.5% | 8.0% |
| 3–6 | 11.5% | 8.2% | 7.0% |
| 7–13 | 28.5% | 23.5% | 44.0% |
| 14 (all correct) | 35.2% | 51.2% | 35.0% |
| Method | Tokens injected | Avg. steps | Steps |
|---|---|---|---|
| No Memory | N/A | 9.1 | N/A |
| InsightGraph | 57 | 8.6 | 0.5 |
| LightWeight | 154 | 8.3 | 0.8 |
| Voyager | 178 | 8.3 | 0.8 |
| DILU | 184 | 8.3 | 0.8 |
| Generative | 195 | 8.5 | 0.6 |
| Family | Members | Indexable unit |
|---|---|---|
| Similarity-retrieval | Voyager, DILU, Generative, Cheatsheet | Trajectory or query embedding |
| Structural-abstraction | AWM, SkillWeaver, Memp | Workflow template, executable function, or procedural script |
| Insight-accumulation | ExpeL, Agent-KB, InsightGraph, Mobile-E, EvolveR, LightWeight | Atomic, composable insight fragments |
LLM Agent Memory
Large language model agent memory lets agents retain, organize, retrieve, and update information across interactions and long-running tasks.
See all 373 papers