arXiv(opens in a new tab)cs.AIOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.31846

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

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

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yuval Kansal1,2,∗^{1,2,*}, Karen Ullrich2^{2}, Polina Kirichenko2^{2}, Ilia Kulikov2^{2}, Niraj K. Jha1^{1}, Mohammad Pezeshki2^{2}, Mark Ibrahim2^{2}

1^{1}Princeton University, 2^{2}Meta FAIR

*Work done during an internship at Meta FAIR.

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%\sim 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.

Date: October 20, 2026

Website: https://self-direction.github.io/

Correspondence: yuvalkansal@princeton.edu, marksibrahim@meta.com

Figure

1 Introduction

Modern agents can often correct their mistakes and complete the task at hand. Yet, this recovery is ephemeral: In a new session, the agent is just as likely to repeat the same mistake (Rabanser et al., 2026; Gonzalez-Pumariega et al., 2026). As agents tackle longer-horizon workflows, each additional step introduces another opportunity for error. Even frontier agents make mistakes across tool use, coding, and general assistant tasks (Yuan et al., 2026; Bandi et al., 2026). Repeatedly correcting the same mistakes is costly, leads to inconsistent performance, and leaves the potential for continuous improvement unrealized. Our goal is not just to fix an agent's mistake in the current session, but to learn persistent lessons to avoid repeating the mistake in the future.

Existing approaches encapsulate lessons either in context or in model weights, but enable only part of the desired behavior. Context-based methods, e.g., demonstrations, prompt optimization, reflection, hard-coded skill files, and persistent agent harnesses, can change behavior quickly during deployment (Shinn et al., 2023; Majumder et al., 2024; Zhao et al., 2024). They enable agents to accumulate experience without access to model parameters, but their lessons remain external: They must be retrieved when relevant, compete for limited context, and may not reliably influence behavior on related future tasks.

Conversely, parameter-based methods, such as supervised fine-tuning and reinforcement learning, can produce more persistent behavioral change, but typically require separate training processes, substantial data and optimization, and careful management of interference to reduce the risk of catastrophic forgetting (Luo et al.,

Figure

Figure 1 Self-Direction turns an agent's own failures into reusable LoRA lessons. Left: Current agents fail to reliably reuse lessons learned by spending extra resources correcting a mistake. Self-Direction enables storage and reuse of lessons to avoid repeated mistakes. Right: On Terminal-Bench 2.1, Self-Direction lifts performance from 51.7% to 65.5%, outperforming existing baselines and frontier models 1^{1}.

2023; Gu et al., 2024; Ven et al., 2025). What is missing is a continuous mechanism to fix mistakes in the current session and avoid repeating mistakes in future sessions, without impacting existing capabilities.

To address this gap, we introduce Self-Direction, a mechanism for agents to learn from their mistakes. After a failed execution, the agent examines its trajectory to extract a lesson and then distills the lesson into a lightweight Low-Rank Adaptation (LoRA) repair adapter. Self-Direction turns feedback about a mistake from the environment or a user into a LoRA lesson that can be employed immediately to retry the current task and retained for future use. Self-Direction uses a router to determine if an existing lesson is relevant to the current task based on the similarity between the current task description and descriptions of previously seen tasks, enabling reuse of lessons on future tasks. Each lesson is encoded in a separate adapter while the base model and previously learned adapters remain frozen, preventing new training from overwriting existing parameters. Furthermore, each lesson requires only a modest amount of memory (e.g., ∼\sim 85 MB for Qwen3.6-27B), allowing the library of lessons to grow with the agent's experience. An overview of Self-Direction is presented in Fig. 3.

We evaluate Self-Direction on open-weight agents across terminal coding, tool-use, web search, and personal assistant tasks. We find:

  1. Self-Direction increases success across task types. By repairing mistakes, Self-Direction raises the task success rate by 17.0 percentage points on GAIA (Mialon et al., 2023), 13.8 points on Terminal-Bench 2.1 (Merrill et al., 2026), and 8.9 points on Claw-Eval (Ye et al., 2026) (tool-using workflows), outperforming in-context reflections and reflections distilled into Skills.md. On Terminal-Bench 2.1, official scores show that Self-Direction with a 27B-parameter Qwen agent outperforms GLM-5.1, a model with approximately 30×30\times more parameters, and performs competitively with frontier closed-weight systems including Claude Opus 4.7 and Gemini 3.1 Pro (see Section 4).

  2. Self-Direction prevents repeated mistakes across future encounters of a task. Self-Direction repairs are reliable across repeated encounters. It nearly doubles the recovery rate across three encounters compared with base-agent retrying. On Claw-Eval, Self-Direction raises pass 3^{3}, which measures success in all three independent runs, from 51.6% to 64.6%, achieving performance competitive with that of frontier agents that use GPT-5.4, Kimi-K2.6, and Gemini 3.1 Pro (see Section 4.2).

1^{1}Frontier model numbers were obtained from https://www.tbench.ai/?version=2.1.

  1. Self-Direction generalizes to new tasks without sacrificing existing capabilities. With a library capped at just three adapters, occupying 256 MB of memory in total, Self-Direction raises task success on GAIA from 36.4% to 52.7%. Lessons learned exclusively from easier GAIA tasks improve success on unseen, harder tasks by 10.5 points, whereas three adapters learned from Claw-Eval operations tasks raise success on workflow tasks from 75.0% to 87.5%, without additional training. Notably, Self-Direction enables these gains without interfering with existing capabilities (Section 4.3).

Together, these results bring open-weight agents closer to continuous improvement, where lessons accumulate with continued use.

References (60)