MOOM-RolePlay
May 19, 2025 ยท View on GitHub
The code of our paper "MOOM: Maintenance, Organization and Optimization of Memory in Ultra-Long Role-Playing Dialogues"
Overview
Memory extraction is crucial for maintaining coherent ultra-long dialogues in human-robot role-playing scenarios. However, existing methods often exhibit uncontrolled memory growth. To address this, we propose MOOM, the first dual-branch memory plugin that leverages literary theory by modeling plot development and character portrayal as core storytelling elements. Specifically, one branch summarizes plot conflicts across multiple time scales, while the other extracts the user's character profile to enable personalized interactions. MOOM further integrates a forgetting mechanism, inspired by the "competition-inhibition" memory theory, to constrain memory capacity and mitigate uncontrolled growth. Furthermore, we present ZH-4O, a Chinese ultra-long dialogue dataset specifically designed for role-playing, featuring dialogues that average 600 turns and include manually annotated memory information. Experimental results demonstrate that MOOM outperforms all state-of-the-art memory extraction methods, requiring fewer large language model invocations while maintaining a controllable memory capacity.
Usage
Download
bash download.sh
Start
uvicorn main:app --host 0.0.0.0 --port 8231
Run MOOM
python file_store_memory.py
Evaluation
python indicator_calculate.py