# "My agent understands me better": Integrating Dynamic Human-like Memory Recall and Consolidation in LLM-Based Agents

**Authors:** Yuki Hou, Haruki Tamoto, Homei Miyashita  
**arXiv:** [2404.00573](https://arxiv.org/abs/2404.00573)  
**Date:** 2024-03-31  
**Summary page:** https://www.summarizepaper.com/en/paper/2404.00573v1/

## Key points

- Proposed a novel human-like memory architecture to enhance cognitive abilities of large language model-based dialogue agents
- Developed a mathematical model for memory consolidation based on contextual relevance, elapsed time, and recall frequency
- Stored retrieved memories in a database to enable agents to recall specific memories and understand their significance in a temporal context
- Highlighted the need for further refinement in handling novel contexts and deviations from typical behavior based on comparison with Generative Agents
- Demonstrated autonomous memory recall and consolidation capabilities through reflecting users' preferences and habits in generated responses

## Summary

In this study, we propose a novel human-like memory architecture to enhance the cognitive abilities of large language model-based dialogue agents. This architecture enables agents to autonomously recall memories necessary for response generation, addressing a limitation in the temporal cognition of LLMs. By adopting human memory cue recall as a trigger for accurate and efficient memory recall, we develop a mathematical model that dynamically quantifies memory consolidation based on contextual relevance, elapsed time, and recall frequency. The agent stores retrieved memories from the user's interaction history in a database that encapsulates each memory's content and temporal context. This strategic storage allows agents to recall specific memories and understand their significance to the user in a temporal context, similar to how humans recognize and recall past experiences. However, during Task 0 related to places frequented on Thursdays, both our proposed model (model 1) and Generative Agents (model 2) made incorrect predictions when the user mentioned plans to attend a concert next Thursday. Model 1 relied heavily on historical interactions rather than adapting to the novel context provided by the user, indicating a limitation when encountering deviations from typical behavior. In contrast, Generative Agents prioritized recent activities and event relevance in its response generation. These different responses highlight the need for further refinement in handling novel contexts and deviations from typical behavior. Our proposed model's autonomous memory recall and consolidation capabilities were demonstrated through its ability to reflect users' preferences and habits in generated responses. The agent successfully recalled specific memories such as the user expecting ice cream as a reward after work, demonstrating personalized nuance in generating encouraging responses consistent with user statements. Furthermore, relevant citations are provided for further exploration into text classification fine-tuning techniques (Chi Sun et al., 2019), LSTM neural networks for language modeling (Martin Sundermeyer et al., 2012), episodic memory research (Endel Tulving et al., 2002; Endel Tulving et al., 1972), Python reference manuals (Guido Van Rossum & Fred L. Drake, 2009), and frontiers of human memory studies (Atsushi Yamadori, 2002). In conclusion, our study aims to refine models' ability to emulate human-like memory processes while improving response generation performance by better handling novel contexts and deviations from typical behavior.
