arXiv:2610.32295cs.AIOct 2026

Manuscript Offprint

arXiv:2610.32295

Lifelong Context Adaptation through Bidirectional Memory-Skill Learning

Tianyi Xu, Huazheng Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Lifelong LLM agents must learn from an expanding history of interactions while making each decision within a bounded context window. Memory makes past experience available, but the agent may still need to infer how to solve each new task from the retrieved records. Skills provide reusable procedures, yet may omit the task-specific facts needed to apply them. Because retrieved memory and skills shape the agent's behavior, they also influence the experience available for future learning. We introduce MEMCRYST, a framework for lifelong context adaptation through bidirectional learning of memory and skills with a frozen language model. Recurring episodes stored in memory support skill creation and revision, and the interactions guided by those skills supply new memory for subsequent learning. Facts retrieved from memory and learned skills jointly form the agent's context, while task outcomes adjust the future retrieval influence of the records actually served without rewriting their content. Across ten settings spanning embodied control, long-document reading, conversation, mathematics, and code, MEMCRYST leads seven reported comparisons. On ALFWorld, joint serving achieves 63.17% success, compared with 59.83% for memory-only and 50.50% for skill-only serving. Code is available at https://github.com/tianyi0216/Memcryst.git.

1 Introduction

LLM agents deployed over long periods encounter tasks whose solutions depend on earlier experience (Zhao et al., 2023; Yan et al., 2026). An agent may need to recall an entity's properties, reuse a successful procedure, or avoid a failure that occurred many interactions earlier. When the language model remains frozen, this experience can affect decisions only through the context supplied to it. The interaction history grows throughout deployment, while the context available for any one decision remains bounded. Lifelong adaptation therefore requires the agent to extract reusable decision structure from this history, preserve evidence for the current task, and adjust retrieval as further outcomes become available. We study how an agent can learn this external state online so that past experience improves subsequent decisions.

Previous work has used external memory to store past interactions, facts, or compressed notes for retrieval on later tasks (Xu et al., 2025; Fang et al., 2026a; Liu et al., 2026). These records provide evidence from earlier experience, but the agent may still need to work out a procedure each time a similar task recurs. Other approaches learn reusable procedures, or skills, from experience to guide later tasks (Wang et al., 2024a; Zheng et al., 2025a; Ni et al., 2026), but these procedures may omit the task-specific facts and constraints needed to apply them. Recent systems combine memory and skills: MUSE-AutoSkill organizes experience around evolving skills, while MSCE uses stored evidence and feedback to guide skill development (Lin et al., 2026; Tang et al., 2026). Maintaining both, however, does not by itself ensure that the retrieved facts and skills are useful for the current task. A fact may be correct but irrelevant, and a skill may not fit the current situation. Failure can therefore inform future retrieval without establishing that the retrieved content should be rewritten. Meanwhile, skill-guided interactions supply new memory for subsequent skill revision. The challenge is to learn from this experience while using task outcomes to adjust which facts and skills enter later contexts.

We introduce MEMCRYST to adapt context through bidirectional memory–skill learning. Even with frozen model parameters, retrieved context changes the agent’s actions and thus the experiences available for subsequent learning. MEMCRYST stores experience in memory as episodic records and typed facts, and consolidates recurring episodes into conditional skills. At deployment, facts provide task-relevant evidence along-

∗^{*}Corresponding author.

side the procedures supplied by skills. Skill-guided interactions then enter memory and support later skill revision, completing the reverse path from skills to memory through behavior. In parallel, each task outcome updates the retrieval influence of the facts and skills actually served. Content construction draws on accumulated experience, while outcome return adjusts future use without regenerating record text. Both processes adapt the agent's context while leaving the language model frozen.

Across ten settings spanning embodied control, long-document reading, conversation, mathematics, and code, MEMCRYST leads seven reported comparisons. On ALFWorld, it reaches 63.17% success, exceeding memory-only by 3.33 percentage points and skill-only serving by 12.67 points. A separate 2×22 \times 2 intervention yields an observed interaction of +5.33 points between fact and skill return. One shared, domain-scoped state also improves the mean score from 28.30% to 44.50% over 1,018 queries interleaved across five domains. Frozen-state controls show higher success with relevant than random records, while skill-based context uses fewer injected tokens than episodic context. These results support the following contributions:

• Bidirectional memory–skill learning. We couple episode-based skill creation and revision with skill-guided behavior that supplies new memory for subsequent learning.

• Content and use adaptation. We separate evidence-based content updates from outcome-based updates to the retrieval influence of served facts and skills, coordinating both within a bounded context.

• Empirical evidence for the coupled design. We evaluate the complete system across task settings and interleaved deployment, and test joint serving, skill revision, and the interaction between the two return channels.