Updated on October 26, 2026.

I’m using an illustrative biomarker scenario to work through these ideas. Suppose a research agent finishes an analysis and discovers that samples from the same patient appeared in both the training and evaluation sets. It corrects the split and reruns the analysis. When it starts a different study next week, what would help it catch the same problem earlier?

It could retrieve a record of the failed experiment. It could load a reusable procedure for checking patient overlap. Its execution environment could require a split-validation tool before training begins. I’m interested in what each approach carries forward and how it changes the next investigation.

I've been reading about agent memory with this question in mind: how does experience become a change that helps on future work? This leads from context and memory into procedural skills, evaluation and the software around the model. It also gives me a more concrete way to think about self-improvement: what changes, where does that change persist and what evidence would justify keeping it?

What survives the task?

During the analysis, the model's context might contain the research question, a dataset description, tool results and the code it is revising. Context is the active input to a model invocation. Earlier material may remain available through conversation history or summaries, but its presence in the current call does not establish how it will be retained for another task.

Caching attention states can reduce repeated computation. A larger context window can accommodate more evidence. Neither specifies which observations the application should save or when to bring them back. I find the working-memory analogy useful here, provided we keep it as an analogy rather than an exact account of human memory.

For the research agent, I would separate the records by what they need to support:

RecordPurposeWhat needs to persist
Current task stateResume the investigationWhich analysis completed, which checks remain and where the outputs are
Experiment artifactsReproduce or inspect the resultDataset version, split manifest, code revision and outputs
Episodic memoryReconstruct a previous attemptA dated account of the overlap, its detection and the correction
Semantic memoryReuse supported knowledgeA statement about this dataset's repeated patient samples, with its source and scope
Procedural memoryApply a method againA procedure or tool for checking patient overlap before fitting a model

An experiment produces separate task state, evidence records and candidate procedures. A candidate procedure must be evaluated before entering the reusable skill store.

In this design, the agent can save what happened immediately. The proposed procedure goes through evaluation before it becomes a reusable skill.

These records can share storage infrastructure, but they have different update rules. Current task state should come from the execution system. An experiment record should preserve what happened at the time. A claim about a dataset needs a version and supporting evidence. A reusable procedure needs applicability conditions and a way to retire it when those conditions change.

This is also why I would retain exact artifacts alongside compressed memories. A summary can help the agent find a relevant experiment quickly, while the original split manifest lets it verify what actually overlapped. Compression is a choice about representation; some evidence is worth retaining exactly.

Bringing experience back into context

Stored experience affects the next task only if the system retrieves, loads or executes it at an appropriate point. Retrieval is the access mechanism. Memory formation determines what was saved, how it was represented and whether it remains trustworthy.

A note saying “the previous model had leakage” is difficult to reuse. A more informative record identifies the dataset version, the unit of splitting, the overlapping patient identifiers and the check that exposed the problem. It should also distinguish an observed overlap from a hypothesis about why the performance estimate changed. The source material may support the first claim more directly than the second.

Anthropic's contextual retrieval work explores adding surrounding document context to chunks before indexing. I find this useful when thinking about what a retrieved result needs to carry with it. In a scientific workflow, that might mean preserving the cohort, endpoint and comparator with a result.

Once retrieved, that evidence competes with instructions, tool descriptions and other material in the active context. Loading a relevant procedure when the agent constructs a split may be more useful than including every past failure at the beginning of every session. Detailed tool schemas can likewise be loaded when needed. These are context-selection decisions within the broader agent execution architecture.

Context Length Alone Hurts LLM Performance Despite Perfect Retrieval reports degradation with increasing input length in its evaluated settings even when relevant evidence can be retrieved. This makes me want to inspect the assembled context as well as the retrieval results: what else was included, and did the model use the evidence correctly?

Continuing work across sessions

Before asking whether an agent improves, it helps to establish whether it can reliably continue its work. A new session needs to know that the split was corrected, the analysis was rerun and validation remains unfinished. Reconstructing that status from a loosely written historical summary introduces avoidable ambiguity.

Anthropic's long-running agent harness uses an initializer to prepare the environment and subsequent coding sessions to make incremental progress while leaving artifacts for the next session. Progress records, feature lists and version history help bridge context boundaries.

I read this as a way to preserve continuity: the system can recover its state and keep working. The question I’m following here goes a little further. Does something learned during this investigation help on a later one? Answering that would require comparing performance across tasks, as well as checking that work resumes correctly.

Here, harness means the software that manages model calls, tools, execution state, context assembly and checks. Some of its behavior can be deterministic, such as refusing to start training when a required validation result is missing. Other parts depend on model judgment, such as deciding which past experiment is relevant.

From a remembered failure to a reusable procedure

A record of the leakage incident describes one event. A procedure needs to identify what transfers: when patient-level independence is required, resolve the patient identifier and verify that its values do not overlap across the relevant partitions. That procedure also needs limits. A check written for one identifier convention may fail when a new dataset uses aliases or contains linked specimens.

The transition from event to procedure involves an inference. The agent is proposing that a lesson from one situation will help in others. I would keep the supporting example, the proposed scope and the unresolved cases with that lesson so it can be tested and revised.

Reflexion provides an early example of using experience without updating model weights. Agents reflect on task feedback and retain textual reflections in an episodic buffer for subsequent attempts. What I find useful here is that the feedback survives as text the agent can consult on another attempt. A reflection can still be an incorrect diagnosis, so its usefulness depends on the feedback and the later task.

Voyager gives the persistent component a more executable form. Its Minecraft agent builds a library of code-based skills, using environment feedback and execution errors to refine programs. The underlying GPT-4 model is accessed without parameter fine-tuning, and the learned library can be reused in a new world. This illustrates how an agent system can acquire reusable behavior through software around a fixed model.

More recent procedural-memory work examines how such repositories are maintained. Memᵖ distills trajectories into detailed instructions and higher-level procedures, then studies how to build, retrieve and update them. Its reported evaluations use TravelPlanner and ALFWorld. Memento-Skills stores evolving skills in structured Markdown and describes a read–write process for selecting and revising them without updating the underlying LLM parameters.

These examples help separate model learning from system adaptation. Training can change the model's parameters. Updating a skill library can change the agent's behavior while leaving those parameters fixed. In the second case, the capability depends on retaining the library, selecting the right skill and executing it correctly. I would want to understand which of those steps accounts for any observed gain.

Keeping useful detail as memory evolves

If the agent keeps rewriting its lessons into a shorter summary, useful conditions may disappear. “Check for leakage” preserves the topic but loses the operational detail: which entity defines independence, how identifiers are resolved and what to do when the identifier is unavailable. Conversely, accumulating every instruction indefinitely can produce contradictions and irrelevant context.

Agentic Context Engineering (ACE) treats context as an evolving playbook, with generation, reflection and curation contributing structured, incremental updates. The authors describe two problems with prior approaches: brevity bias, which removes useful detail, and context collapse, where repeated rewriting erodes accumulated knowledge. They also acknowledge that poor reflection can produce noisy or harmful additions.

For our example, I would preserve the specific patient-overlap procedure alongside its applicability conditions, rather than repeatedly compress it into a generic reminder. Updating it should retain a history of why it changed. A new lesson might extend the procedure to linked specimens; a failed attempt might narrow its scope.

Testing whether a change helps

Once procedures can change, evaluation becomes part of the update mechanism. The agent might propose a clearer instruction, a new validation function or a rule requiring that function before training. Each should be compared with the existing system on cases beyond the incident that motivated it.

An active agent produces traces, which inform a candidate change. Separate evaluation cases feed a comparison gate. Accepted changes are versioned and adopted; rejected candidates retain evidence for later analysis.

In this proposed loop, evaluation cases are separate from the tasks used to generate the candidate. Repeatedly using the same validation set for selection can still overfit it, so a final held-out set needs to remain outside that loop.

GEPA makes this process explicit for prompts. It examines trajectories and feedback, proposes prompt updates, evaluates candidates and combines complementary lessons from promising attempts. Here, the instructions themselves are what the system searches over, and evaluation helps it choose among the proposed versions.

For the research agent, I would compare the existing procedure with the candidate on datasets containing known overlap, datasets without overlap and datasets where the patient identifier is incomplete or ambiguous. The last category matters because a procedure that always announces success when a column is missing would pass a superficial workflow check while failing its purpose.

For example, the overlap check itself can be a small deterministic function:

def check_patient_overlap(train_ids, evaluation_ids):
    """Inputs are already resolved to the same patient-ID namespace."""
    train_ids = set(train_ids)
    evaluation_ids = set(evaluation_ids)
    if not train_ids or not evaluation_ids:
        raise ValueError("Both partitions need patient identifiers")
    if any(value is None or value == "" for value in train_ids | evaluation_ids):
        raise ValueError("Resolve missing identifiers before validation")
    overlap = train_ids & evaluation_ids
    return {"passed": not overlap, "overlap_count": len(overlap)}

This checks overlap in the supplied identifiers. It cannot establish that two aliases refer to the same patient or that the identifiers are scientifically appropriate for the split. I would keep those assumptions visible in the procedure and record which dataset version the check used.

Some checks can be enforced directly. Code can test identifier intersections, require a split manifest and verify that a training job used the validated split. Establishing that the identifier actually represents the correct unit of independence may require dataset documentation or expert review. A successful tool call establishes that code ran; it does not establish that the scientific interpretation was correct.

I would measure missed leakage, false alarms, appropriate abstention and execution cost. I would also include investigations where the previous system already worked, because a new procedure can improve one class of cases while creating regressions elsewhere. The chosen objective determines which tradeoffs count as an improvement.

I think of reflection as a way to propose explanations and possible changes, with observed outcomes helping us decide which explanations hold up. Earlier research on intrinsic self-correction found limitations when models revised reasoning without external feedback. Those findings concern the models and tasks studied, but they make the source of the feedback an important question to ask of any improvement loop.

Letting the agent change its harness

A prompt update leaves the surrounding execution machinery intact. A harness update can change what the agent is able or required to do. In our example, a persistent instruction asks the agent to run validation; a runtime check can prevent training from starting until a valid result exists. These changes have different effects and should be evaluated separately.

Self-Harness, first submitted in June 2026, describes a loop that mines weaknesses from execution traces, proposes small harness changes tied to those weaknesses and validates candidates through regression testing. The authors report improvements across their tested combinations of models and benchmarks, including held-out evaluations. The changes being tested are to the environment the agent works within, including the checks and tools it uses.

The Darwin Gödel Machine (DGM), from Sakana AI and collaborators at UBC, explores self-modification through an archive of coding-agent variants. Candidate agents modify their code and are evaluated on coding tasks. Reported changes include patch validation, editing tools and records of earlier unsuccessful attempts. Keeping an archive lets later exploration start from different variants rather than only the latest accepted version.

The persistent experience in these systems includes more than task memories. It can include candidate implementations, performance records and failed modifications. For an improvement process, knowing that a proposed change was already tested and caused a regression can be useful evidence in its own right.

There are two different costs to account for: running the resulting agent and searching for that agent. A more capable harness may justify its development cost over many future tasks, but a gain on a small benchmark does not tell us how quickly that cost will be recovered in another workload.

What makes the improvement recursive?

An agent can improve its task-solving behavior while the procedure generating those improvements remains fixed. For example, a developer might prescribe the same sequence of failure analysis, prompt editing and candidate selection at every iteration.

Recursion becomes more explicit when the system can also change how it produces future improvements. It might revise the way failures are grouped, retain a better history of rejected candidates or allocate its proposal budget differently. The object being changed is then part of the improvement mechanism itself.

Two designs share an independent evaluation boundary. In the first, a fixed improvement procedure edits the task agent. In the second, an editable improvement procedure can revise both itself and the task agent.

The two roles can overlap. In coding systems such as DGM, better task-solving code can also help the system modify itself, creating an overlap between the two roles.

HyperAgents makes the editable improvement procedure explicit. It combines a task agent and a meta-agent in an editable program, allowing changes to both task behavior and the mechanism generating modifications. The authors report experiments on improving this mechanism, including transfer and accumulation of improvements across runs.

The study keeps the task distribution and parts of the outer selection and evaluation process fixed. I’m curious how much of the improvement would carry over when those conditions change, especially when feedback is less direct than a coding test.

I would distinguish the ability to edit an improvement procedure from evidence that those edits make future search more effective. That second claim needs its own comparison: starting from comparable agents and budgets, does the revised procedure find useful changes more reliably, more cheaply or on different tasks? Looking at the code would tell us what changed; this comparison would help us understand whether it made the search more effective.

An experiment I would like to build

I’d like to try a small comparison with the base model held fixed, varying what the research agent can carry forward or modify.

ConditionPersistent componentQuestion
Fixed baselineFixed instructions and toolsWhat can the starting system do?
Retrieved experiencePrior examples with outcomesDoes access to relevant experience help?
Evolving proceduresVersioned skills or playbook entriesDoes abstracting experience improve transfer?
Editable harnessTested prompt, tool or execution changesDoes changing the operating environment add value?

The comparison should use the same task distribution and account for model calls, tool execution and adaptation cost. I would keep candidate-generation tasks separate from selection cases and reserve a final untouched evaluation set. Within each condition, repeated runs would help distinguish a consistent change from sampling variation.

To examine transfer, the final cases should vary the dataset conventions and task details, not just repeat the original failure with different names. To examine dependence on memory, I would remove or shuffle the relevant records in an ablation. If performance remains unchanged, the proposed explanation that the system benefited from those records needs revision.

I would start with procedural updates before allowing changes to the improvement mechanism. A versioned procedure would give me something concrete to inspect alongside its source, intended scope and evaluation results. The next experiment would ask whether an agent can improve how it discovers those procedures under a comparable budget. Keeping those questions separate would make it easier to understand what the system actually acquired from experience.

References

Related: AI systems: anatomy of an agent, on the execution loop, tools and authoritative state.

Diagrams generated using AI.