Recursive Self-Improvement for AI Agents: Why Harness Experience Breaks When the Model Changes, and How Self-Improvement Memory Fixes It

    This article explains recursive self-improvement (RSI) for LLM-powered agents and why accumulated optimization experience can instantly become useless when the underlying model is swapped out. It covers the harness layer — prompt templates, tool orchestration, guardrails, and context management — where most RSI work actually happens, the performance drop that appears when a harness tuned on an older model is moved onto a stronger new one, and the root cause: only the results get carried over, not the reasoning behind them. It then describes self-improvement memory (SIM), a mechanism that records what changed, why it changed, and the conditions in which the change is valid, so that experience can be inherited across model families, together with the engineering practices needed to make it work in production.

    As large language models (LLMs) power agents at scale, “let the AI get better on its own” has moved from an aspiration to an engineering problem that teams are actively competing to solve. Recursive self-improvement (RSI) comes up repeatedly in that context. It describes a system in which an AI improves itself through some mechanism, and the improved version then continues improving itself more efficiently, closing a positive-feedback loop of evolution.

    The engineering reality is far harder than the concept. This article focuses on a long-overlooked problem: why accumulated optimization experience stops working the moment the underlying model changes, and how a self-improvement memory mechanism can let that experience be “inherited” across model families.

    1. The Misunderstood Part of “Improvement”: A Harness Layer Around the Model

    A common misconception is that RSI means repeatedly fine-tuning the model’s underlying weights, which number in the hundreds of billions. For most teams, that kind of change is both expensive and risky, with a very long iteration cycle. What actually gets adjusted at high frequency is usually an engineering layer wrapped around the model, commonly referred to in the industry as a “harness.”

    This harness typically contains:

    • Prompt templates: define the model’s role, reasoning path, and output constraints.
    • Tool use and orchestration: which external capabilities the model can call, and in what order they are chained.
    • Guardrails and validators: filter, retry, and correct outputs.
    • Context management: how to trim, retrieve, and inject the necessary memory.

    A minimal illustrative harness structure:

    1. harness:
    2. system_prompt: "You are a rigorous code review assistant..."
    3. tools:
    4. - name: run_tests
    5. - name: search_docs
    6. guardrails:
    7. - rule: max_retry = 3 # limit added after an infinite loop in a retry path
    8. - rule: reject_if_no_diff # prevent empty submissions
    9. context:
    10. retrieval: vector_store
    11. max_tokens: 32000

    The vast majority of RSI engineering work is really about polishing this harness, not rebuilding the “brain.”

    2. The Fatal Discontinuity: New Brain, Worse Performance

    Engineers running cross-model migration experiments often observe a counterintuitive result: a harness that took hundreds of iterations to tune and performs well on an older model, when applied directly to a stronger new model, does not improve the overall score — it actually scores below the new model’s own default harness.

    The reason is not mysterious. A large number of the rules, interceptors, and prompts in an older harness are essentially targeted fixes for specific behaviors of the old model: some restrictions exist to avoid that model’s hallucination tendencies, and some retry strategies exist because its output format was unstable. Once the underlying model changes, those constraints either become meaningless or conflict with the new model’s behavior, turning into a liability.

    3. Root Cause: Only the Results Survive, the Reasons Are Lost

    The root of the problem is asymmetric information. Over a long iteration history, every rule in the harness corresponds to a specific failure and the fix that followed — the answer to “why was this rule added.” But when code is handed over or migrated, usually only the final form (the result) is preserved, while the reasoning that supported those decisions (the reasons) is thrown away.

    For a new model or a new optimizer with no knowledge of that history, a screen full of complex rules is easy to misjudge:

    • It may delete critical code that fixed a severe bug, treating it as “redundant logic.”
    • It may re-attempt an approach that was long ago proven ineffective, as if it were a new idea.
    • It may fail to understand that a seemingly odd restriction is a targeted fix for a specific failure mode.

    The end result is that optimization makes things worse, bouncing back and forth between deleting and re-adding rules until it falls into a loop. This is the technical essence of “more optimization, worse outcome” — the model hasn’t gotten dumber, the decision context has been lost.

    4. The Key: Self-Improvement Memory (SIM)

    To address this discontinuity, the industry has proposed a class of mechanisms known as self-improvement memory (SIM). The core idea is to record not only what was changed, but why it was changed, and to make this context-bearing experience understandable and inheritable by a new model.

    A mature memory structure usually stores three kinds of information at the same time:

    1. What: the specific code or configuration difference.
    2. Why: the problem the change addressed, the assumptions made at the time, and the verification outcome.
    3. When/Where: the model family and task scenarios in which the change is valid.

    An illustrative memory entry:

    1. {
    2. "change_id": "rule_max_retry_001",
    3. "what": "Limit the maximum number of retries to 3",
    4. "why": "On a weakly constrained model, more than 3 retries was observed to fall into an infinite tool-calling loop",
    5. "evidence": "Error rate dropped from 12% to 3% on the regression test set",
    6. "scope": { "model_family": "family-A", "task": "tool-use" },
    7. "status": "validated"
    8. }

    With memory like this, when experience is transferred to a new model, the new model can read the full context behind each rule and judge whether it still applies in the new environment, rather than blindly copying or blindly deleting it. This is the key to inheriting evolutionary experience across models — what gets passed on is no longer rigid code, but explainable, transferable decision knowledge.

    5. Engineering Practice: Give Your Agent a Memory

    To put the SIM idea into practice, a few engineering points matter:

    • Structured storage and retrieval: persist memory entries in a structured form, and use vector retrieval, object storage, or logging services for storage and semantic recall, so a new model can quickly locate relevant experience.
    • Versioning and rollback: keep a version snapshot for each round of harness evolution, so if performance drops after migration, you can quickly roll back to a stable state.
    • Validation-driven updates: every piece of experience should carry verification evidence before being written into memory (for example, regression test results), to avoid cementing wrong decisions into the memory store.
    • Memory decay and eviction: give memory entries a time-to-live and invalidation markers, so that experience is retired once environmental changes make it no longer valid, preventing stale constraints from contaminating a new environment.
    • A monitoring and alerting loop: combined with monitoring and alerting capabilities, continuously track key metrics after a harness migration and automatically feed anomalies back as new memory entries, forming a self-evolving loop.

    6. Conclusion

    The real barrier to recursive self-improvement has never been having the AI write a few more lines of code, but having it still understand every step it has taken after its “brain” is replaced. When experience is upgraded from “moving the results around” to “passing on the reasons,” AI evolution can finally break free of a single dependence on raw compute. The direction revealed by self-improvement memory (SIM) — making decision rationale explainable, retrievable, and transferable — offers a pragmatic and rigorous engineering path for the continuous evolution of agents.