Recursive Self-Improvement for AI Agents: Making Evolutionary Memory Transfer Across Models

    This article explains why agent harnesses tuned on one model often underperform on another, and how to fix the problem by making evolutionary memory portable. It breaks down the missing layers of context (causality, model capability profiles, applicability boundaries, and regression validation), then presents a four-step design: separating reusable policies from model-bound implementation details, tagging each memory with capability profiles and boundaries, running replay-based validation and shadow evaluations, and governing memory through deduplication, decay, and archival. It also covers implementation with general cloud capabilities, common pitfalls with acceptance criteria, and the core takeaway for sustainable recursive self-improvement (RSI).

    1. The Symptom: Switch the Model, and the “Mech” Falls Apart First

    In agent engineering, recursive self-improvement (RSI) has moved from a paper concept into day-to-day development. One clarification is needed: in an engineering context, “self-improvement” usually does not touch the hundreds of billions of low-level weights in a large model. Instead, it iterates on the “mech” around the model — the harness layer: system prompts, tool descriptions and parameter constraints, context orchestration strategies, failure interception and retry rules, evaluation and regression scripts, and so on. The model is the brain; the harness is the skeleton and nervous system that turn that brain into productivity.

    A widely observed pattern in the industry: a harness refined over hundreds or thousands of trial-and-error rounds on one class of model can score lower when moved directly to another class of model than that new model’s native initial configuration. The reason is not mysterious. The iteration process only deposited the “results” (which prompt segments worked, which tool-call sequences scored higher) while losing the “reasons” (why they worked, which behavioral traits of the original model they depended on). When the underlying model’s instruction-following preferences, tool-calling style, and long-context usage change, these “effects without causes” turn from assets into liabilities.

    2. Root Cause: Which Layers of Evolutionary Memory Are Missing

    Blaming the failure on “model incompatibility” is too coarse. A more rigorous breakdown is to look at which layers of information the evolutionary memory is missing:

    • The result layer lacks causality: only final scores and artifacts are saved, with no hypotheses, variables, or controls.
    • The environment layer lacks a profile: there is no record of the model capability profile the experience depended on (instruction-following strength, structured-output stability, tool-selection tendency, context-length sensitivity).
    • The constraint layer lacks boundaries: there is no record of the experience’s applicable range and failure conditions, leading to over-generalization.
    • The validation layer lacks regression: no small-scale, replayable validation is run on the new model first; the experience is applied in full immediately.

    3. Method: A Four-Step Design for Transferable Evolutionary Memory

    3.1 Store Experience and Reasoning Chains Separately

    Split each experience into a “transferable policy description” and “model-bound implementation details.” The former is a natural-language problem–policy–applicability triple; the latter is the concrete prompt template and parameters.

    1. {
    2. "policy": "In multi-step retrieval tasks, planning before retrieval significantly reduces wasted calls",
    3. "conditions": "Applies to scenarios with noisy tool returns and decomposable tasks",
    4. "binding": {
    5. "model_profile": "strong instruction following / medium structured-output stability",
    6. "prompt_template": "..."
    7. },
    8. "evidence": {"baseline": 0.41, "after": 0.63, "samples": 200}
    9. }

    3.2 Tag Each Experience with a Capability Profile and Applicability Boundary

    Every experience must carry its “preconditions.” When a new model’s profile does not match those preconditions, the system automatically down-weights the entry or moves it to a pending-validation queue instead of letting it take effect directly.

    3.3 Replay-Based Validation and Shadow Running

    When a new model is onboarded, start with small-sample replay: run the baseline on a historical task set, then enable experiences one by one for A/B comparison. Only entries with a statistically stable improvement are promoted to “verified memory.” At the same time, run the old and new harnesses in parallel in shadow mode and compare the distribution of failure types.

    3.4 Memory Governance: Deduplication, Decay, and Retirement

    Evolutionary memory expands over time. It needs similarity-based deduplication, benefit-based decay ranking, and archival of entries with no positive return over the long term, so that “memory pollution” does not slow down decisions.

    4. Engineering Implementation: Working with General Cloud Capabilities

    The mechanisms above do not depend on any proprietary interface and can be composed from general cloud capabilities: object storage holds the experience library and task snapshots; a message queue handles distribution and peak-shaving for replay tasks; a container platform hosts parallel shadow evaluations; logging and monitoring with alerting track metric drift before and after migration; and key and configuration management keep prompts and credentials secure. Baidu AI Cloud offers corresponding product forms in these general categories and can serve as the infrastructure foundation for building a self-evolving loop.

    5. Common Pitfalls and an Acceptance Checklist

    • Pitfall 1: Treating “high score” as equivalent to “transferable.” Acceptance: every experience must have applicability conditions and failure boundaries.
    • Pitfall 2: Replacing the harness all at once. Acceptance: a small-sample replay and gradual promotion process must be in place.
    • Pitfall 3: Storing only artifacts, not the process. Acceptance: each experience entry includes hypotheses, controls, and sample size.
    • Pitfall 4: Ignoring cost. Acceptance: set budget and sampling-rate caps for replay and shadow running.

    6. Conclusion

    The engineering essence of RSI is turning “trial and error” into “reusable knowledge assets with causality and boundaries.” When evolutionary memory has all four elements — causality, profile, boundary, and regression — a model changeover is no longer a reset to zero, but a continuation of iteration while standing on the shoulders of a verifiable giant.