Source-linked AI summary
MemoryBank: Enhancing Large Language Models with Long-Term Memory
Wanjun Zhong, Lianghong Guo, Qiqi Gao, He Ye, Yanlin Wang
TL;DR
LLMs lack long-term memory for sustained interactions such as personal companionship. MemoryBank combines memory storage, retrieval, and user profiling with forgetting-curve-inspired updates. Evaluations of its companion chatbot, SiliconFriend, report memory recall, understanding of user behaviors, and empathetic companionship.
Problem
LLMs lack long-term memory needed to preserve context and understand users across sustained interactions such as companionship and psychological counseling.
Source: §1 · p. 2Method
MemoryBank combines memory storage, retrieval, and user profiling with Ebbinghaus-inspired updating that selectively forgets and reinforces memories over time.
Source: §1 · p. 2Results
Evaluations indicate that MemoryBank-equipped SiliconFriend recalls past interactions, understands user behaviors, and provides empathetic companionship.
Source: §1 · p. 2, §6 · p. 10Takeaways & Limitations
MemoryBank can be applied to long-term AI companions built on either open- or closed-source LLMs.
Source: §1 · p. 2MemoryBank’s memory-updating model is exploratory and highly simplified relative to real-life memory processes, which vary across people and information types.
Source: §2.3 · p. 4
Abstract
from arXiv · showhide
Revolutionary advancements in Large Language Models have drastically reshaped our interactions with artificial intelligence systems. Despite this, a notable hindrance remains-the deficiency of a long-term memory mechanism within these models. This shortfall becomes increasingly evident in situations demanding sustained interaction, such as personal companion systems and psychological counseling. Therefore, we propose MemoryBank, a novel memory mechanism tailored for LLMs. MemoryBank enables the models to summon relevant memories, continually evolve through continuous memory updates, comprehend, and adapt to a user personality by synthesizing information from past interactions. To mimic anthropomorphic behaviors and selectively preserve memory, MemoryBank incorporates a memory updating mechanism, inspired by the Ebbinghaus Forgetting Curve theory, which permits the AI to forget and reinforce memory based on time elapsed and the relative significance of the memory, thereby offering a human-like memory mechanism. MemoryBank is versatile in accommodating both closed-source models like ChatGPT and open-source models like ChatGLM. We exemplify application of MemoryBank through the creation of an LLM-based chatbot named SiliconFriend in a long-term AI Companion scenario. Further tuned with psychological dialogs, SiliconFriend displays heightened empathy in its interactions. Experiment involves both qualitative analysis with real-world user dialogs and quantitative analysis with simulated dialogs. In the latter, ChatGPT acts as users with diverse characteristics and generates long-term dialog contexts covering a wide array of topics. The results of our analysis reveal that SiliconFriend, equipped with MemoryBank, exhibits a strong capability for long-term companionship as it can provide emphatic response, recall relevant memories and understand user personality.
1 Introduction
MemoryBank addresses LLMs’ lack of long-term memory through memory storage, retrieval, updating, and summaries of past events and user personalities. Its SiliconFriend companion applies these capabilities to recalling interactions, providing empathetic companionship, and understanding users.
1 Introduction
- MemoryBank stores conversations, summarized events, and user portraits, retrieves relevant memories, and updates its understanding of users through past interactions.These capabilities address the lack of long-term memory that limits contextual understanding and personalization during sustained interactions.Source: §1 · p. 2, Figure 1 · p. 3
- MemoryBank incorporates an Ebbinghaus Forgetting Curve-inspired mechanism to remember, selectively forget, and strengthen memories based on elapsed time.The mechanism models the decline of memory strength over time to approximate human memory processes.Source: §1 · p. 2
- 38k psychological conversations tune SiliconFriend for empathy, carefulness, useful guidance, and emotionally charged dialogue.SiliconFriend also summarizes users’ personalities from past interactions to tailor responses to their individual traits.Source: §1 · p. 2
- SiliconFriend evaluations demonstrate memory recall, empathetic companionship, and user-personality understanding through qualitative real-user dialogs and quantitative simulated dialogs.Quantitative evaluation used 10 days of ChatGPT-generated conversations involving 15 virtual users with diverse personalities and 194 probing questions.Source: §1 · p. 2
- MemoryBank supports open- and closed-source LLMs, English and Chinese, and configurations with or without memory forgetting.SiliconFriend implementations use ChatGPT, ChatGLM (Zeng et al., 2022), and BELLE (Yunjie Ji & Li, 2023).Source: §1 · p. 2
2 MemoryBank: A Novel Memory Mechanism Tailored for LLMs
MemoryBank combines persistent memory storage, context-specific retrieval, and an Ebbinghaus-inspired updater that reinforces recalled memories. Its storage organizes conversations, event summaries, and evolving assessments of user personality.
2.1 Memory Storage: The Warehouse of MemoryBank
- Memory storage combines timestamped conversations, hierarchical daily-to-global event summaries, and evolving daily-to-global personality assessments to support retrieval, updating, and personalized responses.LLMs summarize conversations into daily events and then global summaries. They also infer personality traits and emotions from daily dialogues and aggregate these insights across days.Source: §2.1 · pp. 3–4
2.2 Memory Retrieval
- A dual-tower dense retriever, similar to Dense Passage Retrieval (Karpukhin et al., 2020), matches conversation context against encoded dialogue turns and event summaries.Memory vectors are indexed using FAISS. The current conversation context is encoded as the retrieval query, and the encoder can be replaced with any suitable model.Source: §2.2 · p. 4
2.3 Memory Updating Mechanism
- MemoryBank models forgetting through exponential decay, initializing memory strength at 1 and reinforcing recalled memories by increasing strength and resetting elapsed time.Each recall increases memory strength S by 1 and resets elapsed time t to 0, reducing forgetting probability. This mechanism targets old, less-important memories that are rarely recalled.Source: §2.3 · p. 4
- The forgetting mechanism is exploratory and highly simplified, rather than a complete model of human memory.Real memory processes involve additional factors, and forgetting curves vary across people and information types.Source: §2.3 · p. 4
3 SiliconFriend: An AI Chatbot Companion Powered by MemoryBank
SiliconFriend combines psychological-dialogue tuning for open-source language models with MemoryBank integration to support long-term emotional companionship. It uses past interactions and user portraits to personalize responses.
3 SiliconFriend: An AI Chatbot Companion Powered by MemoryBank
- SiliconFriend supports closed-source ChatGPT and open-source bilingual ChatGLM (Zeng et al., 2022) and BELLE (Yunjie Ji & Li, 2023).These backbones originally lack long-term memory and specific adaptation to the psychology domain.Source: §3 · p. 5
- SiliconFriend combines psychological-dialogue tuning for open-source models with MemoryBank to provide personalized emotional companionship grounded in past interactions and user portraits.The chatbot is designed to recall relevant memories and understand users’ personalities and emotional states.Source: §3 · pp. 4–5
Parameter-efficient Tuning with Psychological Dialogue Data
- 38k psychological dialogues collected from online sources provide the tuning data for developing emotionally informed, empathetic responses.The conversations cover varied emotional states and responses, supporting recognition of emotional cues and psychologically informed emotional support.Source: §3 · p. 5
- 16 is the rank used for LoRA, trained for 3 epochs on an A100 GPU while original weights remain frozen.LoRA reduces trainable parameters by learning paired rank-decomposition matrices, modifying a linear layer from y = Wx to y = Wx + BAx.Source: §3 · p. 5
Integration with MemoryBank
- MemoryBank logs and updates dialogues using Ebbinghaus-inspired forgetting, while conversation prompts incorporate retrieved memories, global user portraits, and global event summaries.Dialogue storage works across model backbones; the assembled prompts support responses tailored to past experiences and the user’s portrait.Source: §3 · pp. 5–6
- User conversations query memory through LangChain (LangChain Inc., 2022), which supports open-source embedding models and FAISS indexing.The open-source implementation uses MiniLM for English and Text2vec for Chinese. Embedding models are interchangeable, including multilingual alternatives.Source: §3 · pp. 5–6
4 Experiments
SiliconFriend ChatGPT performs best overall in bilingual memory-recall evaluation, while real-user examples illustrate empathetic support, successful recall, and personality-tailored responses.
4 Experiments
- The experiments investigate whether long-term memory improves historical recall and personality understanding, and whether psychological-data tuning strengthens emotional support.Source: §4 · p. 6
4.1 Qualitative Analysis
- In real-user conversations, SiliconFriend provides empathetic responses and constructive suggestions, with stronger emotional support than baseline ChatGLM.The qualitative examples come from conversations collected through an online SiliconFriend platform.Source: §4.1 · pp. 6–7
- Several days after a programming discussion, SiliconFriend recalls the recommended book and algorithm and correctly recognizes that heap sort had not been discussed.Memory-probing questions test retrieval of specific details from earlier conversations.Source: §4.1 · p. 7
- SiliconFriend recommends activities tailored to users’ interests and character traits, illustrating its ability to interact with different personalities.Source: §4.1 · p. 7
4.2 Quantitative Analysis
- 194 probing questions—97 in English and 97 in Chinese—test recall using 10 days of ChatGPT-generated conversations involving 15 virtual users with distinct personalities.Human annotators assess Memory Retrieval Accuracy, Response Correctness, Contextual Coherence, and Model Ranking Score. Retrieval uses 0/1 labels, correctness and coherence use 0/0.5/1, and ranking uses s = 1/r for r = 1, 2, 3.Source: §4 · p. 6, §4.2 · pp. 7–8
- SiliconFriend ChatGPT performs best overall, while SiliconFriend BELLE and SiliconFriend ChatGLM also achieve high Memory Retrieval Accuracy.BELLE and ChatGLM trail ChatGPT on other metrics. ChatGPT and ChatGLM perform better in English, whereas BELLE performs better in Chinese.Source: §4.2 · p. 8, Table 2 · p. 9
5 Related Works
Existing LLMs and memory approaches leave gaps in long-term, personalized interaction. MemoryBank addresses these gaps with a memory-updating mechanism inspired by Ebbinghaus (1964).
Large Language Models
- Despite broad NLP advances, closed- and open-source LLMs lack robust long-term memory for maintaining context and retrieving information from past interactions.Closed-source restrictions impede internal analysis and domain-adapted applications, motivating the emergence of open-source alternatives.Source: §5 · p. 9
Long-term Memory Mechanisms
- MemoryBank targets persistent, personalized interactions by incorporating memory updating inspired by the Forgetting Curve theory of Ebbinghaus (1964).The theory describes memory retention and forgetting over time.Source: §5 · p. 9
- Long-range conversation studies (Xu et al., 2021, 2022) remain insufficient for long-term companionship, with limited conversation rounds, inadequate user portraits, and missing human-like memory updating.Xu et al. (2021) introduced an English dataset of multi-session human-human crowdworker conversations.Source: §5 · p. 9
- Memory-augmented networks (Meng & Huang, 2018; Graves et al., 2014) use external memory matrices but do not fully provide reliable, adaptable long-term memory for LLMs.These architectures support maintaining and manipulating stored information over extended periods.Source: §5 · p. 9
6 Conclusion
MemoryBank gives LLMs long-term memory to maintain context, recall information, and understand user personality. Experiments with SiliconFriend support its effectiveness for personalized, empathetic long-term companionship.
6 Conclusion
- MemoryBank addresses LLM memory limitations through long-term context retention and a memory-updating mechanism inspired by the Ebbinghaus Forgetting Curve.The mechanism draws on memory retention and forgetting over time to make long-term AI interactions more human-like.Source: §6 · p. 9
- MemoryBank accommodates open-source models such as ChatGLM and BELLE and closed-source models such as ChatGPT.Source: §6 · p. 10
- Qualitative and quantitative experiments validate SiliconFriend’s memory recall, understanding of user behaviors, and higher-quality empathetic companionship when equipped with MemoryBank.SiliconFriend is designed as a long-term AI companion; tuning with psychological dialogue data enables empathetic emotional support.Source: §6 · p. 10
Related papers
This paper cites
Cited by
- EmbodiExp: Compositional Experience Transfer for Embodied Agents2026
- ETAMem: Decoupling and Aligning Heterogeneous Memory for Long-Term Conversational Agents2026
- Proactive Memory for Event-Driven LLM Agents2026
- TrawMem: Reframing Agent Memory as Task-Oriented Role-Adaptive Workspaces2026
- When the Critic Falls Behind: Co-Evolving Rubrics and Harnesses for Continual Agent Self-Improvement2026
- Select-TTT: Query-Conditioned Selective Fast Weight Updates for In-Place Test-Time Training2026