Experience Memory and Cross-Model Continuity for AI Agents
AI agents can continuously improve their external execution layer—or “harness”—without changing model weights. However, cross-model transfer often fails when only final prompts and code are preserved. This article explains how to capture evidence-based experience, retain negative results and operating boundaries, and safely migrate agent harnesses through retrieval, adaptation, and gated evaluation.
As an agent enters a phase of continuous iteration, the main object of improvement is often not the underlying model with hundreds of billions of parameters, but the execution layer wrapped around it: system prompts, tool descriptions, planning steps, validators, interception rules, retry strategies, and evaluation scripts. The industry often calls this layer a harness—the agent’s “armor.”
A harness can become more reliable through extensive trial and error. Yet when the underlying model is replaced, a harness that previously worked well may suddenly perform poorly.
This behavior is not mysterious. Optimization usually preserves only the final code and final score. It does not preserve the motivation behind each change, the evidence for rejected approaches, or the model behavior under which a rule was valid. Faced with a collection of unexplained constraints, a new model must reinterpret them according to its own inductive preferences. It may remove a branch designed to prevent a critical failure because it appears redundant, or repeat a path that had already been disproven.
As a result, a migrated harness can score lower than the target model’s own simple baseline.
Why Results Transfer More Easily Than Reasons
A successful external optimization process contains at least four types of information.
The first is the change itself: which prompt was added, which tool parameter was modified, or which validation rule was introduced.
The second is the triggering problem: what the failed sample looked like and whether the error involved hallucination, unauthorized tool use, format drift, or an infinite loop.
The third is the decision rationale: why this fix was selected instead of lowering the temperature, adding more reflection rounds, or changing the tool.
The fourth is the negative evidence and boundary conditions: which changes appeared to improve a local result but harmed overall performance, and which rules were necessary for a strong reasoning model but overly restrictive for a model with weaker instruction following.
If only the first category is preserved, the next optimizer sees the current state but not its history. It cannot distinguish regression-prevention code from accumulated technical debt, so it searches the space almost randomly.
The problem becomes more severe across model families because their failure patterns differ. Some models are strong at long-horizon planning but frequently miss formatting requirements. Others follow templates strictly but are less capable of identifying incorrect tool usage independently. A long list of prohibitions designed for the first type of model may be nothing more than noise for the second.
The truly transferable asset is therefore not the complete text of a particular prompt, but evidence-backed experience. An experience record should answer the following questions:
- What was observed?
- What failure did it indicate?
- What change was made?
- Which metrics demonstrated that the change worked?
- Under what conditions should the change not be reused?
What Experience Memory Should Record
An individual experience should be stored as a structured record rather than as an unstructured diary. At a minimum, it should include the following fields:
- Problem signature: Failure type, relevant log excerpts, input characteristics, and a summary of the reproduction steps.
- Hypothesis: The suspected root cause and the confidence in that hypothesis.
- Change summary: Which layer of the harness was modified, represented as an auditable patch.
- Evidence: The evaluation suite, passing and failing examples, and the direction of metric changes. Avoid descriptions such as “it got better” without supporting evidence.
- Rejected alternatives: Approaches that were abandoned and the reasons they failed, preventing the system from exploring them again.
- Scope of applicability: Assumptions about model capabilities, task domain, tool permissions, context length, and other prerequisites.
- Invalidation conditions: Conditions under which the experience should be downgraded to a candidate rather than enabled by default.
- Provenance: The experiment round and evaluation version from which the experience originated, making rollback possible.
A conceptual structure might look like this:
Experienceidfailure_signaturehypothesispatch_summarymetrics_before_afterrejected_alternativespreconditionsinvalid_wheneval_suite_version
Do not write complete sensitive logs, credentials, or internal data directly into memory. Problem signatures should be sanitized and truncated, retaining only the information required to locate the defect.
The Right Way to Transfer Experience Across Models
Inheritance should not mean copying the entire old harness over the new model. The safer process is:
- Retrieve relevant experience.
- Adapt it to the target model.
- Validate it through fixed evaluation gates.
Retrieval
Retrieve experiences by failure signature and task domain rather than injecting the entire history in chronological order.
Every experience must be checked against its prerequisites. For example, if an old experience assumes that the model ignores tool outputs, but the new model does not exhibit that behavior on probe tasks, the experience should not be enabled by default.
Adaptation
Only controlled rewriting should be allowed. The system may preserve the validation objective and prohibited behaviors while rewriting wording, examples, or tool-call ordering to match the new model’s instruction style.
The optimizer must see both successful patches and rejected alternatives. Otherwise, it cannot tell which changes are structural supports and which are unnecessary overhead.
Validation
Use fixed evaluation gates, including:
- A regression suite
- A safety-constraint suite
- A formatting suite
- A small set of new tasks
An experience should be written into the new model’s active memory only when all of the following conditions are met:
- Target metrics do not decline.
- Known critical failures do not reappear.
- Newly added rules remain explainable.
An experience that fails migration should be marked as not migrated, not deleted. This preserves the historical record in case the system later returns to the original model.
The automated workflow can be constrained by the following decision sequence:
for exp in retrieve(task, failure):if preconditions_fail(exp, probe_results):mark(exp, "not_applicable")continuecandidate = adapt_wording_only(exp, target_model_profile)report = evaluate(candidate, frozen_suites)if report.passes_gates:commit(candidate, reason=exp.hypothesis, evidence=report)else:keep_as_negative(exp, report)
The key requirement is that every committed change must include both a reason and evidence. Without these two elements, the next optimization round should treat the change as untrusted.
The Boundary Between Harness Improvement and Weight-Level Self-Improvement
Recursive improvement of an external harness is not the same as modifying the weights of the base model.
The advantages of harness-level improvement include lower cost, better auditability, and easier rollback. Its limitation is that it remains bounded by the capabilities of the current model. Even a complete memory of past experience cannot give a model reasoning or tool-use abilities that it does not possess.
Describing experience recording and harness migration as if the model had rewritten its own “brain” can therefore lead to poor engineering decisions.
The practical objective is more limited and more useful:
- Reduce repeated trial and error within the same task family.
- Preserve validated safeguards and workflows when changing models.
- Convert failure causes into searchable knowledge.
Model weights, data composition, and training objectives belong to a separate technical path and should not be mixed into the same release process.
Engineering Practices for Implementation
Version Everything
Version the active harness, experience store, and evaluation suites together. When rolling back, roll back all three. Otherwise, new evaluations may be used to justify old rules or old rules may be judged against incompatible tests.
Separate Policy from Wording
A policy is an invariant that must hold, such as requiring explicit confirmation before a write operation or enforcing a retry limit for tool errors.
Wording is the phrasing and examples used to communicate that policy to a particular model.
When migrating across models, reuse the policy first and reuse the wording cautiously.
Preserve Negative Memory
Many regressions occur because the system retries an approach that had already failed. Negative memory should record the failure conditions and metrics, rather than simply stating “do not do this.”
Control Memory Growth
Partition experiences by task domain and define expiration and merging rules. Contradictory entries should not be enabled by default at the same time. Evaluation should decide between them, or they should be explicitly marked as mutually exclusive.
Require Human Review for High-Risk Changes
For rules involving permissions, payments, deletion, or external writes, automated migration should produce candidates only. Such changes should not enter production without human review.
Run Probes First
After changing models, begin with a small set of behavioral probes covering:
- Format adherence
- Tool misuse
- Long-context forgetting
- Refusal boundaries
Using probe results to filter applicable experiences is safer than applying the entire experience store blindly.
Common Failure Modes and How to Avoid Them
Treating a Diary as Memory
Free-form reflections are difficult to retrieve and validate. An optimizer may take them out of context. Use structured records and require every entry to be linked to an evaluation.
Recording Only Successful Changes
Success-only records encourage overfitting to the quirks of a particular model. Failure records are what prevent the system from falling back to previously disproven approaches.
Relying on a Single Metric
Looking only at task scores can sacrifice safety or stability. Evaluation gates should cover at least correctness, constraint compliance, and a resource metric such as cost or latency. Do not invent precise improvement figures when the evidence does not support them.
Writing Preconditions Too Broadly
A statement such as “applies to all programming tasks” is rarely transferable. Preconditions should be specific enough to be rejected by behavioral probes.
Allowing Memory Contamination
If unverified patches enter the experience store, later optimization rounds may treat incorrect explanations as facts. Writes must pass evaluation gates, and reads must include provenance.
Conclusion
An AI agent can continuously improve at the harness layer, but cross-model continuity depends on preserving not only what changed, but also why it changed and when it should not be changed.
If only final rules are transferred, a new model may remove load-bearing safeguards because they appear redundant. If experience is transferred with evidence, boundaries, and negative examples—and the system enforces retrieval, adaptation, and evaluation—the new model can build on previous experiments without starting from zero or blindly inheriting a complex harness it cannot properly interpret.
