From Memory to Skills: Evidence-Grounded Co-Evolution Governance for Long-Horizon LLM Agents

arXiv cs.CL Papers

Summary

MSCE is a training-free framework that organizes LLM agent experience into three memory levels and converts them into reusable skills with evidence links, outperforming existing memory and skill-augmented baselines.

arXiv:2607.16621v1 Announce Type: new Abstract: Existing memory systems for long-horizon LLM agents often retrieve prior traces as passive context rather than converting them into executable capabilities. In this paper, we propose MSCE, a training-free Memory--Skill Co-Evolution framework that organizes agent experience into grounded step traces, reusable procedural policies, and declarative environmental cognition. MSCE crystallizes evidence-backed L2 policies with positive estimated gain into callable skills that retain evidence links, applicability boundaries, decision guidance, verification rules, and reliability estimates. It further introduces reflection-weighted value backfilling, which propagates sparse terminal feedback through dense local self-reflections to produce evidence-calibrated trace values for governing memory and skill evolution. Experiments on EvoAgentBench and LoCoMo demonstrate that MSCE significantly outperforms state-of-the-art skill-augmented and memory-driven agent baselines, exhibiting strong cross-domain transferability and lifelong-evolution capabilities.
Original Article
View Cached Full Text

Cached at: 07/21/26, 06:43 AM

# From Memory to Skills: Evidence-Grounded Co-Evolution Governance for Long-Horizon LLM Agents
Source: [https://arxiv.org/html/2607.16621](https://arxiv.org/html/2607.16621)
1\]MemTensor 2\]University of Science and Technology of China 3\]Hong Kong Polytechnic University 4\]Fuzhou University 5\]Xi’an Jiaotong University

Yang ZhangGuomian ZhuangWenqiang WeiGaoyang ZhengLindong XieYanchao TanFeiyu XiongQingyu YangEdward ChungZhiyu li\[\[\[\[\[[zynolo96@outlook\.com](https://arxiv.org/html/2607.16621v1/mailto:[email protected])

\(July 18, 2026\)

###### Abstract

Existing memory systems for long\-horizon LLM agents often retrieve prior traces as passive context rather than converting them into executable capabilities\. In this paper, we propose MSCE, a training\-free Memory–Skill Co\-Evolution framework that organizes agent experience into grounded step traces, reusable procedural policies, and declarative environmental cognition\. MSCE crystallizes evidence\-backed L2 policies with positive estimated gain into callable skills that retain evidence links, applicability boundaries, decision guidance, verification rules, and reliability estimates\. It further introduces reflection\-weighted value backfilling, which propagates sparse terminal feedback through dense local self\-reflections to produce evidence\-calibrated trace values for governing memory and skill evolution\. Experiments on EvoAgentBench and LoCoMo demonstrate that MSCE significantly outperforms state\-of\-the\-art skill\-augmented and memory\-driven agent baselines, exhibiting strong cross\-domain transferability and lifelong\-evolution capabilities\.

## 1Introduction

Large Language Model \(LLM\) agents are increasingly deployed for long\-horizon, multi\-step, and user\-specific tasks involving tool use, file editing, application interaction, and workflow coordination\. In such settings, long\-term memory is essential for overcoming limited context windows, ensuring agents can maintain coherence, personalize behavior, and reuse experience across sessions\.

Existing memory mechanisms typically store eitherfactual memory, such as raw interactions, user facts, and compressed contexts\[zhou2023recurrentgpt,xu2025mem,chen2025compress,kang2025memory\], orexperiential memory, such as reflections, reasoning traces, and task summaries\[liu2023think,shinn2023reflexion,zhao2024expel,zhang2025memgen\]\. These memories are often reused as passive context rather than transformed into operational knowledge\. For example, repeated plugin\-installation traces may reveal manifest inspection, dependency resolution, registration, reload, and availability checks, yet most systems still retrieve these traces and ask the agent to reason over them again\. Moreover, after repeatedly exploring the same repository, an agent may still re\-list directories to locate tests, configuration files, or build scripts, leading to excessive token consumption\.

Skills offer a more executable form of reusable knowledge: instead of merely reminding the agent of past observations, a skill provides an actionable procedure that guides future actions\[anthropic\_agent\_skills\_2025\]\. However, turning agent trajectories into reusable skills is difficult\. Raw traces contain failed attempts, blind exploration, and environment\-specific artifacts, while terminal feedback is often sparse and delayed, making step\-level credit assignment uncertain\. Moreover, a reusable skill requires not only a successful procedure, but also triggers, applicability boundaries, verification criteria, and lifecycle maintenance\. Directly distilled skills may thus overfit to raw trajectories and be invoked in inappropriate contexts\.

To address these challenges, we propose MSCE, a training\-freeMemory\-SkillCo\-Evolution framework that promotes skills from governed memory rather than directly distilling them from noisy trajectories\. MSCE organizes experience into three memory levels\.L1 trace memorystores grounded step\-level evidence\.L2 policy memoryinduces recurring procedural patterns from cross\-episode traces\.L3 environmental cognition memoryabstracts declarative knowledge about environmental structure and constraints\. This hierarchy separates evidence, procedure, and environmental knowledge, converting noisy interaction histories into governable abstractions that can be verified, revised, and deployed as reusable skills\.

On top of this governed memory, MSCE crystallizes useful and evidence\-backed L2 policies into skills\. A policy becomes eligible when it retains supporting evidence, exhibits positive estimated gain, and remains consistent with its current trigger, procedure, and applicability boundary\. The resulting skills preserve evidence anchors, verification rules, and a reliability\-driven lifecycle\. To provide the value signal underlying this governance, MSCE introduces reflection\-weighted value backfilling, which propagates sparse terminal feedback over grounded traces through local self\-reflections\. The resulting evidence\-calibrated trace values serve as unified signals for retrieval, policy induction, environmental cognition abstraction, skill promotion, and later revision\.

In summary, our main contributions are:

- •Framework:We propose MSCE, a training\-free memory–skill co\-evolution framework that organizes long\-horizon agent experience into grounded traces, procedural policies, and declarative environmental cognition\.
- •Method:We design a governed memory\-to\-skill promotion mechanism that crystallizes only supported, positive\-gain, and stable L2 policies into callable skills\. We further introduce reflection\-weighted value backfilling, which couples sparse terminal feedback with dense self\-reflections to produce evidence\-calibrated trace values for jointly updating memory and skills\.
- •Experiments:Comprehensive evaluations on EvoAgentBench and LoCoMo show that MSCE achieves state\-of\-the\-art performance\. Further analyses validate its effectiveness in handling long\-horizon and multi\-domain environments, showcasing positive cross\-domain transfer and lifelong\-evolution gains\.

## 2Related Work

### 2\.1Memory for LLM Agents

Followingwang2026memex, we broadly categorize existing long\-term memory systems for LLM agents into two paradigms: factual memory and experiential memory\.Factual memoryfocuses on retrieving raw interaction logs or observations to maintain consistency\. Methods in this paradigm enhance retrieval mechanisms\[chen2025compress,long2025seeing\]or leverage knowledge organization, structuring memory into interconnected networks\[xu2025mem\], neurobiologically inspired graphs\[gutierrez2024hipporag,chhikara2025mem0\], or hierarchical storage\[sun2026h\]\. While effective for recalling past events\[zhou2023recurrentgpt,zhou2025memento\], they often overwhelm the context window with episodic noise and lack higher\-level abstraction\.

To address this,experiential memorysummarizes past trajectories to guide future reasoning\. TiM\[liu2023think\]enables agents to learn from trial\-and\-error by storing evolving chains\-of\-thought or reflections\. Architecture\-driven frameworks have introduced OS\-like systems\[kang2025memory,hu2026evermemos\]and advanced abstraction mechanisms\[wang2026memex,zhangg,zhang2025memgen,ouyang2025reasoningbank\]to dynamically manage context and distill reusable strategies\. Despite these advances, most retrieved memories remain passive context and require the agent to reason over them again\. MSCE differs by treating memory as a governed substrate from which procedural policies and deployable skills are induced\.

### 2\.2Skills for LLM Agents

Unlike generic experience summaries, skills are structured, self\-contained packages encoding reusable procedures that enable agents to execute complex workflows directly\. Recent skill acquisition methods generally follow two paradigms\.External knowledge\-based skillsrely on human expertise or curated datasets\[chen2026cua,liang2026skillnet,jiao2026agentic\]\. For instance, CUA\-Skill parameterizes human computer\-use knowledge, while SkillNet constructs large\-scale skill networks\. However, acquiring high\-quality expertise is costly, and these skills struggle to adapt to user\-specific, open\-ended environments\.Interaction trajectory\-based skillsenable autonomous adaptation by distilling the agent’s own trial\-and\-error experiences\[wangvoyager,wang2025agent,qiu2026autorefine,alzubi2026evoskill,yang2026autoskill,zhang2026skillflow\]\. For example, SkillFlow and EvoSkill introduce continuous maintenance mechanisms to extract and refine skills from execution trajectories\. Besides, reinforcement learning approaches\[xia2026skillrl,wang2025reinforcement\]like SkillRL and SAGE optimize skills using environmental feedback\. Despite these efforts, directly distilling skills from ungoverned raw trajectories that are inherently noisy often yields brittle, over\-specific procedures\. MSCE inserts an intermediate evidence\-preserving memory hierarchy: L1 traces provide anchors, L2 policies aggregate cross\-episode procedures, and L3 environmental cognition provides declarative context before skill deployment\.

Concurrent works like MemSkill\[zhang2026memskill\]and ProcMEM\[mi2026procmem\]integrate memory and skills by recasting memory operations as skills or viewing skill pools as procedural memory\. In contrast, MSCE separates three\-level memory and executable skills, and links them through evidence anchors and value signals\. This design turns memory–skill integration into a governed promotion problem: what becomes a skill, when it applies, and how it is revised or retired\. We further discuss related work on self\-evolving LLM agents in Appendix[7\.1](https://arxiv.org/html/2607.16621#S7.SS1)\.

## 3Background

In this paper, we formulate the LLM agent’s interaction with a long\-horizon environment across an ordered sequence of tasks\. A task denotes a user\-facing objective initiated by a queryqq, while an episode denotes the feedback and update unit used by MSCE\. In the common single\-turn case, a task contains one episode; in multi\-turn settings, a task may contain multiple episodes due to follow\-up requests or corrections\. We consider an ordered sequence of episodesℰ=\{E1,E2,…,En\}\\mathcal\{E\}=\\\{E\_\{1\},E\_\{2\},\\ldots,E\_\{n\}\\\}\. During episodeEiE\_\{i\}, the agent generatesHiH\_\{i\}step tracesFi=\{fi,1,fi,2,…,fi,Hi\}F\_\{i\}=\\\{f\_\{i,1\},f\_\{i,2\},\\ldots,f\_\{i,H\_\{i\}\}\\\}\. At each steptt, the trace is represented as\(si,t,ai,t,oi,t,ρi,t\)\(s\_\{i,t\},a\_\{i,t\},o\_\{i,t\},\\rho\_\{i,t\}\), wheresi,ts\_\{i,t\}denotes the semantic context,ai,ta\_\{i,t\}is the primitive action,oi,to\_\{i,t\}is the observation returned by the environment, andρi,t\\rho\_\{i,t\}is the agent’s self\-reflection\.

Within this environment, the agent can leverage a crystallized skill library𝒦\\mathcal\{K\}\. Rather than exploring from scratch at every step, the agent monitors whether the current statesi,ts\_\{i,t\}satisfies the trigger condition of any skill in𝒦\\mathcal\{K\}\. If a relevant skillk=μ​\(si,t,𝒦\)k=\\mu\(s\_\{i,t\},\\mathcal\{K\}\)is retrieved, it is injected into the context to guide action generation:ai,t=πLLM\(⋅∣si,t,k\)a\_\{i,t\}=\\pi\_\{\\text\{LLM\}\}\(\\cdot\\mid s\_\{i,t\},k\)\. Otherwise, the policy falls back to generating actions conditioned only on the current state\. After episodeEiE\_\{i\}terminates, the system receives a terminal feedback signal\. This signal may be a numerical reward from an environment verifier or textual feedback from the user\. For textual feedback, we use the reward quantification mechanism in Appendix[8\.3](https://arxiv.org/html/2607.16621#S8.SS3)to convert it into a scalar terminal feedbackRiR\_\{i\}\. The primary objective is to maximize cumulative episode\-level feedback∑i=1nRi\\sum\_\{i=1\}^\{n\}R\_\{i\}\. In practice,RiR\_\{i\}may reflect task success, user satisfaction, process quality, safety, or efficiency\.

## 4Method

### 4\.1Overview

![Refer to caption](https://arxiv.org/html/2607.16621v1/x1.png)Figure 1:Overview of MSCE with governed memory, skill crystallization, and dual\-signal value backfilling\.The overview structure of MSCE is illustrated in Fig\.[1](https://arxiv.org/html/2607.16621#S4.F1)\. It maintains a memory hierarchyℳ=\(ℳ\(1\),ℳ\(2\),ℳ\(3\)\)\\mathcal\{M\}=\(\\mathcal\{M\}^\{\(1\)\},\\mathcal\{M\}^\{\(2\)\},\\mathcal\{M\}^\{\(3\)\}\), where L1 traces preserve auditable evidence, L2 policies abstract revisable procedures, and L3 environmental cognition stores declarative environment knowledge\. The skill library𝒦\\mathcal\{K\}is downstream of this memory hierarchy, exposing verified procedures for invocation\. This separation keeps skills traceable to evidence while preventing traces, policies, environmental facts, and callable actions from being merged into a single uncontrolled pool\. MSCE crystallizes evidence\-backed L2 policies with positive estimated gain into skills, and uses reflection\-weighted value backfilling to update memory and skills from terminal feedback\.

### 4\.2Three\-level Memory

#### L1 Trace Memory\.

L1 stores grounded decision units collected during interaction:

fi,t\(1\)=\(si,t,ai,t,oi,t,ρi,t,V​\(fi,t\(1\)\)\),f\_\{i,t\}^\{\(1\)\}=\(s\_\{i,t\},a\_\{i,t\},o\_\{i,t\},\\rho\_\{i,t\},V\(f\_\{i,t\}^\{\(1\)\}\)\),wheresi,ts\_\{i,t\},ai,ta\_\{i,t\},oi,to\_\{i,t\}, andρi,t\\rho\_\{i,t\}denote the semantic state, action, observation, and self\-reflection at steptt\. The trace valueV​\(fi,t\(1\)\)V\(f\_\{i,t\}^\{\(1\)\}\)is initialized as unavailable and filled after terminal feedback arrives, as described in Section[4\.4](https://arxiv.org/html/2607.16621#S4.SS4)\.

L1 is the evidence layer of MSCE: higher\-level memories and skills must maintain links to their supporting traces, so that induced procedures can be traced back to concrete interactions\.

To bound storage and reduce privacy risk, MSCE does not persist unbounded raw observations\. Instead, L1 stores normalized evidence: truncated state text, agent action text, structured tool\-call metadata, and capped tool inputs and outputs\. Higher\-level memories store evidence identifiers rather than duplicating raw observations\.

#### L2 Policy Memory\.

L2 stores reusable policies induced from recurring trace evidence:

f\(2\)=\(ϕ,π,κ,ℬ,\{f\(1\)\}\),f^\{\(2\)\}=\(\\phi,\\pi,\\kappa,\\mathcal\{B\},\\\{f^\{\(1\)\}\\\}\),whereϕ\\phiis the trigger condition,π\\piis a natural\-language procedure,κ\\kappaspecifies verification or fallback criteria,ℬ\\mathcal\{B\}records applicability boundaries, and\{f\(1\)\}\\\{f^\{\(1\)\}\\\}is the supporting L1 evidence set\.

Policy extraction\.When a valued L1 tracefi,t\(1\)f\_\{i,t\}^\{\(1\)\}becomes available, MSCE first checks whether its step value satisfiesV​\(fi,t\(1\)\)≥vminV\(f\_\{i,t\}^\{\(1\)\}\)\\geq v\_\{\\min\}wherevminv\_\{\\min\}denotes the threshold for policy extraction\. Eligible traces are matched against existing L2 policies using a combination of embedding similarity and structured evidence such as domain tags, tool types, and normalized error signatures\. A matched trace updates the corresponding policy\. If no policy matches, the trace is placed into a candidate pool keyed by a deterministic pattern signature\. A new L2 policy is induced by the promptΠpolicy\\Pi\_\{\\mathrm\{policy\}\}only when the same signature bucket contains evidence from at leastnminn\_\{\\min\}distinct episodes\.

Policy gain\.For each touched policy, MSCE computes a heuristic utility gain over per\-step values\. LetSwithS\_\{\\mathrm\{with\}\}be traces linked to the policy andSwithoutS\_\{\\mathrm\{without\}\}be other traces in the same evaluation pool\. The gain is

G​\(f\(2\)\)=V¯with−V¯blend​\(Swithout\)\.G\(f^\{\(2\)\}\)=\\bar\{V\}\_\{\\mathrm\{with\}\}\-\\bar\{V\}\_\{\\mathrm\{blend\}\}\(S\_\{\\mathrm\{without\}\}\)\.\(1\)When\|Swith\|≥3\|S\_\{\\mathrm\{with\}\}\|\\geq 3,V¯with\\bar\{V\}\_\{\\mathrm\{with\}\}is a softmax\-weighted mean overV​\(f\)V\(f\); else it falls back to the arithmetic mean\. The without\-side aggregate is an arithmetic mean shrunk toward a baseline\. Appendix[8\.4](https://arxiv.org/html/2607.16621#S8.SS4)gives the full definition\. We useGGas a heuristic signal rather than a causal effect estimate: it determines whether a policy remains active, becomes eligible for skill crystallization, or is retired\.

#### L3 Environmental Cognition Memory\.

L3 compresses environment\-level cognition as

f\(3\)=\(ℰ,ℐ,𝒞,\{f\(2\)\}\),f^\{\(3\)\}=\(\\mathcal\{E\},\\mathcal\{I\},\\mathcal\{C\},\\\{f^\{\(2\)\}\\\}\),whereℰ\\mathcal\{E\},ℐ\\mathcal\{I\}, and𝒞\\mathcal\{C\}are entity or structure facts, action–response regularities, and environmental constraints, each linked to supporting L2 policies\{f\(2\)\}\\\{f^\{\(2\)\}\\\}\. Unlike L2 policies outlining how to solve recurring tasks, L3 describes how a particular environment or domain is organized\. For example, repeated policies about editing frontend files, locating tests, and modifying configuration files may support a repository environmental cognition\.

L3 abstraction is triggered by promptΠenv\\Pi\_\{\\mathrm\{env\}\}when multiple active policies share a domain or environment context\. The abstraction step extracts declarative facts from the contributing policies and their evidence, while excluding imperative procedural instructions\. When a new L3 draft overlaps with an existing cognition, MSCE merges it; otherwise, it creates a new environmental cognition\. When later evidence weakens support for a cognition, its confidence and retrieval priority can be reduced; low\-confidence cognitions are retained for audit but excluded from default retrieval\.

### 4\.3Skill Crystallization and Invocation

A skill is a callable object derived from an eligible L2 policy:

k=\(ϕ,π,κ,ℬ,𝒜,𝒟,η\)\.k=\(\\phi,\\pi,\\kappa,\\mathcal\{B\},\\mathcal\{A\},\\mathcal\{D\},\\eta\)\.It inherits the trigger, procedure, verification rule, and boundary from L2, adding evidence anchors𝒜\\mathcal\{A\}, decision guidance𝒟\\mathcal\{D\}, and reliabilityη\\eta\. While L2 policies and skills share several fields, they serve different roles\. An L2 policy is an internal abstraction for evidence aggregation and revision; it may be incomplete, unstable, or not directly exposed to the agent\. A skill is a deployment object with a standardized invocation interface, lifecycle state, reliability estimate, evidence anchors, and decision guidance\. Thus, crystallization is not merely formatting an L2 policy, but a promotion step that makes a policy callable only after evidence, gain, and recent consistency checks\.

Skill promotion is governed by two gates\. First, the source L2 policy must retain supporting traces and satisfy the positive\-gain conditionG​\(f\(2\)\)\>θGG\(f^\{\(2\)\}\)\>\\theta\_\{G\}whereθG\\theta\_\{G\}is a threshold for skill promotion\. Second, it must be stable: recent evidence should fit the current trigger, procedure, and boundary, rather than forcing a substantial rewrite ofϕ\\phi,π\\pi, orℬ\\mathcal\{B\}\. When these gates are satisfied, MSCE constructs a support set from positive evidence and counter\-evidence\. Positive evidence induces the common procedure, while counter\-evidence constrains the boundary and yields anti\-patterns\.

#### Crystallization and verification\.

The crystallization promptΠskill\\Pi\_\{\\mathrm\{skill\}\}conditions on the policy, evidence anchors𝒜\\mathcal\{A\}, a whitelist of tools observed in evidence, and any decision\-guidance seeds already attached to the policy\. It returns structured steps, parameters, and an initial decision guidance𝒟=\(preferences,anti\-patterns\)\\mathcal\{D\}=\(\\text\{preferences\},\\text\{anti\-patterns\}\)\. A deterministic verifier checks each draft skill before insertion\. It validates the required schema, including the skill name, preconditions, ordered steps, examples, tool list, and decision\-guidance fields\. It then enforces evidence grounding: cited evidence identifiers must come from the support set, and declared tools from the whitelist observed in evidence traces\. Finally, two lightweight coverage tests ensure that the draft neither invents unsupported commands nor deviates from the retained trace evidence\. Drafts that fail any check are discarded rather than exposed as callable skills\.

#### Deployment and reliability\.

After deployment, MSCE estimates skill reliability with a smoothed success rate\. Letnpassn\_\{\\mathrm\{pass\}\}andntrialn\_\{\\mathrm\{trial\}\}denote successful and total invocations, respectively:

η=npass\+1ntrial\+2\.\\eta=\\frac\{n\_\{\\mathrm\{pass\}\}\+1\}\{n\_\{\\mathrm\{trial\}\}\+2\}\.User correction or rejection decreasesη\\etaand may shrinkℬ\\mathcal\{B\}, while repeated successes increase it\. High\-reliability skills enter active retrieval; low\-reliability skills remain probationary or are archived\. During inference, MSCE retrieves active skills first, but conditions their invocation on the memory hierarchy\. If the context also matches an L3 cognition, retrieved L3 facts provide environmental priors that instantiate parameters and interpret applicability boundaries without overwriting the skill procedure\. For example, a dependency\-installation skill may choose package\-manager commands according to whether the L3 cognition indicates Alpine, Debian, or macOS\. If no skill applies or a skill fails, MSCE falls back to L1 traces and episode\-level retrieval\.

### 4\.4Online Update via Dual\-Signal Value Backfilling

MSCE does not update the base LLM\. Instead, it updates the external cognitive state

𝒞i=\(ℳ\(1\),ℳ\(2\),ℳ\(3\),𝒦\)i\\mathcal\{C\}\_\{i\}=\(\\mathcal\{M\}^\{\(1\)\},\\mathcal\{M\}^\{\(2\)\},\\mathcal\{M\}^\{\(3\)\},\\mathcal\{K\}\)\_\{i\}through two complementary feedback sources: dense step\-level reflections and sparse terminal feedback\. Reflections are available at most interaction steps but may be noisy or unfaithful; terminal feedback is more reliable but delayed and sparse\. MSCE couples these signals by reflection\-weighted value backfilling\.

To distribute the sparse terminal feedbackRiR\_\{i\}to each step trace, the terminal step inherits this value:V​\(fi,Hi\(1\)\)=RiV\(f\_\{i,H\_\{i\}\}^\{\(1\)\}\)=R\_\{i\}\. For earlier steps, MSCE applies reflection\-weighted value backfilling:

V​\(fi,t\(1\)\)=αi,t​Ri\+\(1−αi,t\)​γ​V​\(fi,t\+1\(1\)\),V\(f\_\{i,t\}^\{\(1\)\}\)=\\alpha\_\{i,t\}R\_\{i\}\+\(1\-\\alpha\_\{i,t\}\)\\gamma V\(f\_\{i,t\+1\}^\{\(1\)\}\),\(2\)whereγ∈\[0,1\)\\gamma\\in\[0,1\)is a discount factor andαi,t∈\[0,1\]\\alpha\_\{i,t\}\\in\[0,1\]is a reflection weight\. Intuitively, high\-α\\alphasteps provide locally informative evidence for the final outcome, while low\-α\\alphasteps mainly inherit value from later steps\. This biases memory construction toward steps that are both globally rewarded and locally interpretable\. The weightα\\alphais estimated via the promptΠreflexion​\_​score\\Pi\_\{\\mathrm\{reflexion\\\_score\}\}based on the self\-reflectionρi,t\\rho\_\{i,t\}and its local context: faithful, concrete, causally informative, and transferable reflections receive higher weights, whereas empty, tautological, or unsupported ones receive zero or low weights\.

#### Online update\.

After an episode closes,𝒰\\mathcal\{U\}executes asynchronously\. It first persists normalized L1 traces and embeddings\. Once terminal feedbackRiR\_\{i\}is available, MSCE backfills step valuesVV\. The valued traces are then used to associate or induce L2 policies; active policies may trigger L3 abstraction, and eligible policies may crystallize into skills\. Tool\-failure bursts or explicit user corrections extend the decision\-guidance field𝒟\\mathcal\{D\}, and the resulting repair context is injected on the next turn rather than interrupting the current action\.

#### Additional details\.

Appendix[9](https://arxiv.org/html/2607.16621#S9)provides a concrete example illustrating the MSCE workflow\. Appendix[8](https://arxiv.org/html/2607.16621#S8)gives implementation details on agent reflection, skill lifecycle, memory retrieval, decision guidance, and storage and privacy controls\. Appendix[11](https://arxiv.org/html/2607.16621#S11)lists the prompts used by MSCE\.

## 5Experiments

### 5\.1Experimental Settings

#### Benchmarks\.

Our primary evaluation uses EvoAgentBench,111https://evermind\-ai\.github\.io/EvoAgentBencha multi\-domain benchmark for long\-horizon agent self\-evolution\. It covers five agent domains: information retrieval based on BrowseComp\-Plus\[chen2025browsecomp\], mathematical reasoning based on OmniMath\[gao2025omni\], software engineering based on SWE\-Bench\[jimenez2024swe\], code implementation based on LiveCodeBench\[jain2025livecodebench\], and knowledge work based on GDPVal\[patwardhan2025gdpval\]\. We abbreviate them as IR, Math, SE, Code, and KW, respectively\. We additionally evaluate on LoCoMo\[maharana2024evaluating\]to test long\-term dialogue memory; we report it separately because it stresses memory consistency rather than tool\-use skill execution\.

#### Baselines\.

We compare MSCE with three categories of baselines\. First,memory\-based agents, including EverOS\[hu2026evermemos\], Memento, and MemSkill, reuse past trajectories or stored cases but do not explicitly crystallize reusable skills\. Second,trajectory\-to\-skill agents, including EvoSkill, OpenSpace\[hkuds\_openspace\_2026\], and SkillFlow\-Evolve, synthesize or refine skills from interaction trajectories\. SkillFlow\-Evolve is a patch\-based skill\-evolution baseline adapted from SkillFlow\[zhang2026skillflow\]\. Finally, we include avanilla agentthat uses the same base model and tools but does not persist long\-term memory or construct skills\.

#### Implementation\.

All methods are implemented on the OpenClaw v2026\.5\.7 runtime222https://openclaw\.ai/and receive identical tool access, interaction budgets, and task order\. We use GPT\-5\.2 as the agent backbone and GPT\-4o for auxiliary prompted operators, including reflection scoring, L2 policy induction, and L3 environmental cognition abstraction\. For online methods, memory and skills are accumulated only from online evolution episodes without updating the base LLM, and are then reused on later evaluation\. Hyperparameters are reported in Appendix \(Table[6](https://arxiv.org/html/2607.16621#S10.T6)\)\.

#### Metrics\.

We reportPass@1as the main effectiveness metric for EvoAgentBench\. Pass@1 is the macro\-averaged per\-task success rate: each trial receives a domain\-specific rewardrr, and is counted as successful ifr\>τe​v​a​lr\>\\tau\_\{eval\}\(defaultτe​v​a​l=0\\tau\_\{eval\}\{=\}0;τe​v​a​l=0\.6\\tau\_\{eval\}\{=\}0\.6for KW\)\. We also reportcost, which is measured by the mean number of interactionturnsor character count \(abbreviated aschars\) per trial; see Appendix[10\.1](https://arxiv.org/html/2607.16621#S10.SS1)for full evaluation protocol\. On LoCoMo, we report GPT\-4o judge scores for four question types, together with overall judge score and F1\.

Table 1:Main results on EvoAgentBench\. We report Pass@1 \(%\) and Cost across five domains\. Cost is measured incharsfor Math andturnsfor other domains\. For Pass@1, the best results are shown in bold, and the second best results are underlined\. Cost is reported as an efficiency reference and should be interpreted jointly with Pass@1, as lower cost may reflect premature termination or less extensive tool use\.

### 5\.2Main Results

#### Results on EvoAgentBench\.

As shown in Table[1](https://arxiv.org/html/2607.16621#S5.T1), MSCE achieves the best or tied\-best Pass@1 in all five domains\. Compared with the strongest non\-MSCE baseline in each domain, it improves Pass@1 by 4\.61 points on IR, 4\.00 on Math, 15\.39 on SE, and 5\.17 on KW\. On Code, MSCE ties the best baseline, EvoSkill, at 61\.54% Pass@1 while reducing cost from 3\.9 to 2\.0 turns\. These results indicate that MSCE improves self\-evolution across heterogeneous agent tasks\.

The cost results show that these gains are not obtained by simply spending more inference budget\. When comparing against the strongest non\-MSCE baseline by Pass@1, breaking ties by lower cost, MSCE reduces cost on IR, Math, Code, and KW, with especially large reductions on Math and Code\. The only exception is SE, where MSCE improves Pass@1 by 15\.39 points but increases cost from 37\.3 to 40\.8 turns, consistent with the additional repository navigation, editing, and testing often required by successful software\-engineering solutions\. Overall, MSCE achieves the strongest accuracy while maintaining favorable efficiency in most settings\.

Table 2:Results on LoCoMo\. We report LLM\-judge \(GPT\-4o\) scores for four question types, including single\-hop, multi\-hop, temporal reasoning, and open\-domain questions, together with the overall judge score and overall F1 score\. Higher is better for all metrics\.
#### Long\-dialogue memory results\.

Table[2](https://arxiv.org/html/2607.16621#S5.T2)reports LoCoMo results\. MSCE achieves the best overall judge score and F1, outperforming the strongest baseline, SkillFlow\-Evolve, by 2\.01 and 1\.18 points, respectively\. It also obtains the highest scores on single\-hop, multi\-hop, and temporal reasoning questions, indicating that the governed L1–L2–L3 hierarchy helps preserve factual evidence while abstracting long\-range dependencies\. EverOS performs best on open\-domain questions excluding Vanilla Agent, but MSCE ranks second on this category and achieves the strongest aggregate performance\.

#### Simulated human feedback\.

Appendix[10\.2](https://arxiv.org/html/2607.16621#S10.SS2)further studies MSCE with LLM\-simulated human feedback injected at the episode level\. The results show that the introduction of simulated human feedback improves Pass@1 on most EvoAgentBench domains, suggesting that richer textual feedback can provide useful learning signals for memory–skill evolution\.

### 5\.3Generalization Analysis

![Refer to caption](https://arxiv.org/html/2607.16621v1/x2.png)Figure 2:Cross\-domain transfer results\. Bars show the absolute Pass@1 improvement fromintratocrossin percentage points, and the orange line shows the relative cost change\.Table 3:Ablation results on EvoAgentBench\. The top row shows the full MSCE method, while the following rows evaluate non\-hierarchical and component\-level ablations\.#### Cross\-domain transfer\.

We evaluate whether evolved memory and skills transfer across domains: for each pairA→BA\\rightarrow B,intraevolves and evaluates the agent on target domainBB, whereascrossinitializes it with memory and skills evolved on source domainAAbefore further evolution and evaluation onBB\.

Figure[2](https://arxiv.org/html/2607.16621#S5.F2)shows that cross\-domain transfer improves Pass@1 across all six transfer pairs, with gains from\+2\.56\+2\.56to\+5\.13\+5\.13points and an average gain of\+3\.93\+3\.93points, with cost decreasing in four of six pairs\. The two transfers into Code increase cost by\+4\.6%\+4\.6\\%and\+8\.1%\+8\.1\\%, but also yield clear Pass@1 gains, suggesting a favorable accuracy–cost trade\-off\. These results indicate that MSCE learns transferable problem\-solving structure rather than domain\-specific artifacts\.

#### Lifelong Evolution

![Refer to caption](https://arxiv.org/html/2607.16621v1/x3.png)Figure 3:Long\-horizon cumulative evolution under the lifelong learning protocol\. The left panel shows Pass@1 across increasing accumulated training scales, and the right panel shows cost normalized by the corresponding p0 cost of each task category\.Figure[3](https://arxiv.org/html/2607.16621#S5.F3)presents long\-horizon evolution under the lifelong learning protocol, wherep​0p0denotes the initial no\-accumulation setting andp​25p25,p​50p50, andp​100p100denote increasing accumulated experience scales\. Pass@1 improves monotonically fromp​0p0top​100p100, with gains of 17\.00, 15\.39, and 13\.84 points on Math, SE, and IR, respectively\. Normalized cost first increases atp​25p25and then consistently decreases towardp​100p100\. Atp​100p100, cost becomes lower thanp​0p0on Math and SE and is substantially reduced from itsp​25p25peak on IR\. These results support a “learning by using” effect: accumulated experience improves success without simply increasing inference cost\.

### 5\.4Ablation Study

We ablate five components of MSCE\.Flat Memorystores all experiences in a single non\-hierarchical memory and retrieves them directly at test time, without hierarchical abstraction, applicability gating, or skill introduction\.w/o L3removes L3 environmental cognition abstraction\.w/o Value Calibrationdirectly injects retrieved skills without value\-calibrated applicability filtering\.w/o Reflection Weightingremoves reflection\-weighted value backfilling and treats feedback uniformly\.w/o Skill Crystallizationprevents distilled task policies from being converted into reusable skills\.

Table[3](https://arxiv.org/html/2607.16621#S5.T3)shows that all components contribute to performance and efficiency\. The largest degradation comes from replacing MSCE withFlat Memory: Pass@1 drops by 15\.38, 16\.00, and 19\.23 points on IR, Math, and SE, respectively, and Code cost increases from 2\.0 to 5\.3 turns despite a relatively small Pass@1 drop\. This indicates that merely retrieving past experiences is insufficient; effective reuse requires hierarchical abstraction, applicability control, and skill\-level consolidation\.

Among component\-level ablations, removing skill crystallization causes the most consistent degradation, reducing Pass@1 by 6\.15–11\.54 points across domains and increasing cost for every domain\. Removing the L3 environmental cognition, reflection weighting, or the value calibration also consistently hurts performance\. In particular, disabling the value calibration lowers Pass@1 and increases cost in every domain, supporting the need for applicability\-aware filtering to avoid harmful skill injection\. Overall, the ablations show that MSCE’s gains arise from the joint effect of hierarchical organization, skill crystallization, calibrated selection, and reflection\-weighted learning\.

## 6Conclusion

In this paper, we introduced MSCE, a training\-free memory–skill co\-evolution framework for long\-horizon LLM agents\. By organizing experience into grounded traces, reusable policies, and environmental cognition, and by crystallizing evidence\-backed, positive\-gain policies into skills, MSCE bridges the gap between passive memory retrieval and active skill execution\. Extensive experiments validate that MSCE achieves state\-of\-the\-art performance on long\-horizon self\-evolution and conversational memory benchmarks, alongside significant cross\-domain transfer and lifelong\-evolution capabilities\. We hope MSCE provides a foundation for connecting memory and skills, contributing to the development of more efficient and autonomously evolving LLM agents\.

## Limitations

MSCE has several limitations\. First, its value estimates, policy gains, and reliability scores are heuristic governance signals rather than causal credit\-assignment estimates\. They support ranking, filtering, and revision of memory objects, but do not guarantee that a promoted policy would cause success under counterfactual intervention\.

Second, several update operators, including reflection scoring, policy induction, environmental cognition abstraction, reward quantification, and skill drafting, rely on prompted LLMs\. Although outputs are evidence\-constrained and verified before insertion, they may still be noisy or sensitive to model and prompt choices, and they introduce additional latency and cost\.

Third, our implementation depends on a particular agent runtime, tool interface, and backbone configuration; absolute results may vary under different models or environments\.

Finally, MSCE stores normalized traces, evidence identifiers, policies, environmental cognition, and skills\. Although we apply truncation, deduplication, and rule\-based redaction to reduce storage and privacy risks, these controls do not eliminate the possibility of retaining sensitive user information, environment\-specific secrets, or unsafe procedural knowledge\. Practical deployments should include stronger privacy filters, access control, and safety checks for generated skills\.

## References

\\beginappendix

## 7More Related Work

### 7\.1Self\-Evolution of LLM Agents

Self\-evolving LLM agents improve future behavior from past interactions through dual\-signal feedback:internal reflectionandexternal task feedback\. Reflection\-based methods, such as Self\-Refine\[madaan2023self\], Reflexion\[shinn2023reflexion\], ExpeL\[zhao2024expel\], SAMULE\[ge2025samule\], and PreFlect\[wang2026preflect\], generate natural\-language critiques over outputs, trajectories, or plans to guide future attempts\. While dense and interpretable, such reflections can be generic, mislocalized, or hallucinated\. In contrast, feedback\-driven methods such as LATS\[zhou2024language\], LEAFE\[ge2026internalizing\], and RetroAgent\[zhang2026retroagent\]exploit environment signals, verifiers, or rewards to guide search, distillation, or policy learning\. These signals are more reliable but often sparse and delayed, making credit assignment difficult\.

MSCE explicitly couples these two feedback sources through reflection\-weighted value backfilling\. This produces unified trace\-level values that guide memory retrieval, policy induction, and skill crystallization, enabling memory and skills to co\-evolve in a training\-free manner\.

## 8Implementation Details of MSCE

This appendix provides implementation details omitted from the main text\.

### 8\.1Agent Reflection

The reflection fieldρi,t\\rho\_\{i,t\}is obtained from the agent runtime when native reflective metadata is available; otherwise MSCE extracts inline reflective statements from the assistant turn, and may synthesize a short reflection with an LLM when no reflection is present\. The reliability ofρi,t\\rho\_\{i,t\}is not assumed, but later estimated through the reflection scoring procedure in Appendix[11\.1](https://arxiv.org/html/2607.16621#S11.SS1)\.

### 8\.2Episode Definition and Boundary Management

The main text defines anepisodeas the feedback and update unit used by MSCE\. This appendix provides the boundary\-management details needed to instantiate that definition in online multi\-turn interaction\. An episode is not an additional memory level; rather, it determines when L1 traces are closed, when terminal feedback is backfilled, and when downstream memory updates are triggered\.

#### Task, episode, and step\.

Ataskis the user\-facing objective introduced in Section[3](https://arxiv.org/html/2607.16621#S3), anepisodeis the feedback and update unit, and astepis the minimal L1 memory unitfi,t\(1\)f\_\{i,t\}^\{\(1\)\}\. Each episode closes a set of L1 steps that are assigned terminal feedback together\. In the common single\-turn case, a task and an episode coincide\. In multi\-turn settings, a task may contain multiple episodes when the user provides follow\-up requests or corrections\. MSCE uses episode boundaries to decide whether a new interaction should revise the previous evidence, continue the same session, or start a new task context\.

Formally, we write an episode as

Ei=\{τi,1,τi,2,…,τi,Hi\},E\_\{i\}=\\\{\\tau\_\{i,1\},\\tau\_\{i,2\},\\ldots,\\tau\_\{i,H\_\{i\}\}\\\},where eachτi,t\\tau\_\{i,t\}is an assistant response segment or a tool\-mediated action–observation segment\. The capture module convertsEjE\_\{j\}into an ordered set of L1 traces

Fi\(1\)=\{fi,1\(1\),fi,2\(1\),…,fi,Hi\(1\)\}\.F\_\{i\}^\{\(1\)\}=\\\{f\_\{i,1\}^\{\(1\)\},f\_\{i,2\}^\{\(1\)\},\\ldots,f\_\{i,H\_\{i\}\}^\{\(1\)\}\\\}\.All traces inFi\(1\)F\_\{i\}^\{\(1\)\}share the same episode identifier, which is used for reward backfilling, L2 evidence grouping, and episode\-level retrieval\.

#### Episode boundaries\.

MSCE maintains sessions across multiple user turns\. When a new user message arrives, a lightweight relation classifier determines how it relates to the previous episode\. The classifier combines lexical cues with an LLM\-based tie\-breaker when necessary and returns one of three operational labels:

- •Correction: the new message corrects or rejects the previous result\. MSCE extends the last episode so that the new evidence can revise the same credit\-assignment unit\.
- •Follow\-up: the new message extends the same goal or environment without invalidating the previous result\. MSCE closes the previous episode and opens a new episode under the same task context\.
- •New task: the new message introduces an unrelated goal or domain\. MSCE starts a new task context while keeping long\-term memory retrievable\.

This design separates the user\-facing notion of a task from the system\-level unit used for online updates\. It also avoids treating every tool call as an independent task, which would make credit assignment too fine\-grained and unstable\.

#### Role in value backfilling\.

Episode boundaries define the scope of credit assignment\. Once feedback for an episode is available, the traces inFi\(1\)F\_\{i\}^\{\(1\)\}are valued together using the reflection\-weighted backfilling rule in Eq\.[2](https://arxiv.org/html/2607.16621#S4.E2)\. The same terminal feedback signal is shared within the episode, while each step receives a different value according to its reflection weight and temporal position\. This is why MSCE does not treat each tool call as an independent training instance: doing so would make the feedback signal too sparse and unstable\.

#### Role in L2 induction\.

Episodes also provide the independence criterion for policy induction\. A single high\-value trace may be associated with an existing L2 policy or placed into the candidate pool, but a new L2 policy is induced only when a candidate signature accumulates evidence from at leastnminn\_\{\\min\}distinct episodes\. This prevents multiple traces from the same execution trajectory from being counted as independent support\. In other words, the threshold for L2 induction is cross\-episode support, whereas the value thresholdV​\(f\)≥vminV\(f\)\\geq v\_\{\\min\}is applied to individual L1 traces\.

#### Role in retrieval\.

Although retrieval can return individual L1 traces, MSCE may also aggregate retrieved traces by episode\. This episode\-level rollup provides a compact reference trajectory when the current context resembles a previous execution segment, while still preserving the underlying trace\-level evidence links\.

### 8\.3Reward Quantification from Textual Feedback

When no numerical environment reward is available, MSCE converts textual user feedback into a normalized scalarRi∈\[−1,1\]R\_\{i\}\\in\[\-1,1\]\. Given user feedbackhih\_\{i\}and a compact task summary, an LLM evaluator scores the execution trajectory along three axes:

- •Goal achievementgi∈\[−1,1\]g\_\{i\}\\in\[\-1,1\]: whether the agent addressed the user’s actual request, with later turns weighted more strongly in multi\-turn tasks\.
- •Process qualitypi∈\[−1,1\]p\_\{i\}\\in\[\-1,1\]: whether the execution was efficient, safe, and avoided unnecessary tool use or exploration\.
- •User satisfactionui∈\[−1,1\]u\_\{i\}\\in\[\-1,1\]: whether the user’s feedback expresses acceptance, neutrality, correction, or rejection\.

The terminal reward is computed as

Ri=clip​\(0\.45​gi\+0\.30​pi\+0\.25​ui,−1,1\)\.R\_\{i\}=\\mathrm\{clip\}\\left\(0\.45g\_\{i\}\+0\.30p\_\{i\}\+0\.25u\_\{i\},\\,\-1,\\,1\\right\)\.If the LLM evaluator is unavailable, MSCE falls back to a heuristic polarity\-based estimate from the explicit feedback channel\.

### 8\.4Policy Gain for L2

#### Sets\.

L2 policy gain is recomputed whenever reward backfilling finishes for an episode\. For each touched policy, we form a finite trace pool𝒯\\mathcal\{T\}consisting of traces from the triggering episode and any additional traces that served as cross\-episode induction evidence for that policy\. The with set isSwith=\{f∈𝒯∣f​is linked to the policy in this update\}S\_\{\\mathrm\{with\}\}=\\\{\\,f\\in\\mathcal\{T\}\\mid f\\text\{ is linked to the policy in this update\}\\,\\\}including traces matched by association and traces in the inducing bucket\. The without set isSwithout=𝒯∖SwithS\_\{\\mathrm\{without\}\}=\\mathcal\{T\}\\setminus S\_\{\\mathrm\{with\}\}\. Earlier in the pipeline, only traces withV​\(f\)≥vminV\(f\)\\geq v\_\{\\min\}enter association or the candidate pool; gain computation itself uses the stored per\-step valuesV​\(f\)V\(f\)\.

#### With\-side aggregate\.

For\|Swith\|≥3\|S\_\{\\mathrm\{with\}\}\|\\geq 3, MSCE uses a value\-weighted mean:

μw​\(Swith\)=∑f∈Swithwf​V​\(f\),\\mu\_\{\\mathrm\{w\}\}\(S\_\{\\mathrm\{with\}\}\)=\\sum\_\{f\\in S\_\{\\mathrm\{with\}\}\}w\_\{f\}V\(f\),\(3\)where

wf=exp⁡\(\(V​\(f\)−maxg∈Swith⁡V​\(g\)\)τV\)∑g∈Swithexp⁡\(\(V​\(g\)−maxh∈Swith⁡V​\(h\)\)τV\)\.w\_\{f\}=\\frac\{\\exp\\left\(\\frac\{\(V\(f\)\-\\max\_\{g\\in S\_\{\\mathrm\{with\}\}\}V\(g\)\)\}\{\\tau\_\{V\}\}\\right\)\}\{\\sum\_\{g\\in S\_\{\\mathrm\{with\}\}\}\\exp\\left\(\\frac\{\(V\(g\)\-\\max\_\{h\\in S\_\{\\mathrm\{with\}\}\}V\(h\)\)\}\{\\tau\_\{V\}\}\\right\)\}\.\(4\)We useτV=0\.5\\tau\_\{V\}=0\.5\. For\|Swith\|<3\|S\_\{\\mathrm\{with\}\}\|<3, the with\-side aggregate falls back to the arithmetic mean:

V¯with=μ​\(Swith\)=1\|Swith\|​∑f∈SwithV​\(f\)\.\\bar\{V\}\_\{\\mathrm\{with\}\}=\\mu\(S\_\{\\mathrm\{with\}\}\)=\\frac\{1\}\{\|S\_\{\\mathrm\{with\}\}\|\}\\sum\_\{f\\in S\_\{\\mathrm\{with\}\}\}V\(f\)\.Otherwise,V¯with=μw​\(Swith\)\\bar\{V\}\_\{\\mathrm\{with\}\}=\\mu\_\{\\mathrm\{w\}\}\(S\_\{\\mathrm\{with\}\}\)\.

#### Without\-side aggregate\.

The without side uses an arithmetic mean, not a softmax\-weighted mean:

μ​\(Swithout\)=1\|Swithout\|​∑f∈SwithoutV​\(f\),\\mu\(S\_\{\\mathrm\{without\}\}\)=\\frac\{1\}\{\|S\_\{\\mathrm\{without\}\}\|\}\\sum\_\{f\\in S\_\{\\mathrm\{without\}\}\}V\(f\),withμ​\(Swithout\)=0\\mu\(S\_\{\\mathrm\{without\}\}\)=0whenSwithout=∅S\_\{\\mathrm\{without\}\}=\\emptyset\. To avoid making the gain undefined or uninformative when few comparable failures are observed, MSCE shrinks this mean toward a conservative baselineb=0\.5b=0\.5with pseudocountN0=5N\_\{0\}=5:

V¯blend​\(Swithout\)=\|Swithout\|​μ​\(Swithout\)\+N0​b\|Swithout\|\+N0\.\\bar\{V\}\_\{\\mathrm\{blend\}\}\(S\_\{\\mathrm\{without\}\}\)=\\frac\{\|S\_\{\\mathrm\{without\}\}\|\\,\\mu\(S\_\{\\mathrm\{without\}\}\)\+N\_\{0\}b\}\{\|S\_\{\\mathrm\{without\}\}\|\+N\_\{0\}\}\.\(5\)Thus, if no without evidence is available,V¯blend=b\\bar\{V\}\_\{\\mathrm\{blend\}\}=b\.

#### Gain\.

The final policy gain is

G​\(f\(2\)\)=V¯with−V¯blend​\(Swithout\)\.G\(f^\{\(2\)\}\)=\\bar\{V\}\_\{\\mathrm\{with\}\}\-\\bar\{V\}\_\{\\mathrm\{blend\}\}\(S\_\{\\mathrm\{without\}\}\)\.This gain is a heuristic utility estimate, not a causal effect estimate\. Softmax weights are used only in gain recomputation; they do not duplicate or reweight examples inside the L2 induction prompt\.

### 8\.5L2 Association, Induction, and Revision

For each valued L1 trace, MSCE first attempts association with an existing L2 policy\. The matching score combines semantic similarity with structured trigger overlap\. Incompatible domain tags or conflicting error signatures prevent association even when embedding similarity is high\. Associated traces update the policy’s support set and gain estimate\.

If no policy matches, the trace is placed into a candidate pool\. A candidate pool becomes eligible for induction when it contains evidence from at leastnminn\_\{\\min\}distinct episodes\. This independence requirement prevents a single long trajectory from producing an over\-specific policy\. When new evidence contradicts an active policy, MSCE does not directly overwrite its procedure\. Instead, the policy gain is recomputed; sustained negative gain retires the policy, while substantial procedural drift triggers re\-induction and possible skill rebuilding\.

### 8\.6L3 Abstraction and Confidence

Given active L2 policies, we bucket by a deterministic domain key, admit a cohort via centroid cosine similarity \(with a tag\-aligned fallback when embeddings diverge\), and call the abstraction promptΠe​n​v\\Pi\_\{env\}\(Appendix[11](https://arxiv.org/html/2607.16621#S11)\) on the cohort plus one capped evidence trace per policy\. The prompt is constrained to declarative environment knowledge and forbidden from prescribing actions\. Validated drafts merge into the nearest existing environmental cognition by embedding similarity or instantiate a new environmental cognition\. Algorithm[1](https://arxiv.org/html/2607.16621#alg1)summarizes the procedure\.

Algorithm 1Environmental cognition abstraction0:active policies

𝒫\\mathcal\{P\}; similarity thresholds

θsim,θmerge\\theta\_\{\\mathrm\{sim\}\},\\theta\_\{\\mathrm\{merge\}\}; minimum cohort size

mm
1:Partition

𝒫\\mathcal\{P\}into domain buckets

BB
2:foreach

b∈Bb\\in Bwith

\|b\|≥m\|b\|\\geq mdo

3:

C←Admit​\(b,θsim\)C\\leftarrow\\textsc\{Admit\}\(b,\\theta\_\{\\mathrm\{sim\}\}\)//strict centroid or tag fallback

4:

𝒯←\\mathcal\{T\}\\leftarrowone recent trace per policy in

CC
5:

d←LLM​\(Πenv,C,𝒯\)d\\leftarrow\\mathrm\{LLM\}\(\\Pi\_\{\\mathrm\{env\}\},C,\\mathcal\{T\}\)
6:if

ddinvalid or

conf​\(d\)=0\\mathrm\{conf\}\(d\)=0then

7:continue

8:endif

9:

w⋆←arg⁡maxw⁡cos⁡\(C→,w→\)w^\{\\star\}\\leftarrow\\arg\\max\_\{w\}\\cos\(\\vec\{C\},\\vec\{w\}\)
10:if

cos⁡\(C→,w⋆→\)≥θmerge\\cos\(\\vec\{C\},\\vec\{w^\{\\star\}\}\)\\geq\\theta\_\{\\mathrm\{merge\}\}then

11:merge

ddinto

w⋆w^\{\\star\}
12:else

13:insert

ddas a new environmental cognition

14:endif

15:endfor

The confidenceccof an L3 cognition is increased when newly induced policies support its existing facts and decreased when later evidence contradicts them\. Low\-confidence cognitions are not deleted immediately, since they may still serve as negative or historical evidence; instead, they are excluded from default retrieval until additional support appears\.

### 8\.7Online Update Operator𝒰\\mathcal\{U\}

Algorithm[2](https://arxiv.org/html/2607.16621#alg2)formalizes the event\-driven chain\. Stages are idempotent per episode identifier; LLM stages are skipped when no provider is configured, while L1 persistence still proceeds\.

Algorithm 2Online update operator𝒰\\mathcal\{U\}1:Uponepisode finalization:

2:Extract L1 steps

3:Truncate the text

4:Extract or synthesize self\-reflection

ρ\\rho
5:Score

α\\alphavia

Πreflexion​\_​score\\Pi\_\{\\mathrm\{reflexion\\\_score\}\}
6:Embed summaries;

7:Write traces with

V=pendingV=\\textsc\{pending\}\.

8:Uponreceipt of

RiR\_\{i\}\(feedback or timeout\):

9:Build an episode summary

10:

Ri←R\_\{i\}\\leftarrowenvironment reward or

LLM​\(Πreward,⋅\)\\mathrm\{LLM\}\(\\Pi\_\{\\mathrm\{reward\}\},\\cdot\)
11:Backfill

VV
12:Decay retrieval priorities

13:Uponreward update:

14:fortraces with

V≥vminV\\geq v\_\{\\min\}do

15:Associate or pool

16:Induce if quorum met

17:Recompute

\(G,support,status\)\(G,\\text\{support\},\\text\{status\}\)
18:endfor

19:Uponactive L2 change:

20:Abstract L3 clusters

21:Evaluate skill eligibility

22:Crystallize

→\\rightarrowverify

→\\rightarrowprobationary deploy

23:Uponfailure burst or user correction:

24:Synthesize contrastive guidance

25:Append to

𝒟\\mathcal\{D\}
26:Stash repair packet for the next turn

27:On failure:

28:Malformed JSON

⇒\\Rightarrowskip stage

29:Empty evidence

⇒\\Rightarrowno new skill

### 8\.8Skill Lifecycle

Skills pass through three states: probationary, active, and archived\. A newly crystallized skill is probationary\. It becomes active when its reliabilityη\\etaexceeds a threshold after sufficient invocations\. It is archived when repeated failures, explicit user rejection, or negative source\-policy gain indicate that it should no longer be retrieved by default\.

Reliability is estimated by a smoothed success rate:

η=npass\+1ntrial\+2\.\\eta=\\frac\{n\_\{\\mathrm\{pass\}\}\+1\}\{n\_\{\\mathrm\{trial\}\}\+2\}\.In addition, explicit positive or negative user feedback can adjustη\\eta, and boundary violations shrink the applicability boundaryℬ\\mathcal\{B\}\. When the source L2 policy is substantially revised, the corresponding skill is rebuilt from a fresh evidence set rather than patched in place\. The detailed lifecycle operations for crystallized skills are provided in Table[4](https://arxiv.org/html/2607.16621#S8.T4)\.

Table 4:Lifecycle operations for crystallized skills\.
### 8\.9Hierarchical Retrieval

At inference time, MSCE retrieves memory in three tiers\.

#### Skill retrieval\.

The router first matches the current context against active skill triggers\. Matched skills are ranked by trigger relevance, reliabilityη\\eta, and source\-policy gain\. The selected skill contributes its procedure, preconditions, verification rule, boundary, evidence anchors, and decision guidance to the agent context\.

#### Trace and episode retrieval\.

If no skill applies, or if a skill fails, MSCE retrieves L1 evidence\. Trace retrieval combines exact cues such as error signatures with semantic similarity over compact state summaries\. High\-value traces are prioritized, while low\-value traces are preserved for counter\-evidence and decision repair\.

#### Environmental cognition retrieval\.

When the agent expresses structural uncertainty, such as not knowing where files, tests, configurations, or constraints are located, MSCE retrieves relevant L3 environmental cognition\. The retrieved L3 cognition provides environmental priors but does not directly prescribe actions\.

### 8\.10Decision Guidance and Repair

MSCE converts repeated contrastive evidence into decision guidance𝒟\\mathcal\{D\}\. When two action patterns occur in similar contexts but lead to substantially different values, and the lower\-valued pattern is supported by failures or user corrections, MSCE creates a guidance item:

d=\(c,a\+,a−,e,ξ\),d=\(c,a^\{\+\},a^\{\-\},e,\\xi\),whereccis the context,a\+a^\{\+\}is the preferred action,a−a^\{\-\}is the action to avoid,eecontains evidence links, andξ\\xiis guidance reliability\. Guidance is injected only when its context matches the current skill or policy trigger\. Later feedback can increase, decrease, or retireξ\\xi\.

### 8\.11Storage and Privacy Controls

Because L1 traces may contain user text, tool outputs, file paths, or environment\-specific information, MSCE applies bounded persistence\. Long fields are truncated, repeated adjacent steps are deduplicated, and sensitive strings are removed through rule\-based redaction before storage\. Higher\-level memories store evidence identifiers rather than raw unbounded observations\. These controls reduce memory bloat and limit propagation of sensitive content, although they do not eliminate all privacy risks\.

Table 5:L1 traces from two distinct tasks demonstrating cross\-task L2 policy induction\. Task\-level feedback \(RA=0\.8R\_\{A\}=0\.8,RB=0\.9R\_\{B\}=0\.9\) is backpropagated using reflection weights \(α\\alpha\) to compute step values \(VV\)\.

## 9Example: Environment Dependencies

To illustrate the MSCE workflow more clearly, consider an agent resolving environment dependencies across two distinct tasks shown in Table[5](https://arxiv.org/html/2607.16621#S8.T5)\.

InTask A\(“Installlxmlin Alpine”\), the agent’s initialpip installfails\. The agent reflects on the missing C\-library, installs it via the package manager, and succeeds\. The user’s positive feedbackRA=0\.8R\_\{A\}=0\.8is backpropagated using the reflection weightsα\\alpha, assigning high trace valuesVVto these exploratory steps\. For instance, assuming a discount factorγ=0\.9\\gamma=0\.9, the value of the key discovery stepf1,1\(1\)f\_\{1,1\}^\{\(1\)\}is computed via reflection\-weighted backfilling asV=0\.7×0\.8\+\(1−0\.7\)×0\.9×0\.8=0\.776V=0\.7\\times 0\.8\+\(1\-0\.7\)\\times 0\.9\\times 0\.8=0\.776\. Since no existing L2 policy matches, these L1 traces enter the candidate pool\.

Later, inTask B\(“Deploy Django App”\), a similar failure occurs withpsycopg2on a Debian\-based container\. The user confirms the resolution, yielding another set of high\-value traces\.

Upon the arrival of Task B’s traces, the online update operator𝒰\\mathcal\{U\}detects a cross\-task overlap \(container environment,pipcompilation failure, missing system libraries\) betweenf1,1\(1\)f\_\{1,1\}^\{\(1\)\}andf2,1\(1\)f\_\{2,1\}^\{\(1\)\}\. This triggers the induction of anL2 policy:

- •Trigger:pip installfails due to missing system libraries in a container\.
- •Procedure:Parse the missing component→\\rightarrowidentify the OS package manager \(e\.g\.,apkorapt\-get\)→\\rightarrowinstall the corresponding\-devlibrary→\\rightarrowretrypip install\.
- •Boundary:Containers only; excludes native systems with pre\-installed libraries\.

As this L2 policy demonstrates stable positive gain, MSCE abstracts anL3 environmental cognition\(e\.g\., the three\-layer dependency structure of Python C\-extensions\) and crystallizes the policy into askill, avoiding redundant trial\-and\-error in future tasks\.

## 10Experimental Details

### 10\.1Experimental Settings

#### Evaluation Protocol

On EvoAgentBench, for taskii, the per\-task success rate isPass​@​1i=1ni​∑j=1ni𝕀​\[ri,j\>τ\]\\mathrm\{Pass@1\}\_\{i\}=\\frac\{1\}\{n\_\{i\}\}\\sum\_\{j=1\}^\{n\_\{i\}\}\\mathbb\{I\}\[r\_\{i,j\}\>\\tau\]\. The benchmark\-level Pass@1 is the unweighted mean over tasks,Pass​@​1=1N​∑i=1NPass​@​1i\\mathrm\{Pass@1\}=\\frac\{1\}\{N\}\\sum\_\{i=1\}^\{N\}\\mathrm\{Pass@1\}\_\{i\}, with standard error computed across tasks\. Regarding how rewardrris assigned, we follow the EvoAgentBench settings\. Information Retrieval uses LLM\-as\-a\-judge with exact\-match fallback \(r∈\{0,1\}r\\in\\\{0,1\\\}\)\. Reasoning uses normalized exact matching or optional LLM\-based mathematical equivalence \(r∈\{0,1\}r\\in\\\{0,1\\\}\)\. Software Engineering follows the official SWE\-benchresolvedcriterion \(r∈\{0,1\}r\\in\\\{0,1\\\}\)\. Code Implementation requires passing all hidden test cases \(r∈\{0,1\}r\\in\\\{0,1\\\}\)\. Knowledge Work uses LLM rubric scoring with a ClawWork\-compatible cliff: scores below0\.60\.6are mapped to failure, and success requiresr\>0\.6r\>0\.6\.

#### Hyperparameters

Table[6](https://arxiv.org/html/2607.16621#S10.T6)lists the principal hyperparameters used in our implementation\. These values are not intrinsic to MSCE and can be tuned for different environments\.

Table 6:Principal MSCE hyperparameters\.

### 10\.2Effect of Simulated Human Feedback

MSCE is designed to use not only numerical environment rewards but also textual user feedback\. To examine whether textual episode\-level feedback provides useful learning signals, we conduct an additional controlled study on EvoAgentBench with LLM\-simulated human feedback\. This experiment also provides an indirect validation of the reward quantification mechanism in Appendix[8\.3](https://arxiv.org/html/2607.16621#S8.SS3), since the simulated feedback is converted into scalar terminal feedback by the same quantification module used in MSCE\.

#### Setup\.

We compare two configurations\.C0denotes the default MSCE setting without injected simulated human feedback\.C1augments episode\-level feedback with simulated human feedback generated by an LLM mentor \(Opus 4\.7 Max\)\. For failed or blocked training trajectories, the mentor observes the task prompt, agent trajectory, failure or blocker signal, verifier result, and existing memory/reflection content, and produces a concise root\-cause\-aligned feedback message\. The feedback is written in the same style and format as existing memory or reflection content, so that it does not introduce a new memory schema or additional test\-time hints\. This feedback is injected only during the online evolving phase and is then quantified into terminal feedbackRiR\_\{i\}using the reward quantification mechanism in Appendix[8\.3](https://arxiv.org/html/2607.16621#S8.SS3)\. At evaluation time, no simulated feedback is generated; the agent uses only the memory and skills accumulated during training\.

#### Feedback generation prompt\.

The LLM mentor is instructed to behave like an experienced human coach rather than an oracle\. It must not provide final answers, complete code, or task\-specific shortcuts\. Instead, it identifies what the agent was trying to do, where the reasoning or action deviated from the correct path, why the deviation caused failure or blockage, what general principle should be remembered, and which concrete evidence or check should be prioritized in similar future tasks\. This design encourages feedback that is reusable as training memory rather than direct supervision for a particular evaluation instance\.

#### Results\.

Table[7](https://arxiv.org/html/2607.16621#S10.T7)comparesC0andC1\. Simulated feedback improves Pass@1 on four of the five domains, with the largest gains on KW and SE, whereC1improves Pass@1 by\+13\.79\+13\.79and\+7\.69\+7\.69points, respectively\. Code and IR also improve by\+2\.56\+2\.56and\+1\.54\+1\.54points, while Math remains unchanged, suggesting that its bottleneck may lie more in exact symbolic correctness than in procedural improvement driven by richer feedback\.

The cost trend is mixed:C1reduces cost on Code, IR and SE but increases cost on KW, and Math\. This suggests that richer feedback can reduce redundant exploration in some tool\-use tasks, while encouraging more verification or elaboration in others\. Overall, these results suggest that episode\-level textual feedback can provide useful additional supervision for MSCE’s memory–skill evolution, and that the proposed reward quantification mechanism can convert such feedback into effective update signals\.

Table 7:Effect of LLM\-simulated human feedback on EvoAgentBench\. C0 denotes MSCE without simulated feedback, and C1 denotes MSCE with simulated feedback injected during training\. Cost is measured in chars for Math and turns for other domains, so cost comparisons should be made within each domain\.

## 11Prompted Operators

MSCE uses LLMs for five evidence\-constrained operators: reflection scoring, reward quantification, L2 policy induction, and L3 environmental cognition abstraction, and skill drafting\. All prompted operators are required to return structured fields and evidence identifiers\. Outputs that lack required fields, refer to unsupported evidence, or introduce unsupported tools are discarded rather than inserted into memory\.

### 11\.1Reflection Scoring

Given a step context\(si,t,ai,t,oi,t,ρi,t\)\(s\_\{i,t\},a\_\{i,t\},o\_\{i,t\},\\rho\_\{i,t\}\), the reflection scorer estimatesαi,t∈\[0,1\]\\alpha\_\{i,t\}\\in\[0,1\]\. The rubric considers four aspects: faithfulness to the observed step, causal insight, transferability to future tasks, and concreteness\. Empty or tautological reflections receiveαi,t=0\\alpha\_\{i,t\}=0\. If reflection scoring is disabled, non\-empty reflections receive a neutral valueαi,t=0\.5\\alpha\_\{i,t\}=0\.5; malformed judge outputs fall back to the existing reflection metadata rather than updating the trace\. In batched mode, all steps in a short task are scored jointly so that the judge can compare their relative contribution\. The specific prompt \(Πreflexion​\_​score\\Pi\_\{\\mathrm\{reflexion\\\_score\}\}\) is provided as follows:

Youareastrictreviewerofagentself\-reflections\.

YouseetheFULLcontextofoneagentstep:

\-STATE—whattheagentsawbeforeacting\(userprompt,priorobservation\)

\-THINKING—theLLM’sownnativechain\-of\-thoughtforthisstep,ifany\(Claudeextended\-thinking,pi\-aiThinkingContent\)\.Emptywhenthemodeldidn’temitthinkingthisturn\.

\-ACTION—whattheagentproduced\(assistanttextoutput\)

\-TOOL\_CALLS—toolstheagentinvokedthisstep,withinputsandoutputs\(orerrors\)\.Toolusage\+outcomesarepartoftheactionchainandcarrytheirownsignalaboutwhattheagentdid\.

\-OUTCOME—thefinalobservableresultofthestep\(lasttooloutcomeor"\(assistant\-onlystep\)"forpuretextturns\)

\-REFLECTION—thetextbeinggraded:theagent’sfirst\-personexplanationofWHYitactedthiswayandWHATitlearned\.

ScoretheREFLECTIONonfouraxes,combinedintoONEnumberα∈\[0,1\]:

1\.faithfulness—doesthereflectionmatchwhatACTUALLYhappenedacrossTHINKING\+ACTION\+TOOL\_CALLS\+OUTCOME?

2\.causalinsight—doesitidentifywhytheaction/toolchoiceworkedorfailed?Bonuswhenitconnectsthemodel’svisibleTHINKINGtotheresultingaction\.

3\.transferability—doesitsurfacealessonusefulonasimilarfuturetask?

4\.concreteness—arethedetailsspecific\(realcommandnames,realerrormessages,realdecisions\)ratherthangenericplatitudeslike"Ishoulddobetter"?

Rules:

\-THINKINGandTOOL\_CALLSarefirst\-classevidenceforgradingα—areflectionthatignoresavisiblethinkingchainormisreportsatoolcallshouldscoreLOWonfaithfulness\.

\-TOOL\_CALLSthaterroredarestrongsignal:thereflectionshouldnametheerrorandwhatitimplied\.Missingthatisafaithfulnesspenalty\.

\-Anempty/purely\-tautologicalreflection→α=0,usable=false\.

\-α≥0\.4ANDreflectionnon\-tautological→usable=true;elsefalse\.

ReturnJSON:

\{

"alpha":0\.0\-1\.0,

"usable":true\|false,

"reason":"one\-sentencejustification"

\}

### 11\.2Reward quantification\.

When no numerical environment reward is available, textual user feedback is converted intoRiR\_\{i\}\. The evaluator scores goal achievement, process quality, and user satisfaction\. The input includes the original queryqiq\_\{i\}, the final outputy^i\\hat\{y\}\_\{i\}, a compact episode summary, and user feedbackhih\_\{i\}\. The specific reward quantification prompt \(Πreward\\Pi\_\{\\mathrm\{reward\}\}\) is as follows:

YouareastrictgraderofAI\-agenttaskexecution\.

Youreceive:

\-TASK\_SUMMARY—theFULLconversationarcforthistask:\*USER\_ASKS\_AND\_AGENT\_REPLIESlistseveryuserturnpairedwiththeagent’scorrespondingreply,inchronologicalorder\.One"task"frequentlyspansmultipleuserturnsastheuserrefines/followsup/pivotstopicswithinthesamesession\.\*MOST\_RECENT\_USER\_ASKandMOST\_RECENT\_AGENT\_REPLYcalloutthefinalexchangeexplicitly—thatisusuallythetruestsignalofwhethertheagentisactuallytrackingwheretheuserisnow\.

\-FEEDBACK—theuser’sownmessagesAFTERthetaskattemptfinished\.Maybeshort\("okthanks"\),explicit\("tryagainwithX"\),orstructured\("resolved,buttooslow"\)\.Frequentlyempty\.

GradetheagentonTHREEINDEPENDENTAXES,eachin\[\-1,1\]:

1\."goal\_achievement"—didtheagentaddresswhattheuserACTUALLYasked?

\+1\.0everyuseraskacrosstheexchangewasaddressedcorrectly\.

\+0\.3thelastaskwasaddressedwell;earlieraskshadminorgaps\.

0\.0uncleariftheuser’saskwasmet\.

\-0\.3missedasignificantportionofwhatwasasked\.

\-1\.0fundamentallywronganswer/causeddamage\.

CRITICALRULE—doNOTanchoronthefirstuserturn\.Auserwhostartswith"上海天气"andlaterpivotsto"再查北京天气"isauserwhosegoalhasEVOLVED;iftheagentansweredBeijingonthefinalturnwhenaskedaboutBeijing,thatisgoal\-achievement=POSITIVE,notnegative\.Judgeeachuseraskonitsownmerits,weightedtowardthemostrecentexchange\(whichiswheretheuseractuallyisnow\)\.

2\."process\_quality"

\+1\.0clean,minimal,correctreasoningacrossallturns\.

0\.0reasonablebutnotgreat\.

\-1\.0lotsofthrashing,wrongtools,noisyoutput\.

3\."user\_satisfaction"\(fromFEEDBACKtexttone\+trailinguserasks\)

\+1\.0thanks/happy/"做的很好"/acceptsandclosesout\.

\+0\.3movesonneutrallytonextaskornewtopic\.

0\.0noemotionalsignaleitherway\.

\-0\.3asksforcorrection\("no,doXinstead"/"重做"\)\.

\-1\.0hard\-stops,expressesfrustration\.

Rules:

\-IfFEEDBACKisempty,infersatisfactionCONSERVATIVELYfromthelastexchange’stone\.Afollow\-upquestionisusually≈0\(neutralcontinuation\),NOTnegative\.Neverinventanger\.

\-BasescoresONLYonwhatTASK\_SUMMARYactuallydescribes—donotassumefactsnotshown\.

\-YouaregradingtheHOSTAGENTdescribedinHOST\_AGENT\_CONTEXT,notyourself\.DoNOTuseyourownmodelidentity,provider,policies,orcapabilitiestodecidewhetherthehostagentansweredidentity/modelquestionscorrectly\.IfhostModel/hostProviderareprovided,treatthemastheauthoritativeruntimecontextunlesstheconversationitselfcontainsacorrection\.

\-Produceoneshortjustification\.

ReturnJSON,EXACTLYthisshape\(noextrakeys,nocommentary\):

\{

"goal\_achievement":numberin\[\-1,1\],

"process\_quality":numberin\[\-1,1\],

"user\_satisfaction":numberin\[\-1,1\],

"label":"success"\|"partial"\|"failure"\|"unknown",

"reason":"one\-sentencejustification"

\}

### 11\.3L2 induction\.

The L2 induction prompt receives evidence traces selected from distinct episodes\. Each evidence item contains a compact state, action, outcome, valueVV, reflection weightα\\alpha, and evidence id\. The model is asked to produce a trigger, procedure, verification rule, applicability boundary, and supporting evidence ids\. The prompt \(Πpolicy\\Pi\_\{\\mathrm\{policy\}\}\)is explicitly restricted to procedural knowledge: declarative environment facts are deferred to L3 abstraction as follows:

Youinducereusable\*\*proceduralpolicies\*\*fromagentexperience\.

Apolicyisa"how\-to":"whenyouseeconditionXintheagent’sstate,doactionY,verifywithZ,watchoutforcaveatW\."Itis\*\*NOT\*\*adescriptionoftheenvironment\.

InputTRACES:alistof\{state\_summary,action,outcome,utility\}recordsthatallshareasimilarstatesignature\.

ProduceONEpolicydescribingtheactionpattern\.Thepolicymust:

\-NameaTRIGGERrecognizablefromtheagent’sSTATE—aconditiontheagentcandetectatthemomentofdecision\(anerrorcode,amissingfile,arequestshape\)\.NOTafactabouttheenvironmentingeneral\.

\-PrescribeanACTIONtemplate—aparameterizedsteporshortstepsequence\.Templatesoversingleexactcommands\.NOTasingleexample\.

\-NoteatleastoneCAVEATorfailuremodeobservedinthetraces—astep\-levelpitfall,NOTagenericenvironmenttaboo\.

\-Generalizeacrosstheinputtraces,notrestateoneofthem\.

────────────────────Boundaries—whatNOTtowrite────────────────────

Thisoutputisa\*\*proceduralpolicy\*\*,notenvironmentalcognition\.Environmentalcognitionlivesinaseparatelayer\(L3\)generatedbyadifferentprompt\.Cross\-contaminationoneithersidedilutesboth\.

DoNOTwriteanyofthese—theybelongtoL3\(environmentalcognition\),nothere:

\-Topologyfacts:"Alpinecontainersshipmusllibc""Pythondepsforma3\-layerstack""src/components/holdsReactcomponents"

\-Environmentbehaviouralrules\(inpuredeclarativeform\):"binarywheelsareincompatiblewithmusl""theservicereadsconfigonlyatstartup"

\-Environmenttaboosdetachedfromaspecificactionchoice:"thisdirectoryisread\-only""productiontablesshouldn’tbeDROPpedlightly"

Ifatracetellsyoutheenvironmentlooksacertainway,FOLDthatfactINTOthetriggerorcaveatasastate\-levelCONDITIONtheagentcancheck,notasastandalonedescription\.Example:

Wrong\(driftsintoenv\-fact\):

trigger:"Alpineshipsmusllibc"

caveats:\["Pythondepshavea3\-layerstack"\]

Right\(statesitasactionableconditions\):

trigger:"containerisAlpineANDpipinstallfailswith’<lib\>notfound’or’headernotfound’"

caveats:\["iffirstapkaddstillfails,alsocheckmusl\-vs\-glibcwheelcompatibilitybeforeretrying"\]

────────────────────Samefact,twoframings─────────────────────

Iftheunderlyingtruthis"Alpinecontainersdon’tshipsystemdevlibsbydefault":

Expresshere\(procedural\):"WhenpipinstallfailsinsideanAlpinecontainerwithamissingsystemlibrary,runapkadd<pkg\>\-devthenretrypip\."

DoNOTexpresshere\(declarative—that’sL3’sjob\):"Alpinecontainerimagesshiponlythepure\-PythontierofthePythondependencystack\."

────────────────────Output─────────────────────

ReturnJSON:

\{

"title":"shortimperativetitle",

"trigger":"state\-levelconditiontheagentcandetect",

"action":"templatedsteporstepsequence",

"rationale":"whythisactionworksONTHESETRACES\(notwhythe

environmentbehavesthisway\)",

"caveats":\["step\-levelpitfallstring",\.\.\.\],

"confidence":numberin\[0,1\],

"support\_trace\_ids":\["tr\_\.\.\.",\.\.\.\]

\}

### 11\.4L3 abstraction\.

The L3 abstraction prompt receives a cohort of active L2 policies and representative evidence\. It extracts declarative environment knowledge in three fields: entities or structuresℰ\\mathcal\{E\}, action–response regularitiesℐ\\mathcal\{I\}, and constraints𝒞\\mathcal\{C\}\. The prompt \(Πenv\\Pi\_\{\\mathrm\{env\}\}\) forbids imperative procedural instructions, so that L3 remains an environmental cognition rather than a skill as follows:

Youabstractenvironmentalcognitionfromcross\-taskpolicyevidence\.

Anenvironmentalcognitionmodelis\*\*declarative\*\*knowledgeabouthowtheenvironmentIS:

itstopology,itscausal/behaviouralregularities,itstaboos\.Itis\*\*NOT\*\*arecipeforwhattodo—thatlivesintheL2procedurallayer,generatedbyaseparateprompt\.Cross\-contaminationoneithersidedilutesboth\.

InputPOLICIES:alistofL2policies\(withtrigger/procedure/verification/boundary/support/gain\),plusashortsampleoftheL1tracesthatmintedeach\.Everypolicysharesacompatibledomain\(matchedbyprimarytag/tool\)\.

ProduceONEenvironmentalcognitionmodeldescribingthe\*\*environment\*\*thosepolicies

operatein\.Itmustanswer:

\-Environmenttopology\(ℰ\)—whatliveswhere,whatistheshapeofthisenvironment?Purefactsofexistenceandstructure\.

GOOD:"Alpinecontainersshipmusllibc,noglibc"

"Nodeprojectreposgroupsourceundersrc/"

"macOSbundlesBSDsed;LinuxdistrosbundleGNUsed"

BAD\(driftsintoprocedure\):

"useapkaddtoinstallsystemlibs"

"preferPythonscriptsoversedonmacOS"

\-Inferencerules\(ℐ\)—howdoestheenvironmentcausallyrespondtocommonstimuli?Phraseascause→effect,NOTasguidance\.

GOOD:"loadingaglibc\-linkedbinarywheelinsideAlpineraisesadynamic\-linkerror""editingconfig\.yamldoesnotpropagateuntiltheprocessrestarts\(noin\-processwatcher\)"

BAD\(driftsintoprocedure\):"ifpipinstallfails,installdevlibsandretry"←that’sanactionplan,belongstoL2"alwaysrestarttheserviceaftereditingconfig"←that’sarecommendation,belongstoL2

\-Constraints\(C\)—whatfactsoftheenvironmentmakesomeactionsunsafeorinvalid?StatetheFACT,nottheavoidancebehavior\.

GOOD:"node\_modules/isrewrittenbynpminstall;manualeditsarelostonthenextsync""productiondatabasetablesholdcustomerdata;destructiveDDLisirreversible"

BAD\(driftsintoprocedure\):"don’teditnode\_modules/directly"←that’sabehaviouralrule,belongstoL2/decisionrepair"don’trunDROPTABLEinproduction"←same—phrasetheunderlyingenvironmentfactinstead

DoNOT,underanysection:

\-Useimperativeorrecommendationverbs\(do/don’t/should/use/prefer/avoid/try/install/run\)\.Theenvironmentalcognitionnevertellstheagentwhattodo\.

\-Restateasingletrace—thecognitionmodelmustgeneraliseacrosspolicies\.

\-Includeadvicetiedtoasingleuserorsession\.

────────────────────Samefact,twoframings─────────────────────

Iftheunderlyingtruthis"Alpinecontainersdon’tshipsystemdev

libsbydefault":

Expresshere\(declarative\):

inference:"PythonC\-extensionpackagesfailtocompileinAlpine

containerswhenthematchingsystemheader/library

packageisnotpre\-installedintheimage\."

DoNOTexpresshere\(procedural—that’sL2’sjob\):

"WhenpipfailsinAlpine,apkadd<pkg\>\-devandretrypip\."

────────────────────Output─────────────────────

ReturnJSON:

\{

"title":"shortnounphrase,e\.g\.’Alpinepythondependencymodel’",

"domain\_tags":\["tag1","tag2"\],//1\-4short,lowercase,nospaces

"environment":\[

\{"label":"\.\.\.","description":"\.\.\.","evidenceIds":\["po\_\.\.\.","tr\_\.\.\."\]\}

\],

"inference":\[\{"label":"\.\.\.","description":"\.\.\.","evidenceIds":\[\]\}\],

"constraints":\[\{"label":"\.\.\.","description":"\.\.\.","evidenceIds":\[\]\}\],

"body":"renderedmarkdownsummaryofthethreesections",

"confidence":numberin\[0,1\],

"supersedes\_cognition\_ids":\[\]//optional:priorcognitionthisrefines

\}

### 11\.5Skill drafting\.

The skill crystallization prompt receives the source L2 policy, ranked supporting evidence, optional counter\-examples, a whitelist of observed tools, decision\-guidance seeds, and the existing skill naming space\. It returns a callable procedure with preconditions, ordered steps, examples, and decision guidance\. The generated skill is accepted only if its tools and claims are supported by the evidence set\. The specific prompt \(Πskill\\Pi\_\{\\mathrm\{skill\}\}\) is as follows:

Youcrystallizeaskillanagentshouldbeabletocall\.

Input:

\-POLICY:theL2policybeingpromoted\(trigger/action/rationale/caveats\)\.

\-EVIDENCE:3\.\.10successfultracesthatsupportthepolicy\.

\-EVIDENCE\_TOOLS:theexhaustivelistoftool/commandnamesthatactuallyappearedintheevidencetraces’toolcalls\.Thisistheground\-truth

whitelist—your‘tools‘outputMUSTbeasubsetofthislist\.

\-COUNTER\_EXAMPLES\(optional\):traceswithV<0fromthesamecontext—

failuresthepolicyismeanttoprevent\.

\-REPAIR\_HINTS\(optional\):aJSONblock\{preference:\[\.\.\.\],antiPattern:\[\.\.\.\]\}attachedtothepolicybythedecision\-repairpipeline\.Theseareconcrete"prefer/avoid"linessynthesisedfromearlierfailures\+userfeedback;treatthemasauthoritativeseedsfor‘decision\_guidance‘below\.

\-NAMING\_SPACE:alistofexistingskillnamestoavoidcollidingwith\.

ReturnJSON:

\{

"name":"snake\_case\_identifier,≤32chars,uniquevsNAMING\_SPACE",

"display\_title":"humantitleinuser’slanguage",

"summary":"2\-3sentencedescriptionofwhattheskilldoesandwhentouseit",

"parameters":\[

\{"name":"\.\.\.","type":"string\|number\|boolean\|enum","required":true\|false,

"description":"\.\.\.","enum":\["\.\.\."\]\}

\],

"preconditions":\["bullet",\.\.\.\],

"steps":\[

\{"title":"short","body":"markdown\-friendlyparagraphdescribingthestep"\}

\],

"examples":\[

\{"input":"\.\.\.","expected":"\.\.\."\}

\],

"tools":\["tool\_or\_command\_name",\.\.\.\],

"decision\_guidance":\{

"preference":\["Prefer:…",\.\.\.\],//concreteactionstofavour,≤5

"anti\_pattern":\["Avoid:…",\.\.\.\]//concreteactionstoavoid,≤5

\},

"tags":\["optionalstring",\.\.\.\]

\}

Rules:

\-‘tools‘MUSTonlycontainnamesfromEVIDENCE\_TOOLS\.Neverinventtoolnamesthatarenotinthewhitelist\.Includeeverytooltheskill’sprocedureactuallyinvokes—omittoolsnotreferencedinyoursteps\.

\-Keep"steps"short\(2\-6items\)\.

\-‘summary‘mustbeself\-containedsotheagentcandecidewhethertocallthisskillwithoutreadingthefullSKILL\.md\.

\-For‘decision\_guidance‘:

\-IfREPAIR\_HINTSisnon\-empty,foldeachlineinverbatim\(orlightlynormalised\)—theyarealreadygroundedinevidenceanduserfeedback\.

\-YouMAYadd1–2extraentriesderivedfromcontrastingEVIDENCE\(high\-V\)vsCOUNTER\_EXAMPLES\(low\-V\),iftheymateriallyclarifythedecision\.Don’tinventguidanceunsupportedbytheinputs\.

\-Eachentryshouldbeoneshort,actionablesentence\(≤200chars\)\.

\-Emptyarraysarefinewhenthere’snothingtosay—neverfabricate\.

Similar Articles

ContinualSkillBench: Can LLM Agents Truly Evolve Their Capabilities?

Hugging Face Daily Papers

Introduces ContinualSkillBench, a dynamic evaluation framework for in-context continual skill learning in LLM agents, showing that while sequential execution improves performance, current methods struggle to consolidate experience into robust, transferable skills.

LifeMem: Enabling Lifelong Experience Reuse for LLM Agents

arXiv cs.CL

LifeMem is a lifelong learning framework that enables LLM agents to transfer knowledge across multiple environments by clustering interaction trajectories to extract reusable skills, reducing forgetting and improving cross-task transfer.

From Storage to Experience: A Survey on the Evolution of LLM Agent Memory Mechanisms

Hugging Face Daily Papers

This survey paper proposes an evolutionary framework for LLM agent memory mechanisms, categorizing their development into three stages: storage, reflection, and experience. It analyzes core drivers such as long-range consistency and continual learning to provide design principles for next-generation agents.