π€ AI Summary
To address the challenge that role-playing agents (RPAs) often deviate from their designated personas when answering out-of-domain questions, this paper proposes AMADEUSβa retrieval-augmented generation (RAG) framework for persona-consistent role playing. AMADEUS jointly models role-specific knowledge and personality traits via three core components: Adaptive Context-aware Text Segmentation (ACTS), Guided Retrieval (GS), and Attribute Extractor (AE). We further introduce CharacterRAG, the first benchmark dataset specifically designed for retrieval-augmented role playing, supporting dynamic context segmentation and hierarchical context modeling. Experiments demonstrate that AMADEUS significantly improves both knowledge accuracy and persona consistency on CharacterRAG (+12.7% in role coherence score), particularly maintaining stable persona adherence during out-of-knowledge-domain question answering. Our key contributions are: (1) the first RAG framework explicitly optimized for role consistency; (2) the first role-specific RAG benchmark (CharacterRAG); and (3) a novel knowledge-persona co-modeling methodology.
π Abstract
We propose AMADEUS, which is composed of Adaptive Context-aware Text Splitter (ACTS), Guided Selection (GS), and Attribute Extractor (AE). ACTS finds an optimal chunk length and hierarchical contexts for each character. AE identifies a character's general attributes from the chunks retrieved by GS and uses these attributes as a final context to maintain robust persona consistency even when answering out of knowledge questions. To facilitate the development and evaluation of RAG-based RPAs, we construct CharacterRAG, a role-playing dataset that consists of persona documents for 15 distinct fictional characters totaling 976K written characters, and 450 question and answer pairs. We find that our framework effectively models not only the knowledge possessed by characters, but also various attributes such as personality.