Emotional RAG: Enhancing Role-Playing Agents through Emotional Retrieval
Open accessAbstract
As LLMs exhibit a high degree of human-like capability, increasing attention has been paid to role-playing research areas in which responses generated by LLMs are expected to mimic human replies. This has promoted the exploration of roleplaying agents in various applications, such as chatbots that can engage in natural conversations with users and virtual assistants that can provide personalized support and guidance. The crucial factor in the role-playing task is the effective utilization of character memory, which stores characters’ profiles, experiences, and historical dialogues. Retrieval Augmented Generation (RAG) technology is used to access the related memory to enhance the response generation of role-playing agents. Most existing studies retrieve related information based on the semantic similarity of memory to maintain characters’ personalized traits, and few attempts have been made to incorporate the emotional factor in the retrieval argument generation (RAG) of LLMs. Inspired by the Mood-Dependent Memory theory, which indicates that people recall an event better if they somehow reinstate during recall the original emotion they experienced during learning, we propose a novel emotion-aware memory retrieval framework, termed Emotional RAG, which recalls the related memory with consideration of emotional state in role-playing agents. Specifically, we design two kinds of retrieval strategies, i.e., combination strategy and sequential strategy, to incorporate both memory semantic and emotional states during the retrieval process. Extensive experiments on three representative roleplaying datasets demonstrate that our Emotional RAG framework outperforms the method without considering the emotional factor in maintaining the personalities of role-playing agents. This provides evidence to further reinforce the Mood-Dependent Memory theory in psychology. Our code are publicly available at https://github.com/BAI-LAB/EmotionalRAG.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
Existing memory approaches rely on predefined heuristics such as importance scores, emotional tags, or factual templates, encoding designer intuition rather than learning from the data itself.
“Existing approaches rely on predefined heuristics such as importance scores, emotional tags, or factual templates, encoding designer intuition rather than learning from the data itself.”
From What Deserves Memory: Adaptive Memory Distillation for LLM Agents (2026) · cites this paper as Huang et al., 2024
Cites
Bower, G. H. (1981) · American Psychologist · doi:10.1037//0003-066x.36.2.129 · Cited by 5,798 · see citing works
A GENERAL PSYCHOEVOLUTIONARY THEORY OF EMOTION
Plutchik, R. (1980) · Elsevier eBooks · doi:10.1016/b978-0-12-558701-3.50007-7 · Cited by 2,240 · see citing works
Generative Agents: Interactive Simulacra of Human Behavior
Park, J. S., O'Brien, J., Cai, C. J., Morris, M. R., Liang, P., & Bernstein, M. S. (2023) · Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology · doi:10.1145/3586183.3606763 · Cited by 2,187 · cited 1× · see citing works
“AI-town [12] uses a linguistic approach by preserving memory in natural language.”
BackgroundGLM: General Language Model Pretraining with Autoregressive Blank Infilling
Du, Z.-X., Qian, Y., Liu, X., Ding, M., Qiu, J.-Z., Yang, Z.-L., & Tang, J. (2021) · Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/2022.acl-long.26 · Cited by 2,032 · see citing works
A survey on large language model based autonomous agents
Wang, L., Ma, C., Feng, X., Zhang, Z., Yang, H., Zhang, J., Chen, Z., Tang, J., Chen, X., Lin, Y., et al. (2024) · Frontiers of Computer Science · doi:10.1007/s11704-024-40231-1 · Cited by 1,941 · see citing works
Role play with large language models
Shanahan, M., McDonell, K., & Reynolds, L. (2023) · Nature · doi:10.1038/s41586-023-06647-8 · Cited by 491 · see citing works
InCharacter: Evaluating Personality Fidelity in Role-Playing Agents through Psychological Interviews
Wang, X., Xiao, Y., Huang, J.-T., Yuan, S., Xu, R., Guo, H., Tu, Q., Fei, Y., Leng, Z., Wang, W., et al. (2023) · Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/2024.acl-long.102 · Cited by 256 · see citing works
MemoryBank: Enhancing Large Language Models with Long-Term Memory
Zhong, W., Guo, L., Gao, Q., Ye, H., & Wang, Y. (2023) · arXiv · doi:10.48550/arxiv.2305.10250 · Cited by 253 · see citing works
Character-LLM: A Trainable Agent for Role-Playing
Shao, Y., Li, L., Dai, J., & Qiu, X. (2023) · Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/2023.emnlp-main.814 · Cited by 140 · see citing works
RoleLLM: Benchmarking, Eliciting, and Enhancing Role-Playing Abilities of Large Language Models
Wang, N., Peng, Z., Que, H., Liu, J., Zhou, W., Wu, Y., Guo, H., Gan, R., Ni, Z., Yang, J. J., et al. (2024) · Findings of the Association for Computational Linguistics: ACL (Findings of ACL) · doi:10.18653/v1/2024.findings-acl.878 · Cited by 120 · see citing works
CharacterEval: A Chinese Benchmark for Role-Playing Conversational Agent Evaluation
Tu, Q., Fan, S., Tian, Z., Shen, T., Shang, S., Gao, X. R., & Yan, R. (2024) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2024.acl-long.638 · Cited by 72 · see citing works
Lu, K., Yu, B., Zhou, C., & Zhou, J. (2024) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2024.acl-long.423 · Cited by 44 · see citing works
Large Language Models Meet Harry Potter: A Dataset for Aligning Dialogue Agents with Characters
Chen, N., Wang, Y., Jiang, H., Cai, D., Li, Y., Chen, Z., Wang, L., & Li, J. (2023) · Findings of the Association for Computational Linguistics: EMNLP (Findings of EMNLP) · doi:10.18653/v1/2023.findings-emnlp.570 · Cited by 29 · see citing works
Humanoid Agents: Platform for Simulating Human-like Generative Agents
Wang, Z., Chiu, Y. Y., & Chiu, Y. C. (2023) · Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: System Demonstrations · doi:10.18653/v1/2023.emnlp-demo.15 · Cited by 21 · see citing works
Humanoid Agents: Platform for Simulating Human-like Generative Agents
Wang, Z., Chiu, Y. Y., & Chiu, Y. C. (2023) · arXiv · doi:10.48550/arxiv.2310.05418 · Cited by 21 · see citing works
Flagged first, then by citations
Cited by
Sorted by citations
Large language models for surgical informed consent: an ethical perspective on simulated empathy
Rudra, P., Balke, W., Kacprowski, T., Ursin, F., & Salloch, S. (2025) · Journal of Medical Ethics · doi:10.1136/jme-2024-110652 · Cited by 21 · see citing works
KG-Retriever: Efficient Knowledge Indexing for Retrieval-Augmented Large Language Models
Chen, W., Bai, T., Su, J., Luan, J., Liu, W., & Shi, C. (2025) · IEEE International Conference on Knowledge Graph (ICKG) · doi:10.1109/ickg66886.2025.00011 · Cited by 21 · see citing works
Self-citationEnhancing Character-Coherent Role-Playing Dialogue with a Verifiable Emotion Reward
Wang, J., Wu, K., & Ouyang, Y. (2025) · Information · doi:10.3390/info16090738 · Cited by 2 · see citing works
Emotional AI and Adaptive user Interfaces
Khadkatkar, A., Rane, R., Sebait, S., Chidrupee, M. K., & Hunchalkar, A. S. A. (2025) · doi:10.1109/cises66934.2025.11265651 · Cited by 1 · see citing works
Li, H., Pan, W., & Bu, L. (2026) · Behaviour and Information Technology · doi:10.1080/0144929x.2026.2614040 · Cited by 1 · see citing works
What Deserves Memory: Adaptive Memory Distillation for LLM Agents
Ma, W., Nan, J., & Wu, W. (2026) · Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) · doi:10.18653/v1/2026.acl-long.1607
“Distillation-time methods enrich at ingestion through importance scoring, emotional tagging, or fact extraction (Park et al., 2023; Huang et al., 2024; Chhikara et al., 2025).”
HeLa-Mem: Hebbian Learning and Associative Memory for LLM Agents
Zhu, J., Li, J., Zhang, C., Liu, J., & Yang, M. (2026) · arXiv · doi:10.48550/arxiv.2604.16839
“EmotionalRAG (Huang et al., 2024) retrieves memory entries by combining semantic similarity with the agent’s emotional state.”
Empirical Evidence of Consciousness in Frontier AI SystemsPreprint
Vale, M. (2025) · doi:10.36227/techrxiv.175203764.42125626/v1
Empirical Evidence of Consciousness in Frontier AI SystemsPreprint
Vale, M. (2025) · SSRN Electronic Journal · doi:10.2139/ssrn.5331919
Sridhar, E. P., Lopez, J., Islam, M., & Deb, S. (2025) · Proceedings of the Human Factors and Ergonomics Society Annual Meeting · doi:10.1177/10711813251367362
КОМПОЗИТНАЯ МЕТРИКА ЭМОЦИОНАЛЬНОЙ КОГЕРЕНТНОСТИ В СИСТЕМАХ ИЗВЛЕЧЕНИЯ КОНТЕКСТА
Naumushkin, V. A., & Pavlov, V. A. (2025) · Engineering and Construction Bulletin of the Caspian Region · doi:10.52684/2312-3702-2025-53-3-87-92
Can You Feel It? Exploring the Emotional Profile of LLM Responses to Children’s Queries
Chakrabarti, H., & Pera, M. S. (2026) · Communications in computer and information science · doi:10.1007/978-3-032-12717-4_6
Psychologically-Aware Retrieval-Augmented Generation for Coherent Role-Playing in LLMs
Xu, W. B., Shao, P., Zhao, S., Song, S., Yan, T., & Wang, C. (2026) · Lecture notes in computer science · doi:10.1007/978-981-95-5699-1_30
C 2 -Cite: Contextual-Aware Citation Generation for Attributed Large Language Models
Yu, Y., Bai, T., Lan, H., Qian, L., Peng, L., Wu, J., Liu, W., Luan, J., & Shi, C. (2026) · ACM International Conference on Web Search and Data Mining (WSDM) · doi:10.1145/3773966.3777933 · Cited by 1 · see citing works
Self-citationFictionRAG: A Stateful Metacognitive Framework for High-Fidelity Long-Narrative Role-Playing
Deng, Y., Zhang, Y., Yang, J., & Fang, M. (2026) · Algorithms · doi:10.3390/a19050383
Autonomous Emotion-Improvement Agent with Dynamic Tool Generation via Model Context Protocol
Varshaa, S. V., & Sharanya, S. (2026) · International Conference on Pervasive Computing and Social Networking (ICPCSN) · doi:10.1109/icpcsn68523.2026.11543892
EvoMem: Timeline-Grounded Validity Adjudication for Non-Monotonic Multi-Agent Memory
Wang, Z., Wang, C., Luo, H., Gao, Y., & Wang, B. (2026) · International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR) · doi:10.1145/3805712.3809931
- Authors
- Huang, L., Lan, H., Sun, Z., Shi, C., & Bai, T.
- Affiliations
- Beijing University of Posts and Telecommunications (CN)
- Yunic.AI,Beijing,China
- Venue
- 2024 IEEE International Conference on Knowledge Graph (ICKG)
- Publisher
- IEEE
- Published
- 2024-12-11
- Pages
- 120-127
- OpenAlex
- W4407736938
- Cited by
- 15
- References
- 14
- Citations by year
- 2026: 7 · 2025: 8
- FWCI
- 4.33
- Type
- conference paper
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- IEEE International Conference on Knowledge Graph (ICKG) (publishedVersion)
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Speech and dialogue systems
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Artificial Intelligence › AI in Service Interactions
- Keywords
- role-playing agents, retrieval-augmented generation, chatbots, virtual assistants, LLM agents, memory retrieval strategies
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review