# Recursive Experiential-Working Memory Evolution for Long-Horizon Agent Harnesses

> Recuris improves long-horizon LLM agent performance across 35 of 37 model-benchmark pairs by coupling a verified working state with experiential memory, enabling component-level fault localization and targeted, gated memory evolution without modifying the base model.

- **Source:** [arXiv](https://arxiv.org/abs/2608.24876)
- **Published:** 2026-08-29
- **Permalink:** https://picx.dev/p/WrYP84
- **Whiteboard:** https://picx.dev/p/WrYP84/image

## Summary

## Summary (Overview)

- **Recuris** introduces a recursive **Experiential–Working Memory (EM-WM)** architecture for long-horizon LLM agents, where Working Memory (WM) tracks verified task progress and guides skill selection from Experiential Memory (EM), grounding skill use in current needs rather than full history.
- The architecture turns execution into structured evidence, enabling **component-level failure localization** (64.8% accuracy vs. 13.0% from task outcome alone) and **targeted, validation-gated memory evolution** across tasks.
- Across **four long-horizon benchmarks** and **ten models** (3B to frontier), Recuris improves task success in **35 of 37** completed model–benchmark pairs, with gains like **+17.8 points on GPT-5.6 Sol** and **+15.6 on Claude Opus 5** on τ²-Bench (taking Opus 5 to 87.9%).
- The advantage **widens with interaction horizon** (up to +32.2 points on longest tasks) and reduces common long-horizon failures by up to **80%**.
- The base LLM and outer improvement procedure remain **frozen**; recursion occurs entirely within the externalized memory-control layer, making improvements attributable, reversible, and portable across models.

---

## Introduction and Theoretical Foundation

### Background and Motivation

Large language model (LLM) agents increasingly rely on **agent harnesses**—external execution layers coordinating memory, skill invocation, task-state tracking, tool interaction, and verification. However, **recursive self-improvement (RSI)** remains challenging, especially in long-horizon tasks where goals, observations, and failures evolve continuously.

**Key problem:** As interaction histories grow, agents lose track of unresolved goals and invoke skills misaligned with the current task state. Existing experiential-memory methods retrieve skills from the initial instruction or full history, both of which become unreliable as execution unfolds.

### Core Theoretical Insight

The authors argue that **Working Memory (WM)** provides the missing state representation. WM continuously tracks progress and unresolved goals, using them to select appropriate skills from Experiential Memory (EM), creating a closed loop:

$$\text{Task State} \rightarrow \text{Skill Selection} \rightarrow \text{Execution Feedback} \rightarrow \text{Updated Task State}$$

This **EM–WM Coupling** provides a stateful memory-control layer, grounding skill invocation in current needs. Critically, it also creates **structured evidence** for memory evolution:

$$\text{EM–WM Coupling} \rightarrow \text{Structured Evidence} \rightarrow \text{Failure Localization} \rightarrow \text{Targeted Memory Evolution}$$

### Contrast with Prior Work

Unlike prior harnesses that:
- Retrieve against growing chat history (losing track of unresolved goals)
- Rewrite the entire memory from one task outcome

Recuris:
- Retrieves at execution events with a checker verifying state updates
- Attributes failures to specific components and patches only implicated ones, gated by validation on held-out tasks

---

## Methodology

### Problem Setup

The agent harness is built around a frozen LLM $\pi_\theta$ and tool set $\mathcal{T}$. At step $t$, the agent maintains interaction history $h_t$ and working state $w_t$:

$$a_t \sim \pi_\theta(\cdot | x, h_t, w_t, \mathcal{E}_t), \qquad o_t = \mathrm{Env}(a_t; \mathcal{T})$$

where $a_t$ is a user-facing message or tool call, and $o_t$ is the environment response.

### Skill Memory Architecture

At evolution round $k$, the evolving Skill Memory is represented as:

$$\mathcal{M}_k = (\mathcal{E}_k, \mathcal{W}_k, \rho_k, \mathcal{C}_k)$$

- **$\mathcal{E}_k$**: Experiential memory storing reusable skills (agent-skill format)
- **$\mathcal{W}_k$**: Working-memory specification (state schema and update proposals)
- **$\rho_k$**: Invocation policy (when to retrieve skills, which entries enter context)
- **$\mathcal{C}_k$**: Checker set (tests whether observations support proposed state changes)

### Within-Task: Verified EM–WM Coupling

#### Structured Working State
Each goal entry records content, status (pending/done/blocked), supporting evidence, and optional blocker. The state $w_t$ exposes what's completed, what remains, and supporting observations.

#### State-Grounded Skill Invocation
Skills are retrieved at defined execution events:

$$\mathcal{E}_t = \rho_k(x, w_t, e_t, \mathcal{E}_k), \qquad \mathcal{E}_t \subseteq \mathcal{E}_k$$

Two deliverers are instantiated:
- **Call-time invocation**: Fires when agent drafts a state-changing tool call; retrieves skill by tool name (used in τ² domains)
- **Boundary invocation**: Fires at turn boundaries under state predicate (used in Terminal-Bench 2.1)

#### Evidence-Grounded State Update
The checker set evaluates proposed state changes against observations:

$$\widetilde{w}_{t+1} = U_{\mathcal{W}_k}(w_t, a_t, o_t), \qquad c_t = \mathcal{C}_k(w_t, \widetilde{w}_{t+1}, a_t, o_t), \qquad w_{t+1} = K(w_t, \widetilde{w}_{t+1}, c_t)$$

A goal moves to done only when $C_{k,g}(\cdot) = 1$ (explicit completion predicate on tool results, not model claims).

### Cross-Task: Bounded Recursive Skill Memory Evolution

#### Trace-Based Failure Localization
The structured trace records $(w_t, \mathcal{E}_t, a_t, o_t, \widetilde{w}_{t+1}, c_t, w_{t+1})$ at every step. A fixed Meta-Agent attributes each diagnosed failure to a component:

$$D_k = \mathcal{A}_{\mathrm{fixed}}(\Gamma_k, \mathcal{M}_k) = \{(f_j, z_j)\}_{j=1}^{J_k}, \qquad z_j \in \{\mathcal{E}, \mathcal{W}, \rho, \mathcal{C}\}$$

#### Component-Specific Patching
One edit per implicated component, applied together:

$$\mathcal{M}_k^+ = \mathcal{M}_k \oplus_{Z_k} \{\Delta m_z\}_{z \in Z_k}$$

Only implicated components change; others are copied unchanged.

#### Validation-Gated Patch Admission
A fixed gate compares candidate against current memory on failed task and held-out dev set:

$$\mathcal{M}_{k+1} = \begin{cases} \mathcal{M}_k^+, & \text{if } \mathcal{G}_{\mathrm{fixed}}(\mathcal{M}_k^+, \mathcal{M}_k; x_k, \mathcal{D}_{\mathrm{dev}}) = 1 \\ \mathcal{M}_k, & \text{otherwise} \end{cases}$$

#### Bounded Recursive Evolution
The complete loop:

$$\mathcal{M}_k \rightarrow \Gamma_k \xrightarrow{\mathcal{A}_{\mathrm{fixed}}} D_k \xrightarrow{\mathcal{P}_{\mathrm{fixed}}, \oplus_{Z_k}} \mathcal{M}_k^+ \xrightarrow{\mathcal{G}_{\mathrm{fixed}}} \mathcal{M}_{k+1} \rightarrow \Gamma_{k+1}$$

The recursion is intentionally bounded: base LLM, Meta-Agent, localization/patching procedures, gate, and harness mechanisms outside $\mathcal{M}_k$ remain fixed.

---

## Empirical Validation / Results

### Overall Performance (Table 1)

Recuris improves task success in **35 of 37** completed model–benchmark pairs:

| Model | τ²-Retail (Δ) | τ²-Airline (Δ) | SkillFlow (Δ) | Terminal-Bench 2.1 (Δ) |
|---|---|---|---|---|
| Granite-4.1-3B | +13.4† | +5.5 | -0.3 | +2.5 |
| Qwen3.5-4B | +0.3 | +3.8 | +1.1 | +2.9 |
| Qwen3.5-9B | +2.0 | +2.9 | +3.4 | +3.1 |
| GPT-OSS-20B | +10.2† | +4.5† | +2.6† | +2.8 |
| Qwen3.6-27B | +8.3† | +1.0 | +16.6† | +3.3 |
| Qwen3.6-35B | +0.3 | +1.3 | +13.5† | +3.3 |
| Gemini 3.7 Flash | +4.8 | -1.5 | - | +2.6 |
| GPT-5.6 Sol | +17.8† | +7.0† | - | +3.2 |
| Claude Opus 5 | +15.6† | +1.0 | - | +3.8 |
| Doubao-2.0-Pro (deployment) | +23.3† | +5.0 | +16.8† | +2.9 |

† marks paired task-clustered bootstrap 95% CI excluding zero.

### EM–WM Coupling Analysis

#### Long-Horizon Reliability
- Recuris leads base agent in **all four quartiles** of task length (+17.0 to +44.7 points)
- **Read-action recall** stays at 88.0–97.9% for all variants (comprehension intact)
- The gap is entirely on the **write path**: +26.7 points of required-write recall
- Base agent ends 42% of write-requiring episodes having executed none; Recuris only 16%

#### Component Ablation (Table 2)

| Variant | τ²-Retail Success (Δ) | τ²-Airline Success (Δ) |
|---|---|---|
| Base (no EM, no WM) | 58.1% (-) | 75.5% (-) |
| EM only | 60.1% (+2.0) | 77.0% (+1.5) |
| WM only | 82.0% (+23.9†) | 79.5% (+4.0) |
| Model-controlled invocation | 65.6% (+7.5†) | - |
| **EM + WM (Recuris)** | **83.6% (+25.4†)** | **84.0% (+8.5)** |

Key finding: **The working state carries the level.** EM alone adds little; WM alone adds most; coupling adds a bit more.

#### Double Dissociation (Figure 6)
The critical mechanism differs by domain:
- **τ²-Airline**: Removing *write review* costs 13.5 points; *status board* costs nothing
- **τ²-Retail**: Removing *status board* costs 17.3 points; *write review* costs 0.7

The *truth guard* (post-hoc audit) never matters—once a write executes, the environment has moved.

#### Invocation Control vs. Skill Content (Table 3)

| Metric | Base | WM only | Model-controlled | Recuris |
|---|---|---|---|---|
| Task success (%) | 58.1 | 82.0 | 65.6 | **83.6** |
| Required-write recall (%) | 55.7 | 80.9 | 61.1 | **82.4** |
| Omitted writes/episode | 0.596 | 0.145 | 0.417 | **0.121** |
| Agent tokens per success (k) | 116 | 102 | 147 | **101** |

Model-controlled (all skills injected every turn) **scores below WM-only** and costs more. Availability is not the mechanism; **state-grounded invocation** is.

### Recursive Evolution Analysis

#### Failure Localization (Table 4)
Injected-fault detection accuracy by evidence condition:

| Evidence | $\mathcal{E}$ | $\mathcal{W}$ | $\rho$ | Macro | Macro-F1 |
|---|---|---|---|---|---|
| Outcome only | 0.0 | 38.9 | 0.0 | 13.0 | 10.4 |
| Raw trajectory | 61.1 | 50.0 | 0.0 | 37.0 | 31.2 |
| **Structured trace Γ** | **72.2** | **83.3** | **38.9** | **64.8** | **63.4** |

The gain is **observability, not reasoning**: invocation faults are non-events invisible in transcripts; WM record corruption visible only in state timeline.

#### Held-Out Gains (Table 5)
Every evolution run's evolved memory clears $M_0$ with interval excluding zero:

| Run | Package | Success | Δ vs. $M_0$ |
|---|---|---|---|
| $M_0$ (shared start) | - | 54.07 | - |
| Run A | round 2 | 65.99 | +11.92† |
| Run B | round 2 | 64.83 | +10.76† |
| Run C | $M_2$ (admitted) | 71.51 | +17.44† |

Iteration compounds: Run C's second round adds +6.98 on top of first. Run B's round-4 package fails because it's **never invoked** (0/86 tasks), a broken binding not diminishing returns.

#### Meta-Agent Interchangeability (Table 6)
Two independent Meta-Agent implementations (Claude Code vs. DeepSeek Harness) converge:
- +11.92 vs. +10.47/+9.30 points (all intervals excluding zero)
- Paired contrast: -1.45 points, CI [-7.85, +4.65], p=0.72 (inside instrument noise)
- Both arrive at **same component family**: working-memory field for service-request authorization, execution-gate check, anti-escalation skills

#### Cross-Model Transfer (Table 7)
One package evolved on mid-sized deployment model lifts frontier models:

| Model | Domain | Agent alone | + Recuris | Δ (95% CI) |
|---|---|---|---|---|
| GPT-5.6 Sol | τ²-Retail | 58.33 | 76.10 | +17.76† |
| Claude Opus 5 | τ²-Retail | 72.37 | 87.94 | +15.57† |
| Gemini 3.7 Flash | τ²-Retail | 73.46 | 78.29 | +4.82 |

The package is **not a crutch for weaker models**: strongest model ends highest (87.9%). Transfer depends on what the package carries: procedure (SkillFlow) transfers broadly; discipline (τ²-Retail) transfers where target model's failures make it valuable.

### Test-Time Adaptation (Table 8)

On Terminal-Bench 2.1 (isolated tasks, no shared structure):

| Configuration | Budget | Solved | Δ | p | Isolates |
|---|---|---|---|---|---|
| Terminus-2 (baseline) | 1 | 34.5% | - | - | - |
| + seed memory | 1 | 32.2% | -2.3 | 0.824 | the layer alone |
| + seed memory, retry | 4 | 58.6% | +26.4 | <10⁻⁴ | attempt budget |
| + test-time adaptation | 4 | 60.9% | +2.3 | 0.774 | learning, matched budget |

**Critical decomposition:** The attempt budget carries the headline (+26.4 points). At matched budget, adaptation adds +2.3 points (7 tasks won, 5 lost, p=0.774). Per-attempt success (untruncated rollouts) shows consistent direction: +4.5 points on learned tasks (avg@4), all four cuts moving +2.3 to +4.5 points.

---

## Theoretical and Practical Implications

### Theoretical Contributions

1. **State-grounded memory use as RSI requirement**: Evolving task states demand continual alignment between accumulated experience and current execution needs—a compact, verified working state is essential.

2. **EM–WM coupling as structured evidence**: The coupling transforms execution into diagnostic evidence, enabling **component-level failure localization** (64.8% vs. 13.0% from outcome alone) and targeted evolution rather than coarse rewrites.

3. **Bounded recursion**: Recursion confined to the memory-control layer of a fixed harness is sufficient for meaningful self-improvement, avoiding the instability of unconstrained self-modification.

4. **Double dissociation of memory mechanisms**: The critical memory component is a **property of the domain**, not the architecture—no fixed allocation of effort can be optimal everywhere, motivating trace-based repair targeting.

### Practical Implications

1. **Memory as trainable surface**: The memory-control layer, not weights, can serve as the trainable surface of a frozen agent—improvements are attributable, reversible, and portable across models.

2. **Frontier models are not saturated**: GPT-5.6 Sol and Claude Opus 5 gain substantially on long-horizon tasks, showing headroom even at frontier capability.

3. **Efficiency**: Recuris is more token-efficient (101k vs. 147k tokens per success vs. model-controlled) while achieving higher success.

4. **Safety**: Gated updates preserve existing abilities (broke only 9.5% of dev anchor tasks vs. 25.9% null rate); rejected candidates are noise, not demonstrated gains.

5. **Deployment**: One memory evolved once on a mid-sized model costs nothing to reuse across models—a practical path to scalable agent improvement.

---

## Conclusion

Recuris reframes recursive self-improvement as an operation on an **externalized memory-control layer** rather than on the model or agent. Working Memory maintains a verified task state grounding skill invocation in Experiential Memory; the coupling emits structured traces; a fixed Meta-Agent localizes failures to components and patches only those implicated, behind a validation gate.

**Key results:**
- 35/37 model–benchmark pairs improved across four long-horizon benchmarks and ten models
- +17.8 points for GPT-5.6 Sol, +15.6 for Claude Opus 5 on τ²-Retail (Opus 5 at 87.9%)
- +16.6/+13.5 points on Qwen3.6-27B/35B on SkillFlow
- Advantage grows with horizon (+32.2 points on longest tasks), failures reduced up to 80%
- Fault localization at 64.8% vs. 13.0% from outcome alone

**Future directions** suggested by the work:
- Pruning operators for the growing memory (17 near-duplicate skill pairs survive into admitted versions)
- The memory only grows; redundancy is currently a feature (robustness), but pruning could improve efficiency
- Test-time adaptation shows promise on isolated tasks, with consistent per-attempt gains that warrant larger-sample validation

The authors position recursively evolving memory as a **scalable foundation for RSI**, enabling agents to continuously transform accumulated experience into increasingly effective long-horizon behavior while keeping the base model exactly as its provider shipped it.

---

_Markdown view of https://picx.dev/p/WrYP84, served by PicX — AI-generated visual whiteboard summaries of research papers._
