Source-linked AI summary

Cognitive Extensions for Dual-Process Language Agents: Memory and Self-Reflection in Interactive Environments

João Meneses dos Santos, Arlindo L. Oliveira

arXiv:2609.19128v1cs.AIcs.LGcs.MA

TL;DR

Long-horizon interactive agents must track state, execute valid actions, and recover from failures, while SwiftSage lacks persistent episodic reuse and systematic pre-execution validation. The paper extends SwiftSage with AMM for salience-gated episodic storage and triggered retrieval, and SRM for bounded execution-time validation and Critic correction. On ScienceWorld, the full system achieves the best aggregate score, success rate, and successful-step efficiency, while SRM is the strongest standalone contributor.

  • Problem

    Long-horizon interactive agents must track state, execute valid actions, and recover from failures, while SwiftSage lacks persistent episodic reuse and systematic pre-execution validation.

    Source: §1 · p. 1
  • Method

    The paper extends SwiftSage with AMM for salience-gated episodic storage and triggered retrieval, and SRM for bounded execution-time validation and Critic correction.

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

    On ScienceWorld, the full system achieves the best aggregate score, success rate, and successful-step efficiency, while SRM is the strongest standalone contributor.

    Source: §7 · p. 7
  • Takeaways & Limitations

    In this ScienceWorld setting, execution-time control is the dominant bottleneck, while episodic memory is most useful once the runtime loop is stabilized.

    Source: §6 · p. 6

    Evaluation is restricted to ScienceWorld and the inherited SwiftSage-style runtime, so results may not transfer directly to other environments, multimodal settings, robotic action spaces, or model backbones.

    Source: §8 · p. 7

Abstract

from arXiv · show

Language agents remain brittle in interactive environments, where success requires long-horizon state tracking, valid action execution, and recovery from failed steps. We extend SwiftSage, a dual-process agent that combines a fast action proposer with a slower planner, using two modular cognitive extensions: an Adaptive Memory Module (AMM) for salience-gated episodic storage and trigger-driven retrieval, and a Self-Reflection Module (SRM) for bounded execution-time validation and corrective intervention. Both modules are implemented as feature-flagged extensions over the same execution substrate, enabling controlled ablations on ScienceWorld. Across four configurations---baseline, baseline+AMM, baseline+SRM, and the full system---the full system achieves the best mean final score (64.62), success rate (43.17%), and successful-step efficiency (19.33 steps), while SRM is the strongest standalone contributor. The results suggest that execution-time control is the dominant bottleneck in this setting, while episodic memory becomes most useful once the runtime loop is stabilized.

1 Introduction

Interactive language agents must track state, execute valid actions, and recover over long horizons, yet fluent generation and short-horizon reasoning do not ensure reliable behavior. This work extends SwiftSage with episodic memory and execution-time control, then evaluates the extensions on ScienceWorld.

1 Introduction

  • Long-horizon agents must maintain state, choose valid actions, decompose goals, and recover from unexpected observations rather than rely on fluent generation alone.Failures can occur when plans degrade into stale actions, unavailable actions, or navigation without measurable progress.Source: §1 · p. 1
  • SwiftSage separates fast action proposal from slower planning, but lacks persistent episodic reuse and systematic pre-execution validation or bounded intervention when behavior stagnates.These gaps remain despite its efficiency advantage over querying a large model at every timestep.Source: §1 · p. 1
  • AMM selectively stores informative episodes for triggered retrieval, while SRM validates actions, detects stagnation, and invokes a constrained Critic when correction is justified.AMM changes available evidence without choosing the final action; SRM controls what reaches the environment and when corrective actions are inserted.Source: §1 · p. 1
  • On ScienceWorld, the full system has the best aggregate performance, SRM is the strongest standalone extension, and AMM’s contribution is more coherent with SRM stabilizing execution.The comparison uses baseline, baseline+AMM, baseline+SRM, and the full system under a shared runtime substrate.Source: §1 · p. 2

2 Motivation and Related Work

Prior work informs the paper’s dual-process, tool-feedback, and memory design, while motivating bounded reflection and operationally triggered retrieval. The paper preserves SwiftSage and places memory and execution control at distinct interfaces.

2 Motivation and Related Work

  • Dual-process theory motivates fast local action proposal and slower planning, verification, and recovery as an engineering abstraction, not a claim of cognitive equivalence.Interactive agents must also decide when to deliberate and ground plans in current state.Source: §2 · p. 2
  • Tool-using and feedback-driven methods include Say-Can (Ahn et al., 2022), ReAct (Yao et al., 2023), Reflexion (Shinn et al., 2024), Self-Refine (Madaan et al., 2024), and CRITIC (Gou et al., 2024).Unconstrained self-correction can increase cost or degrade performance when feedback is unreliable (Huang et al., 2023), motivating SRM’s trigger-gated reflection.Source: §2 · p. 2
  • Memory systems such as retrieval-augmented generation (Lewis et al., 2020), MemGPT (Packer et al., 2023), CoALA (Sumers et al., 2023), and Generative Agents (Park et al., 2023) inform AMM’s episodic reuse.AMM stores compact records and retrieves them under operational triggers rather than continuously expanding prompts or acting as an alternative planner.Source: §2 · p. 2
  • The paper preserves SwiftSage’s fast Swift proposer and slower Sage planner while adding persistent episodic reuse and just-in-time execution control (Lin et al., 2024).ScienceWorld tests whether science knowledge becomes valid procedures, and the study asks whether bounded, interpretable interfaces improve an existing dual-process controller.Source: §2 · p. 2

3 Method

The method preserves SwiftSage’s action-selection loop and adds memory retrieval and execution-time control at specific runtime interfaces. AMM supplies bounded episodic evidence; SRM validates actions and enables bounded correction.

3.1 Adaptive Memory Module

  • AMM stores candidate episodes after environment steps only when a salience gate detects informative transitions such as success, positive progress, near misses, or invalid-action failures.Records include task, local state, recent context, action, observation, score transition, and a type tag; T1 retrieves after Swift failure, while T4 retrieves for Sage planning.Source: §3.1 · p. 3

3.2 Self-Reflection Module

  • SRM applies Gate–1 before execution to check admissibility, safely repair minor mismatches, or drop actions that remain invalid or violate constraints.It tracks trajectory signals for stagnation and invokes the Critic only when detected and safeguards permit; Critic actions enter Sage’s FIFO buffer and still pass Gate–1.Source: §3.2 · p. 3, Figure 1 · p. 4

3 Method

  • The full system retains SwiftSage as its action-selection substrate, with AMM adding triggered memory retrieval and SRM adding pre-execution validation and bounded correction.Buffered actions execute when available; otherwise Swift proposes actions and Sage is invoked under baseline conditions such as invalid actions, no progress, or deliberate planning needs.Source: §3 · pp. 2–3, Figure 1 · p. 4

3.3 Full-System Composition

  • AMM and SRM share the execution substrate: AMM provides optional retrieved evidence during recovery or planning, while SRM monitors execution and retains Gate–1 as the final safeguard.The composition compares baseline, baseline+AMM, baseline+SRM, and full-system configurations to test whether the mechanisms are complementary or redundant.Source: §3.3 · p. 4

4 Experimental Setup

The experiments compare four feature configurations on ScienceWorld under a shared runtime substrate. They report task-level macro-averaged performance and describe the results as controlled ablations rather than a new benchmark state of the art.

4 Experimental Setup

  • The evaluation uses ScienceWorld tasks 0–29 and up to 10 natural-language variations per task, with episodes running to completion or a fixed step budget.All configurations share the environment interface, valid-action grounding, one env.step per timestep, Swift/Sage arbitration, and action-buffer execution.Source: §4 · pp. 4–5
  • The four configurations are baseline, baseline+AMM, baseline+SRM, and the full system, with populated memory for AMM-enabled configurations.The populated-memory protocol tests experience reuse; the weaker-memory protocol is treated as a sensitivity condition.Source: §4 · p. 5
  • The study is a controlled ablation over a reproduced SwiftSage-style substrate, not a claim of new ScienceWorld state of the art.The shared local-model/runtime setting and populated-memory protocol distinguish it from the cited SwiftSage work.Source: §4 · p. 5
  • The reported primary metrics are task-level macro-averaged final score, task success, and Steps@Succ, which counts steps only for successful episodes.Tasks are also grouped by oracle trajectory length into Short, Medium, and Long categories.Source: §4 · p. 5, Table 1 · p. 5

5 Results and Analysis

The full system leads on aggregate ScienceWorld performance, while SRM provides most of the standalone improvement and AMM contributes more in combination. Results also show execution filtering, targeted memory use, and bounded reflection as key parts of the pattern.

5 Results and Analysis

  • The full system achieves a mean final score of 64.62, success rate of 43.17%, and Steps@Succ of 19.33.Baseline+SRM reaches 64.33 mean final score; baseline+AMM reaches 53.83 compared with 51.67 for the baseline.Source: §5 · p. 5
  • On Short tasks, baseline+SRM performs best; the full system leads on Medium and Long tasks, nearly tied with SRM on Long.Table 2 reports grouped mean final score and relative change over the baseline within each group.Source: §5 · p. 5, Table 2 · p. 6
  • Success rises from 23.99% in the baseline to 26.94% with AMM, 41.33% with SRM, and 43.17% in the full system.Steps@Succ falls from 24.48 in the baseline to 19.76 with SRM and 19.33 in the full system.Source: §5 · p. 5
  • The full system writes 4.89 memories per episode versus 4.48 with AMM-only, but its T1 and T4 retrieval triggers are less frequent.The reported T1 counts are 12.15 versus 17.13 and T4 counts are 11.77 versus 19.13, respectively.Source: §5 · p. 5
  • Gate–1 drops occur 20.03 times per episode with SRM-only and 17.48 times with the full system, mostly because proposed actions are invalid in the current state.The Critic makes 1.35 effective calls per episode with SRM-only and 1.29 with the full system.Source: §5 · pp. 5–6
  • Direct Swift-executed steps rise from 44.08% in the baseline to 62.01% in the full system, while System 2 calls fall from 24.6 to 14.1 per episode.Buffer-executed steps fall from 55.92% in the baseline to 37.99% in the full system.Source: §5 · p. 6
  • Increasing the SRM Critic budget from three to six calls reduces score from 64.33 to 52.95; disabling T1 injection in the full system lowers score from 64.62 to 63.33.Populated AMM memory improves score from 51.47 in a weaker-memory regime to 53.83.Source: §5 · p. 6

6 Discussion

In this ScienceWorld setting, execution-time control is the dominant bottleneck: SRM contributes most gains by acting before actions reach the environment. Memory is useful but conditional, and reflection works best when bounded and targeted.

6 Discussion

  • Execution-time control is the dominant bottleneck in this ScienceWorld setting, with baseline+SRM nearly matching the full system in final score and producing most success-rate and efficiency gains.SRM acts immediately before environment interaction, where invalid or stale actions would otherwise consume steps.Source: §6 · p. 6
  • AMM alone improves aggregate score modestly; memory is not the first bottleneck while execution remains unstable.The full system writes slightly more memories but uses memory-conditioned recovery and planning less often than AMM-only.Source: §6 · p. 6
  • Expanding reflective intervention can degrade performance, supporting bounded Critic calls reserved for trajectories with explicit stagnation.Stronger configurations use fewer System 2 calls and fewer buffer-executed steps.Source: §6 · p. 6
  • AMM supplies evidence for recovery and planning, while SRM governs execution and corrective intervention on the shared SwiftSage substrate.This separation makes the ablation interpretable rather than a monolithic prompt expansion.Source: §6 · p. 6

7 Conclusion

The paper extends a SwiftSage-style dual-process agent with episodic memory and bounded execution-time control. On ScienceWorld, the full system leads on aggregate score, success, and successful-step efficiency, while SRM is the strongest standalone contributor.

7 Conclusion

  • AMM adds salience-gated episodic reuse, while SRM adds bounded execution-time control to a SwiftSage-style dual-process agent.The full system keeps the baseline fast/slow controller as its shared substrate.Source: §7 · p. 7
  • The full system achieves the best aggregate score, success rate, and successful-step efficiency; SRM is the strongest standalone contributor.AMM alone is beneficial but modest, with its clearest role appearing in combination with SRM after execution has been stabilized.Source: §7 · p. 7
  • The broader implication is role-matched placement: memory provides evidence, while reflection controls execution, rather than adding either mechanism everywhere.The paper cautions that memory alone is insufficient when invalid or stale actions remain, and unbounded reflection is harmful.Source: §7 · p. 7

8 Limitations

The limitations concern AMM’s relatively simple episodic memory, SRM’s hand-crafted control rules, and the evaluation’s restricted scope and partly correlational analysis.

8 Limitations

  • AMM uses compact episodic records and bounded prompt injection, which may constrain its standalone value because representation, retrieval, and action conversion remain simple.The proposed directions include richer episodic formats, stronger retrieval and reranking, consolidation, and more targeted prompt conditioning.Source: §8 · p. 7
  • AMM remains primarily episodic and does not yet reliably transform repeated experiences into generalized procedural knowledge.The implementation emphasizes rapid episodic storage over slower semantic consolidation into reusable skills, procedures, or task-general regularities.Source: §8 · p. 7
  • SRM relies on hand-crafted thresholds, filters, budgets, and deterministic repairs; Gate–1 repairs can be shallow when invalid actions lack a clean admissible alternative.The paper proposes learned verifiers, confidence-aware escalation, richer affordance models, and adaptive reflection budgets as future directions.Source: §8 · p. 7
  • Evaluation is limited to ScienceWorld and a SwiftSage-style runtime, so results may not transfer directly to other environments, multimodal settings, robotic actions, or model backbones.AMM-enabled configurations use populated memory and do not fully characterize cold-start learning, warm-up, aging, compaction, or forgetting.Source: §8 · p. 7
  • Mechanism logs do not isolate every causal prompt-level factor behind individual outcomes, leaving causal attribution partly unresolved.The authors identify fine-grained causal tracing, counterfactual replay, and controlled prompt ablations as ways to strengthen future evaluations.Source: §8 · p. 7

9 Ethical Considerations

The work studies simulated educational science tasks without human subjects or private user data, and cautions against open-ended deployment without added oversight. Reproducibility notes specify the evaluation protocol and the initialized-memory condition.

9 Ethical Considerations

  • The study uses a simulated educational science environment and involves neither human subjects nor private user data.The authors caution that the modules should not be treated as safe for open-ended real-world deployment without additional oversight, safety evaluation, and domain-specific constraints.Source: §9 · pp. 7–8

A Reproducibility Notes

  • Evaluation covers ScienceWorld tasks 0–29 with up to ten language variations per task, yielding up to 271 episodes per configuration under a shared execution substrate.Metrics use evaluation episodes only and are aggregated task-first before macro-averaging across groups.Source: A Reproducibility Notes · p. 10
  • AMM is tested as experience reuse with memory populated by 60 warm-up episodes, which are excluded from reported evaluation metrics.Thus, the main comparison measures retrieval from initialized memory rather than learning from an empty store.Source: A Reproducibility Notes · p. 10

B Score Results by Task

The full system is strongest overall in score, completion, and successful-step efficiency, while the reported gains vary across task groups. SRM-enabled runs show the largest and most consistent score gains.

B Score Results by Task

  • The full system is strongest overall in ScienceWorld score, while the largest and most consistent gains appear in SRM-enabled runs.AMM is competitive on selected tasks, and memory supports recovery and planning on longer trajectories alongside SRM’s execution-time control.Source: Table 3 · p. 11, B Score Results by Task · p. 11

C Success and Successful-Step Efficiency

  • The full system has the best overall completion rate and Steps@Succ, with the clearest completion gain on short tasks.On long tasks, SRM-enabled systems complete substantially more episodes than baseline and use fewer steps when successful; medium-task success is less stable.Source: Table 4 · p. 11, C Success and Successful-Step Efficiency · p. 11

D Mechanism-Level Activity

Mechanism analyses describe AMM memory activity, SRM filtering and reflection, controller usage, and sensitivity to selected implementation choices. The reported patterns favor execution-time control and bounded reflection.

D Mechanism-Level Activity

  • With SRM enabled, AMM writes slightly more but retrieves and injects less often, consistent with fewer unstable states needing memory-conditioned recovery.AMM writes are dominated by near-miss memories in both memory-enabled configurations, capturing partial progress rather than only terminal success.Source: D Mechanism-Level Activity · p. 12
  • Gate–1 filtering is SRM’s dominant mechanism: drops exceed effective Critic calls and mostly involve actions absent from the current valid-action set.The authors identify execution-time validation as the main source of SRM’s improvement.Source: Table 6 · p. 12, D Mechanism-Level Activity · p. 12

E System Usage and Cost Proxies

  • The strongest systems do not increase deliberation: System 2 calls decrease from baseline to full while direct Swift-executed steps increase.This pattern is consistent with SRM making the fast path safer and the slow path more selective.Source: Table 7 · p. 12, E System Usage and Cost Proxies · p. 12

F Sensitivity Analyses

  • Increasing the maximum Critic budget from three to six lowers performance in every oracle-length group, while a more mature episodic store benefits AMM.The T1 ablation indicates that Swift-level memory recovery contributes most clearly on long tasks.Source: Table 8 · p. 13, F Sensitivity Analyses · p. 13
Loading 2609.19128v1…