Self-evolving Agents with reflective and memory-augmented abilities

Xuechen Liang, Yangfan He, Yinghui Xia, Xinyuan Song, Jianhui Wang, Meiling Tao, Li Sun, Xinhang Yuan, Jiayi Su, Keqin Li, Jiaqi Chen, Jinsong Yang, Siyuan Chen, Tianyu Shi

TL;DR

SAGE (Self-evolving Agents with Reflective and Memory-augmented Abilities) is a novel multi-agent framework that enables large language models (LLMs) to continuously improve their performance without any additional training. By combining an iterative multi-agent feedback loop, a self-reflection mechanism, and a biologically inspired dual-memory system based on the Ebbinghaus forgetting curve, SAGE dramatically boosts agent capabilities in complex, long-context tasks, showing massive gains for smaller open-source models.

What Problem Does This Paper Address?

While LLMs have excelled at single-turn text generation, deploying them as autonomous agents in dynamic, real-world environments reveals significant bottlenecks. Specifically, LLM agents struggle with continuous decision-making, lack robust long-term memory, and are constrained by strict context window limits.

Existing multi-agent frameworks attempt to solve this by storing extensive interaction histories, but this quickly leads to communication overload, high latency, and soaring resource costs. SAGE addresses these challenges by introducing a structured, self-correcting multi-agent environment paired with an optimized memory management system that mimics human memory decay to prevent information overload.

Methods

The SAGE framework divides responsibilities among three specialized agents:

  1. The User ($U$): Proposes the task and defines the operational constraints.
  2. The Assistant ($A$): Executes actions, observes the environment, and generates outputs.
  3. The Checker ($C$): Evaluates the Assistant's output against the user's goals and provides targeted feedback.
Figure 1: An illustration of the SAGE: a user provides a description and instance to the assistant with short-term (STM) and long-term (LTM) memory. The assistant performs observation, action, reflection, and output, which the checker reviews. The retention rate curve on the right illustrates memory decay over time, with a self-evolving loop guiding continued updates.

SAGE relies on three core pillars:

  • Iterative Feedback Loop: The Assistant and Checker interact repeatedly to refine the output. The authors mathematically prove that this interaction converges to a stable Nash equilibrium, ensuring robust strategy stability.
  • Dual-Memory System: SAGE splits memory into Short-Term Memory (STM)—which tracks immediate, task-specific trajectories—and Long-Term Memory (LTM), which stores high-level insights and self-reflections ($r_t$).
  • MemorySyntax: Inspired by the Ebbinghaus forgetting curve, this mechanism uses linguistic optimization to compress and strengthen key information. It dynamically calculates the "retention strength" of data based on information entropy, deciding whether to keep it in STM, transfer it to LTM, or discard it entirely to maximize memory utility.

Datasets

The authors evaluated SAGE across a comprehensive suite of benchmarks:

  • AgentBench: A multidimensional benchmark covering six distinct environments: CODE (Knowledge Graph, OS, Database), GAME (ALFWorld), and WEB (WebShop, Mind2Web).
  • Long-Context and Problem-Solving Tasks: Long-form QA (HotpotQA), multi-turn dialog (MultiWOZ), sequential task completion (ALFWorld), code completion (LCC and RepoBench-P), and open-domain reading comprehension (TriviaQA).

Key Insights and Ideas

  • Biologically Inspired Forgetting is Highly Efficient: Rather than using standard First-In-First-Out (FIFO) queues that blindly discard older context, SAGE uses the Ebbinghaus forgetting curve to preferentially retain high-entropy (information-rich, high-uncertainty) data. This drastically reduces cognitive load while preserving critical context.
  • Game-Theoretic Convergence: By framing the Assistant-Checker interaction as a multi-player game, the framework provides a formal guarantee of convergence. This theoretical foundation justifies the three-agent setup over simpler, single-prompt alternatives.
  • Empowering Smaller Models: One of the most striking insights is that SAGE acts as a massive equalizer. By optimizing memory and feedback, small open-source models (like Qwen-1.8B) can perform nearly on par with commercial giants like GPT-3.5 on complex tasks.

Key Results

SAGE demonstrated substantial performance leaps across both proprietary and open-source models:

  • AgentBench Performance: SAGE achieved up to a 2.26X improvement on closed-source models (GPT-3.5 on the Database task). Open-source models saw improvements ranging from 57.7% to 100%. For instance, Llama2-7B Chat jumped from a baseline score of 0.0 to 25.0 on the Database task.
Table 1: Baseline and SAGE Framework Performance on AgentBench
  • Complex Problem Solving: SAGE-GPT-3.5 achieved a 20.8% increase in answer accuracy on HotpotQA, while SAGE-Mistral-7b saw a 17.3% improvement in task completion on ALFWorld.
Table 2: Evaluation of SAGE and Baseline Models on Three Different Tasks
  • RAG Optimization: When integrated into Retrieval-Augmented Generation (RAG) workflows, ChatGPT-4 powered by SAGE outperformed state-of-the-art retrieval baselines (like BM25, DPR, and FiD) by 3.6% to 4.7% in accuracy while slashing memory consumption by nearly 50% without increasing latency.

Limitations and Future Work

Despite its success, the authors note a few limitations:

  • Task Limits and Time Constraints: In highly complex scenarios, task limits (TLE) remain the primary cause of incomplete tasks, indicating that the multi-turn iterative loop can hit wall-clock time bottlenecks.
  • Diminishing Returns on Simple Tasks: For straightforward, linear tasks like basic code completion (LCC), SAGE only showed marginal improvements, suggesting that the overhead of a three-agent system may not be necessary for simple workflows.
  • Future Work: The authors plan to explore more sophisticated linguistic optimization techniques and expand the framework's adaptability to an even wider variety of open-source architectures.

Summary updated

BibTeX
@misc{liang2024self,
  author = {Xuechen Liang and Yangfan He and Yinghui Xia and Xinyuan Song and Jianhui Wang and Meiling Tao and Li Sun and Xinhang Yuan and Jiayi Su and Keqin Li and Jiaqi Chen and Jinsong Yang and Siyuan Chen and Tianyu Shi},
  title = {{Self-evolving Agents with reflective and memory-augmented abilities}},
  year = {2024},
  eprint = {2409.00872},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.00872},
}
Figure