NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Dynamic Affective Memory Management for Personalized LLM Agents

Junfeng Lu, Yueyan LiarXiv 2025 · DOI

Abstract

Traditional Retrieval-Augmented Generation (RAG) systems for Large Language Model (LLM) agents often treat user interactions as static, discrete facts, leading to memory bloat and cognitive incoherence when user preferences evolve. We present DAM-LLM (Dynamic Affective Memory LLM), a framework that conceptualizes memory as a dynamic, probabilistic distribution. By employing Bayesian-inspired updates and entropy-driven compression, DAM-LLM maintains a lean, high-confidence memory store. Experimental results on the DABench benchmark demonstrate that DAM-LLM reduces memory size by up to 70% while significantly improving emotional resonance and personalization compared to standard RAG baselines.

Introduction

Current LLM agents rely heavily on external memory to provide personalized experiences. However, affective scenarios—where user emotions and attitudes are central—reveal two critical flaws in traditional RAG: memory stagnation and memory bloat. Stagnation occurs when systems hold contradictory records of shifting user attitudes, while bloat arises from the indiscriminate storage of every interaction, creating a "needle in a haystack" problem that increases latency and noise.

DAM-LLM addresses these challenges by treating affection not as a set of strings, but as a continuous signal to be constructed and refined over time. This approach allows agents to "forget" noise and "learn" core user traits through statistical confidence.

The DAM-LLM Framework

At the heart of the system is a Master Agent designed to manage memory units actively. Unlike passive databases, the Master Agent operates under a core objective: minimizing global memory entropy while maximizing the certainty of understanding user emotions.

The Master Agent architecture manages memory units through perception, retrieval, and introspection to minimize global entropy.

Bayesian-Inspired Updates

DAM-LLM moves away from simple vector storage toward a weighted sentiment profile. Each memory unit contains a sentiment polarity vector (positive, negative, neutral). When new evidence is perceived, the system performs a Bayesian update to adjust the confidence of that specific memory. This mechanism prevents the agent from overreacting to outliers; for instance, a single negative comment will not immediately override a long history of positive interactions, but will instead slightly shift the probability distribution.

The Bayesian update mechanism integrates new evidence sentiment vectors into existing memory states using weighted calculations.

Entropy-Driven Compression and Retrieval

The system utilizes Belief Entropy to evaluate memory health. Memories with low entropy ($H < 0.8$) are considered "mature" and stable, while high entropy ($H > 1.4$) indicates contradictory observations that trigger pruning or merging. This entropy-driven approach ensures the agent maintains a sharp signal by actively "forgetting" low-value or outdated data.

To maintain accuracy, DAM-LLM employs a Two-Stage Hybrid Retrieval process. It first filters memories by metadata (e.g., specific objects or aspects) before performing semantic re-ranking, effectively preventing "semantic drift" where unrelated memories might otherwise be retrieved.

Experimental Evaluation

Datasets and Setup

The researchers introduced DABench, a specialized benchmark containing 2,500 observation sequences and 1,000 turns of simulated interactions designed to track evolving user states. The study utilized Qwen-Max as the base LLM and GPT-4 as an automated judge to evaluate logical coherence and emotional resonance.

Key Results

  • Efficiency: DAM-LLM achieved a 63.7% to 70.6% reduction in total memory size compared to vanilla RAG. While standard RAG memory grows linearly, DAM-LLM’s memory count stabilizes as it filters out noise.
  • Performance: In "LLM-as-a-judge" testing, DAM-LLM significantly outperformed baselines in Emotional Resonance (4.5 vs 3.8) and Personalization (4.6 vs 3.5) on a 5-point scale.

Conclusion and Future Work

DAM-LLM demonstrates that effective memory management for AI agents requires the ability to both learn and forget. By treating memory as a statistical distribution, agents can handle opinion shifts gracefully and maintain high performance without indefinite database growth. Future research will focus on moving memory updates to asynchronous background processes to further reduce real-time computational overhead and improve responsiveness in live interactions.

Summary updated

BibTeX
@misc{lu2025dynamic,
  author = {Junfeng Lu and Yueyan Li},
  title = {{Dynamic Affective Memory Management for Personalized LLM Agents}},
  year = {2025},
  eprint = {2510.27418},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.27418},
}
Figure