Cognitive memory and reflection improve language agent task success

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

Artificial IntelligenceMachine LearningMultiagent Systems

Summary

Language agents often struggle to complete tasks in interactive environments because they have trouble remembering important details and fixing mistakes along the way. The authors enhanced an existing language agent by adding two key features: one that selectively remembers important events and another that checks the agent’s actions to catch and correct errors during execution. When both features are used together, the agent performs best, showing that error checking is the most crucial improvement, while memory helps once errors are under control.

What this means in practice

  • For software developers: Build interactive AI agents that better remember key events and correct errors during tasks in complex environments.
  • For game developers: Create game characters with improved long-term task tracking and error correction to enhance player interactions in story-driven games.

Authors

João Meneses dos Santos, Arlindo L. Oliveira

Abstract

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.