Memory as a Controlled Process: Learned Adaptive Memory Management for LLM Agents

Eric Hanchen Jiang, Zhi Zhang, Yuchen Wu, Levina Li, Dong Liu, Xiao Liang, Rui Sun, Yubei Li, Edward Sun, Haozheng Luo, Zhaolu Kang, Aylin Caliskan, Kai-Wei Chang, Ying Nian WuarXiv 2026

TL;DR

MEMCON introduces a novel framework that treats LLM agent memory management as a controlled Markov Decision Process (MDP) rather than a static pipeline. By learning an online policy via a lightweight contextual bandit, it adaptively decides when, what, and how much to retrieve, consolidate, or forget without adding any extra LLM calls. Across multiple benchmarks, frameworks, and backbones, it boosts task success by up to 15.2 points while slashing token costs by 5–20%.

What Problem Does This Paper Address?

External memory systems are crucial for allowing Large Language Model (LLM) agents to accumulate experience across tasks. However, nearly all existing approaches treat memory access as a static pipeline with fixed, hand-designed heuristics (e.g., always retrieving a hard-coded top-$k$ number of items).

This static view creates a major bottleneck: optimal memory behavior is fundamentally context-dependent. For instance, retrieving aggressively during early task stages clutters the context window with irrelevant data because memory is sparse. Conversely, conservative retrieval misses crucial macro-level plans for recurring goals. While some advanced systems use the LLM itself as a memory controller to achieve adaptivity, doing so introduces substantial latency and prohibitive token overhead. MEMCON addresses this gap by introducing a learned, lightweight, and adaptive control layer that sits on top of any memory storage backend with zero extra LLM calls.

Methods

The authors formalize agent memory management as a Memory MDP ($M_{\text{mem}} = \langle S, A, T, R, \gamma \rangle$). Instead of invoking memory endpoints with static hyperparameters, MEMCON dynamically selects memory operations based on the current task and memory state.

  • State Space ($S$): Fuses task progress signals (goal type, step phase, a "stuck" indicator, and locations visited) with memory status signals (memory size, plan availability, and learning phase). This state is discretized into a compact, hashable key ($\phi(s)$) to enable rapid online convergence.
  • Action Space ($A$): Includes operations such as RETRIEVE (with policy-chosen parameters for top-$k$, insight-$k$, and graph hop depth), PLANINJECT (prepending a generalized macro-plan), RE-RETRIEVE (re-issuing retrieval with alternative query suffixes to escape action loops), CONSOLIDATE, FORGET, and NOOP.
  • Online Policy Learning: MEMCON learns its policy online during deployment using a tabular contextual bandit with Upper Confidence Bound (UCB) exploration. It requires zero pretraining, initializing instead with intuitive, human-readable warm-start priors. Q-values are updated at the end of each task via reverse-discounted Monte Carlo credit assignment based on binary environment success.
  • Backend-Agnostic Wrapper: MEMCON acts as a thin wrapper that intercepts the abstract retrieve and store entry points of any underlying memory implementation (e.g., flat vector stores, graph-structured memories, or skill libraries), cleanly separating the storage layer from the control layer.
Figure 1: Overview of MEMCON. (Left) Task streams from ALFWorld, PDDL, and ScienceWorld are executed through three agent frameworks (Lobster, LangGraph, Agent-FW) sharing one LLM backbone. (Middle) The Memory MDP runs four steps per retrieval: extract a compact state ϕ(s) from task + memory signals; select an action via the UCB policy over Q(ϕ, a); the backend-agnostic wrapper issues retrieval to the inner backend with policy-chosen top k/insight k/hop; retrieved context (optionally plus an injected success plan) is fed to the LLM, and the episode is scored (+1 success, −0.5 failure, plus efficiency bonus). (Right) Online learning: the action space is {RETRIEVE (varying depth), PLANINJECT, RE-RETRIEVE, CONSOLIDATE, FORGET, NOOP}; after each episode the reverse-discounted reward γ|ep|−j−1ri updates every visited (ϕj, aj).

Datasets

MEMCON was comprehensively evaluated across 6 benchmarks covering two distinct operational regimes:

  • Interactive Decision-Making (Long-horizon, multi-step): ALFWorld (household tasks), PDDL Planning (classical logic puzzles), and ScienceWorld (elementary science experiments).
  • Knowledge / Web / Tool-Use QA: TriviaQA (open-domain QA), WebWalkerQA (multi-hop web traversal), and GAIA (general AI assistant questions).

Evaluations were conducted across 3 architecturally distinct agent frameworks (Lobster, LangGraph, and Microsoft Agent-Framework) using 3 different LLM backbones (GPT-4.1-mini, Claude Sonnet-4, and DeepSeek-V3.2).

Key Insights and Ideas

  • Memory Access as a Control Problem: Memory management shouldn't be a static engineering choice. An agent's optimal memory operation changes dynamically based on its learning phase, task progress, and whether it has encountered a specific failure mode (like getting stuck).
  • Less is More: Aggressive retrieval often hurts performance on simple or novel tasks by diluting the prompt context. MEMCON successfully learns to suppress retrieval (NOOP) when memory is sparse or irrelevant.
  • The Power of Macro-Plans: For recurring goal types, replaying an object-generalized template of a prior success (PLANINJECT) prevents the agent from getting lost in low-level step details, outperforming generic nearest-neighbor trajectory lookups.
  • Table Lookups over LLM Calls: Adaptive memory control does not require heavy deep reinforcement learning or secondary LLM orchestrators. A lightweight tabular bandit can converge within tens of tasks, executing via millisecond-scale table lookups.
Figure 2: Step-by-step case study on two qualitatively different queries. Left (Case 1, WebWalkerQA): a multi-hop financial query that requires the agent to navigate the web and identify a specific date. In Step 2 the controller is in the cold learning phase (Na(ϕ)=0), so the UCB bonus is +∞and the policy explores with a shallow RETRIEVE action. After Step 3 reports is stuck=True, the controller switches to RE-RETRIEVE (Step 4) with the augmented query suffix, which then succeeds; the failure-then-recovery sequence updates Q-values via Eq. 25 so that RE-RETRIEVE receives more credit in stuck states for future episodes. Right (Case 2, GAIA): a numeric reasoning query for which a generalized success plan already exists (plan available=True, learning phase=warm). The policy directly selects PLANINJECT; the prepended template guides the LLM to use the leap-year constant on the first try, and the resulting high reward reinforces the PLANINJECT entry for future composite-reasoning queries. Each step shows the exact MDP state, the policy decision (with rule and parameters), the environment outcome, and the resulting Q-update.

Key Results

  • State-of-the-Art Performance: MEMCON consistently achieved the highest or near-highest task success rates across all 54 evaluated configurations, outperforming 9 strong memory baselines (including G-Memory, Voyager, and LatentMem). For example, it achieved 67.9% success on ALFWorld using GPT-4.1-mini (Lobster), delivering a substantial leap over the baseline.
  • Simultaneous Token Savings: While standard retrieval-augmented generation (RAG) methods trade higher token consumption for accuracy, MEMCON simultaneously reduced average input token consumption per task by 5–20% by actively choosing shallow retrievals or NOOP actions when deep context was unnecessary.
Token cost vs. task success across different backbones and benchmarks, showing MEMCON consistently occupying the optimal bottom-right quadrant.

Limitations and Future Work

  • Coarse State Discretization: The state space relies on hand-crafted binning thresholds (e.g., specific cutoffs for memory size or step count). Future work could explore automated or continuous state representations to handle more complex environmental signals.
  • Opaque Intra-Episode Transitions: Because environment transitions are driven by the black-box LLM agent, the authors treat the system as a contextual bandit with episode-level feedback. Developing a fully sequential intra-episode MDP model could unlock even finer control.
  • Regex-Based Generalization: The generalized plan injection mechanism utilizes a regex rewriter to replace instance-specific identifiers. This approach might struggle or degrade when encountering highly novel vocabularies or unstructured action spaces.

Summary updated

BibTeX
@misc{jiang2026memory,
  author = {Eric Hanchen Jiang and Zhi Zhang and Yuchen Wu and Levina Li and Dong Liu and Xiao Liang and Rui Sun and Yubei Li and Edward Sun and Haozheng Luo and Zhaolu Kang and Aylin Caliskan and Kai-Wei Chang and Ying Nian Wu},
  title = {{Memory as a Controlled Process: Learned Adaptive Memory Management for LLM Agents}},
  year = {2026},
  eprint = {2607.13591},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.13591},
}
Figure