Memp: Exploring Agent Procedural Memory

Runnan Fang, Yuan Liang, Xiaobin Wang, Jialong Wu, Shuofei Qiao, Pengjun Xie, Fei Huang, Huajun Chen, Ningyu Zhang

In the world of Large Language Model (LLM) agents, we’ve seen incredible progress in reasoning and tool use. However, these agents often suffer from a form of "computational amnesia." Even if an agent successfully navigates a complex 30-step workflow today, it might start from square one tomorrow, repeating the same trial-and-error mistakes.

A new paper, "Mem$^P$: Exploring Agent Procedural Memory," introduces a framework to give agents a "procedural memory"—a learnable, updatable repository of how to perform tasks. By distilling past experiences into reusable scripts and trajectories, Mem$^P$ allows agents to become faster, more accurate, and more efficient over time.

TL;DR

Mem$^P$ is a task-agnostic framework that endows LLM agents with a lifelong procedural memory by distilling past trajectories into both concrete examples and abstract "scripts." It significantly boosts success rates (up to 50% improvement) and execution efficiency (cutting steps by half) while demonstrating that memory built by strong models can be effectively transferred to weaker ones.

What Problem Does This Paper Address?

While humans rely on procedural memory to perform tasks like riding a bike or typing without conscious thought, LLM agents typically rely on "static" procedural knowledge—either hard-coded prompts or knowledge baked into their weights during training.

When faced with long-horizon tasks (like planning a multi-city trip or navigating a virtual house), agents often get derailed by minor environment changes or "hallucinate" incorrect tool sequences. Current agents lack a systematic way to:

  1. Extract lessons from successful (and failed) attempts.
  2. Retrieve the right "how-to" guide for a new, similar task.
  3. Update their knowledge base when the environment changes or a better method is found.

Methods

The authors propose the Mem$^P$ framework, which revolves around three core operations:

  • Build: Instead of just saving raw logs, Mem$^P$ "proceduralizes" memory. It distills trajectories into two formats: Trajectories (step-by-step execution traces) and Scripts (high-level, simplified abstractions of the logic).
  • Retrieval: When a new task arrives, the agent uses vector similarity to find relevant memories. The authors tested several strategies, including AveFact, which uses an LLM to extract key facts from a query to improve matching precision.
  • Update: This is the "lifelong learning" component. The framework explores three update regimens:
  • Vanilla: Simply appending new experiences.
  • Validation: Only storing trajectories that resulted in success.
  • Adjustment (Reflexion): If a retrieved memory leads to failure, the agent uses a "reflexion" step to correct the memory in-place, preventing future mistakes.

Datasets

The researchers evaluated Mem$^P$ on two demanding benchmarks:

  1. TravelPlanner: A complex environment requiring agents to use tools (flights, hotels, restaurants) to create itineraries under strict constraints.
  2. ALFWorld: A long-horizon embodied AI benchmark where agents must perform household tasks (e.g., "heat an egg and put it in the garbage can") through text-based interaction.

Key Insights and Ideas

  • The Power of Abstraction: The study found that while raw trajectories are great for nearly identical tasks, Scripts (abstracted logic) generalize much better to new, unseen tasks. Combining both (Proceduralization) yielded the best results.
  • Learning from Failure: The "Adjustment" strategy—where agents actively patch their memory after a mistake—was the most effective. It turned failures into "error-correction" templates, leading to a steady climb in performance as the agent encountered more tasks.
  • Memory Transferability: One of the most exciting findings is that procedural memory is "model-agnostic." You can use a "teacher" model (like GPT-4o) to build a high-quality memory bank and then plug that memory into a smaller "student" model (like Qwen2.5-14B), giving the smaller model a significant performance boost without further training.
  • The Retrieval Ceiling: There is a "sweet spot" for memory retrieval. Providing too many past memories can clutter the context window and introduce noise, leading to a performance plateau or even a slight decline.

Key Results

  • Accuracy Boost: On ALFWorld, the success rate for GPT-4o jumped from 42.14% (no memory) to 77.86% with Mem$^P$.
  • Efficiency Gains: The number of steps required to complete tasks dropped significantly. In one case study, a task that took 23 steps was reduced to just 14 steps (a ~40% reduction) using procedural memory.
  • Cross-Model Gains: Using GPT-4o’s memory, the 14B parameter Qwen model increased its completion rate by 5% and reduced its average step count on TravelPlanner.

Limitations and Future Work

The authors acknowledge a few hurdles:

  • Retrieval Constraints: Currently, the system relies on vector-similarity search with manually crafted keys. Integrating more traditional search methods like BM25 might improve precision.
  • The Reward Gap: The framework currently depends on explicit reward signals (success/failure) provided by the benchmarks. In real-world applications, these signals are often missing.
  • Future Direction: The authors suggest using LLMs as "judges" to self-assess task completion, which would allow the agent to build and update its memory autonomously in environments without built-in reward functions.

Summary updated

BibTeX
@inproceedings{fang2026memp,
  author = {Runnan Fang and Yuan Liang and Xiaobin Wang and Jialong Wu and Shuofei Qiao and Pengjun Xie and Fei Huang and Huajun Chen and Ningyu Zhang},
  title = {{Memp: Exploring Agent Procedural Memory}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.findings-acl.866},
}
Figure