Source-linked AI summary

Learning to Continually Learn via Meta-learning Agentic Memory Designs

Yiming Xiong, Shengran Hu, Jeff Clune

arXiv:2602.07755v1cs.AI

TL;DR

Stateless foundation models limit agents’ ability to continually learn from experience. ALMA meta-learns executable memory designs, outperforming human-designed baselines across four sequential decision-making domains.

  • Problem

    Stateless foundation models struggle to accumulate and reuse experience, while existing memory designs are mostly human-crafted and fixed.

    Source: §1 · p. 1
  • Method

    ALMA uses a Meta Agent to explore executable code-based memory designs that collect, summarize, and reuse experience.

    Source: §3 · p. 3, §3.1 · p. 3
  • Results

    6.2% overall improvement over the no-memory baseline with GPT-5-nano, while outperforming all human-designed baselines across benchmarks.

    Source: §1 · p. 2, §4.4 · p. 6
  • Takeaways & Limitations

    ALMA provides a principled approach for automatically discovering memory designs that support continual learning across sequential decision-making domains.

    Source: §5 · p. 8

    ALMA learns memory designs from a predefined learning set rather than dynamically learning them online on new tasks.

    Source: §5 · p. 8

Abstract

from arXiv · show

The statelessness of foundation models bottlenecks agentic systems' ability to continually learn, a core capability for long-horizon reasoning and adaptation. To address this limitation, agentic systems commonly incorporate memory modules to retain and reuse past experience, aiming for continual learning during test time. However, most existing memory designs are human-crafted and fixed, which limits their ability to adapt to the diversity and non-stationarity of real-world tasks. In this paper, we introduce ALMA (Automated meta-Learning of Memory designs for Agentic systems), a framework that meta-learns memory designs to replace hand-engineered memory designs, therefore minimizing human effort and enabling agentic systems to be continual learners across diverse domains. Our approach employs a Meta Agent that searches over memory designs expressed as executable code in an open-ended manner, theoretically allowing the discovery of arbitrary memory designs, including database schemas as well as their retrieval and update mechanisms. Extensive experiments across four sequential decision-making domains demonstrate that the learned memory designs enable more effective and efficient learning from experience than state-of-the-art human-crafted memory designs on all benchmarks. When developed and deployed safely, ALMA represents a step toward self-improving AI systems that learn to be adaptive, continual learners.

1. Introduction

Foundation models’ statelessness limits agentic systems’ ability to accumulate experience and continually learn, while handcrafted memory designs are difficult to tailor across domains. ALMA addresses this by meta-learning executable memory designs through open-ended exploration and demonstrates improved continual learning across four sequential decision-making domains.

Motivation

  • Foundation models’ statelessness prevents agentic systems from accumulating and reusing experience, causing repeated task solving and limiting continual improvement.Memory addresses this limitation by storing past experiences and reusing them to inform future decisions.Source: §1 · p. 1
  • Handcrafted memory designs must be tailored to domain-specific experience, making optimal design identification difficult and labor-intensive.Conversational agents may retain user facts, whereas strategic games may require abstract skills and strategies.Source: §1 · p. 1

Contribution

  • ALMA replaces manual memory engineering with learned domain-specialized memory designs, following the broader machine-learning shift from handcrafted components to learned ones.The paper investigates whether agentic systems can learn to continually learn by automating memory-component design.Source: §1 · p. 1

Method

  • ALMA uses a Meta Agent to search an open-ended code space, enabling the theoretical construction of arbitrary memory designs.The Meta Agent samples archived designs, reflects on their code and evaluation logs, implements new designs, validates and evaluates them, and returns results to the archive.Source: §1 · p. 2, Figure 1 · p. 2

Evaluation

  • ALMA consistently surpasses state-of-the-art human-designed memory baselines across four sequential decision-making domains while using memory more cost-efficiently than most baselines.The evaluation covers ALFWorld, TextWorld, Baba Is AI, and MiniHack; learned designs also scale better with memory size and learn faster under task distribution shifts.Source: §1 · p. 2

2. Related Work

Prior work studies explicit and implicit memory for continual learning, automated learning-to-learn methods, and automated agentic-system design. ALMA focuses on token-level memory and open-ended code-based exploration to optimize memory designs for continual learning rather than one-shot performance.

Memory for Agentic Systems

  • Token-level, parametric, and latent memory mechanisms support continual learning, with ALMA focusing on token-level memory for faster evaluation and more interpretable, transferable representations.Token-level memory explicitly stores and retrieves interaction experiences, whereas parametric and latent memory encode experience in model weights or hidden states.Source: §2 · p. 2

AI-generating algorithms and the “Learning to learn” paradigm

  • ALMA aligns with the learning-to-learn pillar of AI-generating algorithms by using a foundation-model-powered Meta Agent to propose novel memory designs through code.Unlike approaches targeting architectures or environment generation, ALMA learns memory designs that improve agents’ continual learning across tasks.Source: §2 · p. 3

Automated Design of Agentic Systems

  • Unlike prior automated agentic-system designs that primarily evaluate one-shot performance, ALMA explicitly optimizes memory designs for learning from past experience over time.Code-based search spaces theoretically permit learning memory components, but ALMA targets continual-learning capability directly.Source: §2 · p. 3
  • ALMA explores memory designs open-endedly from scratch, contrasting with concurrent work that initializes from handcrafted designs and greedily selects top performers.The paper reports that ablations show open-ended exploration can learn better memory designs than greedy-selection-based optimization.Source: §2 · p. 3

3. Learning of Memory Designs

ALMA meta-learns executable memory designs through open-ended exploration by a Meta Agent, using a flexible code-based space and evaluating designs through collection and deployment phases. The framework supports modular memory operations, adaptive evaluation modes, and iterative proposal, debugging, and archive-based refinement.

3. Learning of Memory Designs

  • ALMA uses a Meta Agent to iteratively propose, implement, debug, and evaluate executable memory designs based on previously discovered designs.The process enables memory designs that collect, summarize, and reuse experience through open-ended code-based exploration.Source: §3 · p. 3

3.1. Search Space for Memory Designs

  • Code provides a theoretically unrestricted and interpretable search space, structured around general update() and retrieve() interfaces with hierarchical, modular sub-modules.Sub-modules can implement separate logic, maintain databases, and pass outputs sequentially; examples include vector- and graph-database components in ReasoningBank (Ouyang et al., 2025) and G-memory (Zhang et al., 2025a).Source: §3.1 · pp. 3–4

3.2. Evaluation of Memory Designs

  • Memory designs are evaluated by collecting experience first, then measuring deployment success with a fixed agentic system under static or dynamic retrieval and update modes.Static mode tests use of fixed memory, whereas dynamic mode tests adaptation through updates and retrieval; learning uses static mode to reduce evaluation variance, while the best design is tested under both modes.Source: §3.2 · p. 4

3.3. Open-Ended Exploration

  • Open-ended exploration initializes an archive, samples designs by success and underexploration, and repeatedly proposes, debugs, evaluates, and archives new designs.Runtime errors trigger self-refinement for up to three attempts, while non-zero sampling probabilities preserve access to all candidates.Source: §3.3 · p. 4

4. Experiments

Across four sequential decision-making benchmarks, ALMA learns memory designs that outperform handcrafted baselines, transfer across foundation models, and adapt to domain demands. Additional analyses show benefits in exploration, sample efficiency, distribution-shift adaptation, and cost-performance tradeoffs.

4.1. Experiment Setup

  • ALMA uses learning and testing splits of four benchmarks, separates memory collection from deployment, and reports average success rates with standard error over three deployment runs.The learned designs are selected by learning-set success rate and evaluated against baselines on unseen testing data.Source: §4.1 · pp. 4–5, §4.4 · p. 5

4.2. Benchmarks

  • The benchmarks span embodied household tasks, partially observable text adventures, rule-manipulation puzzles, and long-horizon procedurally generated dungeons requiring experience unavailable in pretrained model knowledge.ALFWorld uses its default setting; TextWorld, Baba Is AI, and MiniHack use BALROG settings and prompts.Source: §4.2 · p. 5

4.3. Baselines

  • ALMA is compared with four handcrafted memory systems covering trajectory retrieval, task-based reasoning extraction, cumulative cheatsheets, and hierarchical graph-based retrieval.These baselines manually specify what to store, how to update memory, and how to retrieve knowledge for agentic-system contexts.Source: §4.3 · p. 5

4.4. Results

  • 6.2%: with GPT-5-nano, learned memory designs improve overall success rate over no memory and outperform all state-of-the-art human-designed baselines across benchmarks.The results indicate more effective storage and reuse of past experience for continual learning than manual designs.Source: §4.4 · p. 6, Table 1 · p. 6
  • 12.8%: learned memory designs improve overall average success rate over no memory with GPT-5-mini, outperform all human-designed baselines, and exceed the GPT-5-nano gain by 6.6%.The learned designs generalize across foundation models, with the larger improvement suggesting stronger support for more capable agentic systems.Source: §4.4 · p. 6, Table 1 · p. 6
  • Open-ended exploration outperforms greedy search on ALFWorld, reaching 12.4% versus 11.9% with GPT-5-nano and 87.1% versus 77.1% with GPT-5-mini.The Meta Agent also develops designs through intermediate mechanisms such as property validation, spatial normalization, and strategy switching.Source: §4.4 · p. 6, Figure 2 · p. 7
  • Learned memory designs specialize by domain, storing fine-grained spatial knowledge for object-interaction tasks and abstract strategies, strategy libraries, or plan synthesis for complex reasoning tasks.This specialization indicates that ALMA adapts memory structures to differing task requirements.Source: §4.4 · pp. 6–7, Figure 3 · p. 7
  • 84.1%: on ALFWorld distribution-shift evaluation, the learned design outperforms all human-designed baselines; it also achieves higher performance faster with limited data and scales better as trajectories increase.Across benchmarks, learned designs average 53.9% success with $0.09 overall end-to-end memory cost and appropriate retrieved-content token sizes.Source: §4.4 · pp. 7–8, Figure 4 · p. 8

5. Conclusion, Safety, and Future Work

ALMA learns memory designs that outperform manually designed baselines across sequential decision-making benchmarks, with evidence of scalability, transferability, and cost efficiency. Its deployment requires safeguards, while future work targets online adaptation and memory-native foundation models.

Conclusion

  • ALMA’s best-learned memory designs consistently outperform manually designed baselines across sequential decision-making benchmarks, demonstrating effective continual learning from experience.The authors characterize ALMA as a principled approach to learning memory design for agentic systems.Source: §5 · p. 8

Safety

  • Learned memory designs require safety controls because optimizing human-un designed components can produce behaviors that deviate from human intentions.ALMA generates code in isolated sandboxes, restricts external access, and uses human oversight to exclude harmful actions such as prompt injection.Source: §5 · p. 8

Future work

  • ALMA currently learns memory designs from a predefined learning set rather than dynamically adapting them online to new tasks.Online learning was not pursued because evaluating each explored design would require many rollouts; enabling continual adaptation across arbitrary domains remains future work.Source: §5 · p. 8
  • Code-space memory design may be limited by the capabilities of the underlying foundation models.Future work could automate the design and training of novel foundation-model architectures with native memory support.Source: §5 · p. 9

Conclusion

  • ALMA does not yet demonstrate jointly learning both memory and the agentic system, but it points toward general-purpose systems that autonomously adapt across domains when safely developed.The broader goal is AI-generating algorithms beyond manual approaches, which introduce distinctive safety concerns (Clune, 2020).Source: §5 · pp. 8–9

Impact Statement · A. Algorithmic Details · A.1. Search Space

ALMA automates the discovery of memory designs through open-ended Meta Agent exploration, reducing manual design effort and enabling context-specific continual learning. Its search space represents memories as executable modular code with configurable retrieval and update pipelines.

Impact Statement

  • ALMA automatically learns novel memory designs, reducing the manual effort required to create domain-specific memories and supporting continual learning across contexts.The framework is intended to help develop specialized memories for medicine, finance, and software engineering while uncovering memory paradigms beyond human intuition.Source: Impact Statement · p. 9

A.1. Search Space

  • By exposing database structure, layer behavior, and pipeline orchestration as code, the search space permits open-ended memory designs rather than a fixed hand-engineered schema.The code framework leaves layer-specific retrieval, updating, and cross-layer execution behavior for each learned design to determine.Source: Impact Statement · p. 9, §A.1 · p. 16
  • The search space defines memory components as modular layers, each encapsulating its own functionality within an abstract Python class.The supplied implementation uses a dataclass-based abstract sub-memory layer and stores an optional database alongside structural metadata.Source: §A.1 · p. 16
  • Each memory layer exposes abstract asynchronous retrieve and update functions, allowing learned designs to specify how individual modules read from and modify memory.The retrieval and update operations are defined as sub-functions of the current layer.Source: §A.1 · p. 16
  • The overall memory structure delegates execution to general retrieve and general update interfaces that orchestrate operation order and data flow across layers.These interfaces use each layer’s retrieve or update function and determine input-output usage across the pipeline.Source: §A.1 · p. 16
  • The general update interface accepts a recorder and returns no value, while the general retrieve interface accepts a recorder and returns a dictionary.Both interfaces are abstract asynchronous methods in the memory-structure pipeline runner.Source: §A.1 · p. 16

A.2. Evaluation of Memory design

The evaluation defines memory as update, storage, and retrieval processes, then measures how well the design collects knowledge and uses it during deployment, including under distribution shift.

Memory design and evaluation protocol

  • A memory design M = (U, D, R) comprises update and retrieval processes interfacing with the agentic system and an internal storage structure D.Evaluation splits each dataset evenly into memory collection and deployment subsets.Source: §A.2 · p. 16

Memory Collection Phase

  • During collection, the agent completes tasks without memory access, and interaction logs update the memory to construct a static memory D_N for deployment.Collected trajectories are processed sequentially, so the memory state changes after each trajectory.Source: §A.2 · p. 17

Deployment Phase

  • Under deployment distribution shift, retrieved knowledge is integrated into the new task context, then subsequent interaction trajectories and feedback sequentially update memory for later retrieval.The updated memory state D_N+i is used on the next task.Source: §A.2 · p. 17
  • During deployment, the agent retrieves relevant knowledge from D_N before executing each task, and average deployment performance measures the memory design’s effectiveness.The deployment score reflects the design’s ability to collect and utilize knowledge.Source: §A.2 · p. 17

A.3. Evaluation Cost … A.6. Pseudocode

This section defines the evaluation cost metrics, archive and sampling mechanisms, and prompting and debugging procedures used to explore executable memory designs. It also summarizes ALMA’s learning algorithm, from design analysis and implementation through orchestration and archive selection.

A.3. Evaluation Cost

  • End-to-end memory cost includes memory collection and deployment knowledge-generation overhead, while retrieved-context token size measures inference-time informational overhead.Both metrics are designed to be independent of memory-design effectiveness because they depend solely on trajectories collected without memory access; GPT-5-mini tokenization is used for token counts.Source: §A.3 · pp. 17–18

A.4. Memory Design Archive and Sampling Process

  • The memory design archive stores sampled performance proxies, overall performance, and sampling counts, then prioritizes high-performing under-sampled designs while preserving diversity.Sampling normalizes performance against the no-memory baseline, applies an under-sampling penalty, and uses a temperature-controlled softmax distribution.Source: §A.4 · p. 18

Prompt for Ideate & Planning

  • The ideation prompt asks the agent to learn from suggestion outcomes, diagnose retrieved memories and source code, and produce prioritized, benchmark-linked improvements.It requires identifying useful, potentially useful, irrelevant, and malformed memories, connecting structural weaknesses to benchmark performance, and proposing ordered code-level or pipeline changes.Source: Prompt for Ideate & Planning · pp. 19–20

Prompt for Implementation

  • The implementation prompt specifies modular memory layers coordinated through general retrieval and update pipelines, with clean, compositional, transferable policy logic.It requires meaningful layer responsibilities, ordered information flow, database integration, runnable Python, and avoidance of hard-coded task-specific branches.Source: Prompt for Implementation · pp. 21–22
  • The implementation prompt requires creative layer-to-layer data flow, clearly designed functionality and stored data, and only the final rewritten code.Source: Prompt for Implementation · p. 22

Prompt for Debugging

  • The debugging prompt directs an engineer to preserve design goals while fixing root-cause errors in memory code used for retrieval before tasks and updates afterward.The workflow exposes general_retrieve(recorder) before execution and general_update(recorder) after completion, with database and tool cheatsheets available.Source: Prompt for Debugging · p. 22

A.6. Pseudocode

  • Algorithm 1 samples memory designs from the archive, plans and implements refinements, retries debugging after failed trial runs, evaluates collection and deployment tasks, and selects the archive design with maximum performance.Collection trajectories update memory through U, deployment retrieves experience through R, and each evaluated design is archived with performance, samples, and visit time before M* is chosen.Source: §A.6 · p. 24

B. Experiment Details · B.1. Benchmark Details · B.2. Baseline Details

ALMA is evaluated on four multi-step sequential decision-making benchmarks spanning text-based, grid-based, symbolic-rule, and procedurally generated environments. The study compares it with four memory baselines using distinct retrieval, cheatsheet, structured, and graph-based designs.

B.1. Benchmark Details

  • ALMA is evaluated on ALFWorld, TextWorld, Baba Is AI, and MiniHack, all of which require agents to learn from experience during multi-step interactions.The benchmarks cover household manipulation, text-based exploration, symbolic-rule puzzles, and procedurally generated dungeon navigation.Source: §B.1 · pp. 24–26
  • ALFWorld uses natural-language household tasks with dependent manipulations, 3,553 training tasks, seen and unseen validation sets, binary success rewards, and a 100-step limit.The validation sets contain 140 seen and 134 unseen tasks; unseen tasks use objects and rules absent from training.Source: §B.1 · pp. 24–25
  • TextWorld evaluates Treasure Hunter and Cooking across 52 tasks, scoring partial completion from 0 to 1 with an 80-step interaction limit under BALROG.Tasks involve exploration, information gathering, and multi-step reasoning through natural-language commands.Source: §B.1 · pp. 25–26
  • Baba Is AI tests exploration and long-horizon planning while agents alter compositional symbolic rules, using 52 BALROG tasks, binary success rewards, and a 20-step limit.Agents manipulate word tiles that define transition rules and goal conditions.Source: §B.1 · p. 26
  • MiniHack evaluates Navigation games requiring exploration, planning, and resource management across 114 tasks, with binary success rewards and a 100-step interaction limit.MiniHack is a procedurally generated dungeon environment built on the NetHack Learning Environment.Source: §B.1 · p. 26

B.2. Baseline Details

  • Trajectory Retrieval [Park et al., 2023; Xu et al., 2024] embeds each task description and supplies the Top-1 cosine-similar raw trajectory as memory.Only one retrieved trajectory is provided because of context-length constraints.Source: §B.2 · p. 30
  • Dynamic Cheatsheet incrementally updates one global cheatsheet from successes and failures, then reuses that fixed memory across deployment tasks.The evaluation uses the cumulative variant, DC-Cu, following the published prompts and workflows.Source: §B.2 · p. 30
  • ReasoningBank [Ouyang et al., 2025] stores titles, descriptions, and reasoning content, retrieves the Top-1 similar trajectory, and provides its associated memory items.Memory items encode pitfalls or successful experiences using ground-truth trajectory feedback.Source: §B.2 · p. 30

B.3. Additional Details of Learning Process … Provided Tools

This section describes ALMA’s code-based learning process for iteratively proposing, implementing, and evaluating memory designs. It also details the tools supporting model selection, implementation validation, and standardized deployment evaluation.

B.3. Additional Details of Learning Process

  • ALMA starts from a GPT-5/medium-generated memory design, then performs 11 archive-based learning steps in which proposed designs are implemented, evaluated, and logged with their metrics.Each evaluated design is added to the archive, which is updated until the maximum number of learning iterations is reached.Source: §B.3 · p. 30

Planning Schema

  • Ideate and planning uses sampled designs, source code, stratified interaction logs, success rates, prior plan examples, and benchmark descriptions under a fixed system prompt.The resulting plan schema assesses retrieved trajectories and memory modules, identifies content-quality and structural issues, and proposes prioritized changes specifying what to change and why.Source: §B.3 · p. 31, Planning Schema · pp. 32–33

Benchmark Description

  • Benchmark descriptions adapt planning to diverse environments, including room-based tasks, grid-game tasks, and rule-manipulation games with changing goals, observations, or object placements.The descriptions identify capabilities such as spatial and state reasoning, transferable experience, long-horizon planning, and adaptation to dynamic rules or environments.Source: Benchmark Description · p. 31

Provided Tools

  • The Meta Agent implements each proposed design using trajectory assessments, benchmark-specific examples, Python Abstract Classes, and tools for Chroma memory, NetworkX graphs, and asynchronous agent calls.The provided tools support adding, retrieving, and deleting memories; graph construction, traversal, and analysis; and structured agent responses with optional JSON-schema validation.Source: Planning Schema · p. 33, Provided Tools · pp. 33–35
  • The Embedding class asynchronously computes single or batch embeddings and cosine-based similarities while tracking embedding-call tokens globally.Similarity operations run in parallel, including one-to-group comparisons.Source: Provided Tools · p. 35
  • The Meta Agent may choose GPT-4o-mini or GPT-4.1 within memory designs, but testing fixes GPT-4o-mini across designs for matched model capacity.Multiple model options support differing reasoning and implementation requirements, while the fixed testing model ensures fair comparison.Source: Provided Tools · p. 36
  • A five-task trial run validates each new memory design, with up to three reflection-and-debugging iterations after runtime errors.The trial uses two tasks for Memory Collection and three for Deployment before the implementation is accepted.Source: Provided Tools · p. 36
  • Evaluation updates memory on each collection trajectory, retrieves by task description during deployment, and averages success over three executions per task.Learning sets are split between collection and deployment, with dataset-specific learning-set rules and stratified post-deployment logs enabling reflection on successes and failures.Source: Provided Tools · p. 36

B.4. Additional Details of Testing

Testing evaluates learned and manual memory designs across static and dynamic settings, models, and dataset splits. ALFWorld additionally tests transferability, trajectory-count sensitivity, and evolving memory under sequential deployment.

B.4. Additional Details of Testing

  • Testing uses static and dynamic modes for ALFWorld, static mode elsewhere, and evenly splits each testing set between Memory Collection and Deployment Phases.TextWorld and Baba Is AI use their dataset second halves for testing, while MiniHack uses the remaining 70%.Source: §B.4 · p. 36
  • Static evaluation compares best-learned designs with manual baselines using GPT-5-nano/low, then tests transferability with GPT-5-mini/medium.On ALFWorld valid seen, GPT-5-mini/medium tests designs while varying Memory Collection trajectories from 0 to 70.Source: §B.4 · p. 36
  • Dynamic ALFWorld evaluation uses GPT-5-mini/medium, separates collected-memory and deployment tasks, and evolves memory through retrieve() and update() after each task.The first 70 valid-seen tasks generate collection trajectories, valid-unseen tasks form deployment, and general retrieve() and update() operate sequentially.Source: §B.4 · p. 36

C. Result Details · C.1. Learning Processes on Other Benchmarks

Across TextWorld, ALFWorld, and MiniHack, ALMA progressively discovers memory designs through open-ended exploration, retaining the highest-success design as the final solution.

C.1. Learning Processes on Other Benchmarks

  • ALMA’s TextWorld process builds an expanding archive in which moderate-success designs act as stepping stones toward the highest-success final memory design.The archive is represented as a parent-child tree, while step-wise progress shows designs derived from prior discoveries.Source: Figure 11 · p. 37
  • Across the three benchmarks, ALMA’s archive tree records how each newly discovered memory design derives from its parent.Node colors indicate success rate, and the best-performing node is used as the final learned memory design.Source: Figure 11 · p. 37, Figure 12 · p. 37, Figure 13 · p. 38
  • The learning trajectories across TextWorld, ALFWorld, and MiniHack show that open-ended exploration connects the root design to the eventual best memory design.Intermediate designs with moderate success rates serve as stepping stones rather than final solutions.Source: Figure 11 · p. 37, Figure 12 · p. 37, Figure 13 · p. 38
  • In all three processes, step-wise progress is driven by an ever-growing archive of previous discoveries rather than a single fixed memory design.The figures depict continual expansion of candidate designs and selection of the highest-success design at the end.Source: Figure 11 · p. 37, Figure 12 · p. 37, Figure 13 · p. 38
  • On ALFWorld, ALMA progressively explores an ever-growing memory-design archive and selects its highest-success node as the final learned design.Each archive edge records derivation from a parent design, and moderate-success designs support continued exploration toward better solutions.Source: Figure 12 · p. 37
  • On MiniHack, ALMA discovers memory designs step by step by building on previous archive entries until reaching the design with the highest success rate.The learning trajectory emphasizes open-ended exploration through intermediate designs with moderate success rates.Source: Figure 13 · p. 38

C.2. Results of Greedy Exploration

On ALFWorld, greedy exploration repeatedly extends the historically best-performing memory design under the same exploration budget as ALMA. ALMA achieves better performance and transferability than Greedy Search, underscoring the value of open-ended exploration.

Greedy Exploration

  • Greedy exploration selects the historically best-performing memory design at each learning step and develops each new design from that predecessor.The strategy explores the same total number of memory designs as ALMA, and the final design is the one with the highest success rate.Source: §C.2 · p. 38, Figure 14 · p. 38

Results

  • ALMA achieves better performance and transferability than Greedy Search on ALFWorld, demonstrating the importance of open-ended exploration patterns.The comparison uses the same exploration budget and evaluates success rate with GPT-5-nano and GPT-5-mini across three deployment runs.Source: §C.2 · p. 38, Table 2 · p. 39

C.3. Example Results of Learned Memory Designs

This section presents the learned MiniHack memory design as executable, layered memory that structures state and spatial information, retrieves relevant experience, and organizes actionable guidance. It also describes how the design updates and distills episodes into transferable strategies, risks, and reflexive advice for adaptive navigation.

Learned memory design

  • Code 2 presents the best-learned memory design in MiniHack as executable code.The implementation imports asynchronous execution, JSON, regular expressions, data structures, agent utilities, embeddings, and Chroma-based storage components.Source: §C.3 · p. 39

Context extraction

  • The design extracts structured spatial and state information, including map dimensions, cursor position, statistics, available actions, and role, race, and alignment.Dedicated parsers identify map area, cursor coordinates, the statistics line, action keys, and character attributes from long-term context.Source: §C.3 · pp. 39–40
  • The design canonicalizes local topology and entities by parsing directional observations and mapping synonyms to standardized categories.It records directions for walls, doors, stairs, boulders, fountains, and other entities, while detecting monsters and canonical entity names.Source: §C.3 · pp. 42–43
  • The design normalizes item names and common variants to improve consistency in retrieval keys.Examples include mapping plural forms, aliases, truncations, and typos to canonical names such as “food ration,” “camera,” and “arrow.”Source: §C.3 · pp. 43–44

Inventory normalization

  • Inventory parsing removes annotations, standardizes item names, handles weapon-ammunition aliases, deduplicates entries, and limits the output to 12 items.The parser recognizes structured phrases such as wand, ring, potion, scroll, and spellbook names, while normalizing examples including yumi to bow and ya to arrow.Source: §C.3 · pp. 44–45

ASCII map parsing

  • ASCII-map parsing extracts the grid, dimensions, hero position, and eight-direction neighbor characters, with local and global fallback searches for the hero marker.The design treats ., #, <, and > as traversable, while identifying hazard-like tiles to avoid by default.Source: §C.3 · pp. 46–47

Move suggestion

  • Move suggestion prioritizes safe passable directions, incorporates map and hazard information, targets nearby objective characters, and falls back to search, wait, or rest when needed.The logic can prioritize stairs, boulders, or Sokoban-style targets based on the goal text, while considering hazardous directions only when safer options are unavailable.Source: §C.3 · pp. 48–49
  • The task-schema layer normalizes goals, entities, inventory, topology, map neighbors, passable directions, hazards, and nearby objectives into reusable task records.It constructs deterministic compact task signatures and knowledge queries from these features.Source: §C.3 · pp. 52–54
  • It also captures the complementary lesson to explore open tiles first, avoid pushing objects into corners, and align actions with objectives.Source: §C.3 · p. 54
  • Retrieval performs similarity search, filters generic summaries and duplicate cases, ranks by reward, keeps the top two cases, and distills their lessons.Source: §C.3 · pp. 54–55

Strategy library

  • The strategy library uses similarity search to retrieve high-signal guidance for the current task schema, compresses it into 3-6 concise task-conditioned tips, and stores transferable strategies and pitfalls.Stored records include success, quality score, topics, and source task identifiers.Source: §C.3 · pp. 56–58

Plan generation

  • The generated generic plan surveys surroundings, maps safe reachable tiles, maintains retreat paths, avoids cornering objects or dead ends, and checks objective proximity, health, and threats.The plan schema includes ordered steps, pitfalls to avoid, and state checks during execution.Source: §C.3 · p. 58

Spatial prior layer

  • The spatial-prior layer represents entities and actions as a weighted knowledge graph linking objects to movement barriers, pushability, goals, and hazards, then updates relations from textual observations.It initializes relations for walls, boulders, stairs, traps, lava, monsters, fountains, and water, and retrieves priors from observed entities, topology, and neighboring map symbols.Source: §C.3 · pp. 59–60

Risk and interaction layer

  • Risk-and-interaction memory retrieves topology- and inventory-conditioned notes, compresses them into concise safety bullets, and weights updates by outcome success.The implementation emphasizes avoiding blocked moves, preserving escape routes, and using healing items proactively at low HP.Source: §C.3 · pp. 61–62

Reflex rules layer

  • Reflex rules generate immediate topology-conditioned advice for hazards, blocked paths, boulders, stairs, walls, and other local conditions.The rules adapt to the goal, local topology, neighboring tiles, available actions, spatial priors, and hazard directions.Source: §C.3 · pp. 62–64

MiniHackMemory

  • The MiniHackMemory design chains task schemas, spatial priors, strategy retrieval, risk tips, and reflex tips into one multi-layer memory.Its update process summarizes episodes, updates a spatial knowledge graph and strategy and risk stores, then indexes the schema.Source: §C.3 · p. 64

Episode summarization

  • Episode summarization extracts transferable strategies, pitfalls, risk notes, success signals, scores, and topic tags from recent MiniHack trajectories.It uses repeated failed actions and oscillation information to produce concise, generic, actionable memory updates.Source: §C.3 · p. 65

Navigation guidance

  • The learned design advises surveying passable tiles, avoiding blocked paths and dead ends, preserving escape routes, and changing direction after repeated movement failures.Retrieved pitfalls include rushing, ignoring inventory, failing to track health, and persisting in a direction despite walls.Source: §C.3 · pp. 66, 70

Retrieved knowledge context

  • The retrieved MiniHack context combines task schema, similar failure cases, a navigation plan, spatial priors, risk tips, and reflex advice.The package includes map topology, neighboring tiles, movement suggestions, action masks, strategies, and retrieval metadata.Source: §C.3 · pp. 67, 68, 70, 71

Example instance

  • The example records all eight neighboring directions as passable while retrieving prior lessons that emphasize assessing topology and avoiding repetitive actions before moving.The retrieved task describes a rogue with walls among its initial entities, no listed hazards, and two similar cases with reward 1.0 but failure_or_partial outcomes.Source: §C.3 · pp. 69–70

Risk-aware planning

  • The context supplies concrete safety checks: reassess health and inventory after each turn, avoid traps and dead ends, and check for enemies during movement.It also recommends using available inventory, including a lock pick for hidden paths and a potion of sickness when health is low during risky moves.Source: §C.3 · pp. 70–71
Loading 2602.07755v1…