Recursive Self-Improvement in AI Agents: How to Make Evolved Memory Transfer Across Models
This article explains why a harness evolved for one large language model often underperforms on another, and how to turn that configuration layer into portable evolutionary memory. It covers the four types of transfer distortion, a three-part memory structure (policy, rationale, scope), capability probing and harness recompilation, structured change records with regression testing, layered memory governance, and common deployment pitfalls. The goal is agent improvement that is explainable, transferable, and rollback-safe rather than a one-off artifact tied to a single base model.
1. Where the Problem Starts: RSI Is Shifting from Weights to the Harness
With agent engineering now mainstream, Recursive Self-Improvement (RSI) has become a competitive focus across the industry. One common misconception needs clearing up first: in today’s engineering practice, “improvement” almost never means touching the hundreds of billions of low-level weights inside a foundation model. It means modifying the layer wrapped around the model — commonly called the harness: the runtime shell that holds prompt templates, tool registration, invocation orchestration, input/output interception rules, and failure fallback strategies.
That shell matters because the model itself is only a probabilistic text (or multimodal) generator. It has no inherent notion of what “correct” means in a given business. What actually turns general capability into usable productivity is the context organization, the granularity of tool descriptions, and the validation and retry logic accumulated inside the shell. So the RSI loop becomes: the model tries and fails on tasks, the harness is rewritten based on that feedback, and the rewritten harness makes the next round of trial and error more efficient.
The catch is that this loop has always carried an implicit assumption: the base model stays the same.
2. The Failure Mode: Swap the Brain and the Harness Breaks
A cloud vendor’s research team observed a counterintuitive result in experiments: a harness that had been deeply evolved on model A, with strong metrics to show for it, scored lower when moved directly onto model B than model B’s own initial harness did.
In other words, carefully evolved experience became a negative asset on the new base.
The root cause fits in one sentence: only the “result” survives migration; the “reason” is lost.
Broken down, there are four types of distortion:
- Missing decision provenance: what remains in the shell is “version 37 lowered the temperature and cut the tool count to 5,” but not why the cut was made. The new model inherits a conclusion, not a reasoning chain.
- Overfitting to base-model quirks: certain prompt phrasings and format constraints happen to match model A’s decoding preferences. For model B they are noise, and they can even consume effective context budget.
- Coupled constraints: shell rules often carry implicit dependencies. Extracting a few of them in isolation breaks the original balance and leaves rules fighting each other.
- Drifting capability assumptions: the tool-calling granularity and long-context utilization that model A handled well may be weaker or stronger on model B, so the original division of labor no longer holds.
3. One Level of Abstraction: The Three Elements of Evolutionary Memory
To make experience transferable, the harness has to be upgraded from a pile of configuration into a memory structure that carries semantics. A workable abstraction has three elements:
- Policy: what to do and what not to do, plus the trigger conditions.
- Rationale: which class of failures this policy grew out of, and what the evidence is.
- Scope: whether the policy is bound to the “nature of the task” or to “traits of a specific base model.”
Cross-model inheritance only works when the third element is annotated explicitly. A schematic memory entry looks like this (pseudocode, structure only, not tied to any specific product):
{"policy": "When a tool returns a malformed structure, normalize the structure once, then retry once","rationale": "42% of historical failures stemmed from parsing interruptions caused by missing fields","scope": {"bind": "task", # task is transferable / model is not"model_traits": ["weak structured output"],"confidence": 0.86}}
During migration, entries with bind == "model" are discarded outright, entries with bind == "task" enter the candidate set, and are then re-weighted against probe results from the new base.
4. Solution 1: Capability Probing and Adaptive Harness Recompilation
Do not assume a capability profile for the new model. Before going live, run a lightweight set of probes that measure four dimensions at controlled cost: instruction-following strength, structured-output stability, tool-selection accuracy, and effective long-context utilization. Feed the probe report into the harness “recompilation” step as parameters: models with strong constraint adherence need fewer repeated reminders, models with weak adherence need more format validation and secondary confirmation, and models with low long-context utilization need key information moved to the front.
Pseudocode:
def recompile(harness, probe_report):h = deepcopy(harness)if probe_report.instruction_following < 0.7:h.add(FormatGuard(retry=1))if probe_report.long_context_util < 0.5:h.reorder(priority_first=True)return h.filter(scope="task") + h
5. Solution 2: Store the Reason Along with the Result
The most overlooked step in engineering is also the highest-payoff one: attach a structured change note to every harness change — the category of task samples that triggered it, the observed failure mode, the expected benefit, and the rollback condition. This is essentially version control plus code review for an agent system. With it in place, cross-model migration stops being a config copy and becomes an evidence-based re-adaptation.
The companion practice is to keep a small regression set covering typical failure modes. Any combination of harness change and new base model must pass that regression first, which prevents silent degradation such as “worse on the new model.”
6. Solution 3: Layered Memory and Governance
Split memory into three layers: the task layer (business rules, long-lived and cross-model), the model layer (base-model quirks, invalidated as soon as the model changes), and the session layer (temporary context, short-lived). Store them separately and expire them separately so they do not contaminate each other.
Governance requires three more things: confidence decay for memory entries; conflict detection, where two policies prescribing opposite actions for the same scenario are settled by confidence and recent win rate; and observability — log every policy hit and its outcome into logging and alerting systems, so evolution is measurable rather than mystical.
7. Deployment Shape and Common Pitfalls
A typical cloud deployment combines object storage for memory-library and regression-set snapshots, a container platform for elastic execution of the harness and probes, a message queue to decouple trial-and-error tasks, and logging plus monitoring for measurement. These are all general capability categories; choose based on your own scale and compliance requirements.
Three frequent pitfalls: migrating model-layer experience as if it were task-layer experience; memory that only grows and never gets pruned, until historical conclusions crowd out the context; and looking only at final success rate while ignoring the call cost of reaching it, which makes the harness more expensive with every round of evolution.
8. Conclusion
The real barrier to RSI is not making a system modify itself. It is making those modifications explainable, transferable, and rollback-safe. Once evolutionary memory carries rationale and scope, experience stops being a one-off “past life” and becomes an asset reusable across base models — the dividing line between agents that merely work and agents that can keep evolving.
