Lifelong Context Adaptation through Bidirectional Memory-Skill Learning
Organizations: Oregon State University
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
Figures & tables
| Method | ALFWorld | RULER | BABILong | Overall |
|---|---|---|---|---|
| ReAct | ||||
| ExpeL | ||||
| MemP | ||||
| SimpleMem | ||||
| LightMem | ||||
| MemCryst |
| System | RULER | BABILong | MATH-hard | MBPP | LoCoMo | Overall |
|---|---|---|---|---|---|---|
| ReAct | ||||||
| Specialist | ||||||
| MemCryst |
| Backbone | ReAct | MemCryst | pp |
|---|---|---|---|
| Qwen3-1.7B | |||
| Qwen3-8B | |||
| GPT-4o-mini |
| Configuration | SR% | vs. Full |
|---|---|---|
| ReAct | ||
| Memory-only | ||
| Skill-only serving | ||
| No skill revision | ||
| Full MemCryst |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Meaning | Symbol | Meaning |
|---|---|---|---|
| event index and stream horizon | event, mode, scoring flag, and scored set | ||
| frozen policy and produced trajectory | reward and evaluator-defined success | ||
| episode store, fact store, and skill catalog | disjoint union of the three content stores | ||
| mutable retrieval and outcome statistics | behaviorally active external state | ||
| supporting episode IDs | one episode, fact, and skill record | ||
| diagnosis, lesson, claim, type, applicability, procedure, and scope | fact provenance and episode lifecycle state |
| Check | Passing condition | |
|---|---|---|
| 1 | Instance literals | No names, identifiers, or varying numeric values from a single episode are baked into the procedure. |
| 2 | Borrowed framing | The skill is a reusable procedure rather than a paraphrase of one episode. |
| 3 | Runtime probes | Relevant preconditions are checked when the action space supplies a probe, or are stated explicitly otherwise. |
| 4 | Parametricity | Values that vary across uses appear as parameter slots. |
| 5 | Necessary setup | The procedure contains no setup step that cannot contribute to the task. |
| 6 | Workflow integrity | No declared tool call or required stage is silently bypassed. |
| Order | Successes | SR% | Clean | Cool | Examine | Heat | Move |
| Seed 101 | 359/600 | ||||||
| Seed 202 | 383/600 | ||||||
| Seed 303 | 379/600 | ||||||
| Seed 404 | 345/600 | ||||||
| Mean | |||||||
| Sample SD |
| Benchmark | Metric | Terminal score | Prequential score | |
|---|---|---|---|---|
| ALFWorld | Success rate | |||
| RULER | Recall | |||
| BABILong | Mean reward | |||
| LoCoMo | Token F1 | |||
| MBPP | Unit test reward |
| Method | SR% | vs. ReAct |
|---|---|---|
| ReAct | n/a | |
| Reflexion | ||
| SAGE | ||
| Live-Evo | ||
| Dynamic Cheatsheet | ||
| A-Mem |
| System | Successes / | SR% | 30 actions reached | Invalid actions |
|---|---|---|---|---|
| ReAct | 337/600 | 268 | 905 | |
| MSCE | 296/600 | 308 | 1,082 | |
| MemCryst | 379/600 | 226 | 661 |
| Block | Hyperparameter | Default |
| LLM | Primary backbone | Frozen Qwen3-8B |
| Role temperatures | actor , writer , synthesizer , and auditor | |
| State | Initial external state | empty episode store, fact store, and skill catalog |
| Memory | Episode weight | after success and after failure |
| Prior for a new fact | , hence | |
| Fact merge | same entity and scope with cosine threshold |
| Benchmark | State scope | Evaluation mode | Native reward | Return signal |
| Embodied control and reading long documents | ||||
| ALFWorld | persistent | legal text actions with a limit of 30 steps | binary success | |
| RULER | persistent for MemCryst | one document and one question per item with an answer context of 8,192 tokens | mean recall reward | |
| BABILong | persistent for MemCryst | one document and one question per item with an answer context of 8,192 tokens | mean reward | |
| Conversation and memory | ||||
| LoCoMo | per dialogue | session ingestion followed by short answers | token F1 | |
| Benchmark | Domain | Metric | |
| ALFWorld | Embodied control | 600 | Success rate |
| RULER | Long document reading | 400 | Recall |
| BABILong | Long document reading | 200 | Mean reward |
| LoCoMo | Conversation memory | 1,977 | Token F1 |
| LongMemEval | Conversation memory | 60 | Token F1 |
| DialSim-subst. | Conversation memory | 955 | Success rate |
Memory-Augmented Language Model Agents
Memory-augmented language model agents use persistent facts, interaction histories, and skills to support personalization and long-horizon tasks.
See all 444 papers