← Back to Paper List

EmotionalRAG: Enhancing role-playing agents through emotional retrieval

L Huang, H Lan, Z Sun, C Shi…
Beijing University of Posts and Telecommunications, Yunic.AI
IEEE International … (2024)
Memory RAG Agent P13N

📝 Paper Summary

Memory recall Modularized RAG pipeline
Emotional RAG mimics human cognition by retrieving memories based on both semantic relevance and emotional congruence, enabling role-playing agents to generate more character-consistent responses.
Core Problem
Existing RAG methods for role-playing agents rely solely on semantic similarity to retrieve memories, ignoring the psychological influence of emotions on memory recall.
Why it matters:
  • Role-playing agents (e.g., in customer service or games) need to maintain consistent personalities, but purely semantic retrieval often misses the emotional context required for human-like responses
  • Current approaches fail to leverage Mood-Dependent Memory theory, which suggests memories are better recalled when current mood matches the mood at encoding
Concrete Example: If a character is currently angry, standard RAG might retrieve a semantically relevant but emotionally neutral memory (e.g., a fact about their job), whereas Emotional RAG would prioritize retrieving memories of past anger or conflict, leading to a more consistent angry response.
Key Novelty
Mood-Congruent Memory Retrieval
  • Encodes both the semantic meaning and the emotional state (across 8 dimensions like joy, fear, anger) for every user query and stored memory fragment
  • Calculates retrieval scores using a dual metric: semantic distance (Euclidean) combined with emotional distance (Cosine similarity of emotion vectors)
  • Applies flexible strategies (Combination or Sequential) to weight or re-rank memories, prioritizing those that match the character's current emotional state
Architecture
Architecture Figure Figure 1
Overview of the Emotional RAG framework, illustrating the parallel processing of queries and memories for both semantic and emotional content.
Evaluation Highlights
  • Outperforms Ordinary RAG (semantic-only) on InCharacter dataset using ChatGLM-6B: +0.027 MSE improvement on BFI personality consistency
  • Achieves higher MBTI accuracy on CharacterEval dataset with Qwen-72B: 67.53% Acc (Full) vs 59.74% for Ordinary RAG
  • Consistent gains across three datasets (InCharacter, CharacterEval, Character-LLM) verify that emotional context aids personality maintenance
Breakthrough Assessment
7/10
Novel application of psychological memory theory to RAG. While the architectural changes are straightforward (dual encoding), the consistent empirical gains across personality benchmarks demonstrate the value of emotional context.
×