Agents learn lasting lessons from mistakes with lightweight updates

Don't Forget What You Just Learned: Self-Directed Repair Turns Agent Mistakes Into Lasting Lessons

Artificial IntelligenceMachine Learning

Summary

Many AI agents forget what they learn from their mistakes, so they keep making the same errors repeatedly. The authors introduce Self-Direction, a method that helps agents reflect on their errors and quickly learn from them by adding small memory modules without changing their main knowledge. This helps the agents improve consistently over time and apply what they’ve learned to new but similar problems. Their experiments show the method boosts success rates and makes agents better at avoiding repeated mistakes.

What this means in practice

  • For ai developers: Increase the reliability of AI assistants by enabling them to remember and reuse fixes for errors across tasks automatically.
  • For automated workflow engineers: Create adaptive tool-using agents that improve task success rates by accumulating and reapplying lessons from past failures.

Authors

Yuval Kansal, Karen Ullrich, Polina Kirichenko, Ilia Kulikov, Niraj K. Jha, Mohammad Pezeshki, Mark Ibrahim

Abstract

Intelligent agents should learn from their mistakes so that experience leads to continuous improvement. Yet today's agents recover from a mistake only temporarily: in-context reflections are easily forgotten across sessions and compete for limited context, while full-parameter fine-tuning is expensive and can interfere with existing capabilities. We introduce Self-Direction, a mechanism for agents to learn from mistakes that combines the benefits of temporary in-context retries and policy updates. When an agent fails a task, it reflects on its own trajectory in order to extract a lesson and immediately distills it into a lightweight low-rank adapter. By keeping the original weights frozen, Self-Direction prevents adapter training from overwriting base-model parameters while training additional parameters equivalent to ~0.02% of the base model's parameter count for each adapter. The agent then saves these adapters in a persistent library of lessons, automatically routing them to solve related problems later. Experiments with agents based on open-weight models from the Qwen family across open-ended research (GAIA), tool-use workflows (Claw-Eval), and terminal tasks (Terminal-Bench 2.1) show that our method improves overall success rates by 8.9 to 17.0 percentage points and performs competitively with frontier systems. We find that Self-Direction reduces repeated mistakes across future encounters of a task, nearly doubling the reliability of an agent's corrections. Learned lessons also transfer: a handful of adapters generalize to dozens of new tasks without additional training. Ultimately, this self-directed repair transforms everyday mistakes into lasting lessons.