Introduction
Empathetic chatbots represent a significant evolution in the field of conversational AI, designed not just to understand commands or queries, but to perceive and interpret the emotional states of their users.
These advanced agents leverage Natural Language Processing (NLP) approaches to analyze text for emotional content, enabling them to engage in interactions that feel more human-like.

By recognizing and responding to a wide range of emotions, empathetic chatbots can tailor their responses to provide comfort, advice, or support, thereby enhancing the user experience. This capability is particularly valuable in applications ranging from customer service and mental health support to personal assistants and social companions, where understanding and addressing the emotional needs of users can significantly impact satisfaction and outcomes Crestani et al. ( 2022 ); Cena et al. ( 2023 ) .

With the advent of advanced large language models (LLMs), the interaction experience with conversational agents has seen remarkable improvements.
These new models exhibit enhanced understanding of natural language, greater contextual awareness, and the ability to generate more coherent and contextually appropriate responses.
This technological leap has not only transformed how conversational agents interact with users but has also opened new avenues for analyzing and understanding human emotional expressions Sekulić et al. ( 2021 ) .

The motivation behind this research is rooted in the understanding that mental health support can be augmented through the use of empathetic conversational AI. For this purpose, we developed a conversational system called RACLETTE ( R esponsive A nalysis with C hatbot L LMs for E motional and T herapeutical T racking and E valuation ).

The key highlights of this paper include the development of a conversational model capable of detecting, understanding, and responding to emotional cues similar to human empathy (see Figure 1 for a visual example). This model is based on a novel approach to create emotion embeddings, which allows for the gradual construction of a user’s emotional profile through interaction with the empathetic conversational model. We show how the user’s emotional profile can be compared with known, pre-computed emotional profiles extracted from specialized datasets where individuals discuss their own experiences on specific mental health issues, with the rationale of potentially obtaining an explainable assessment of the mental state of the user engaging with the system.

The contributions and findings of this work are twofold: (1.) We define a method to tailor a chatbot, RACLETTE, for reacting empathetically to a specific user. RACLETTE uses an unconventional 3-turn structure where the model is trained to predict the user’s emotion as a next-token prediction, leveraging the generative capabilities of the underlying Mistral 7B model, and responds empathetically based on the predicted emotion. Additionally, during the conversation, the user’s emotional profile is updated, making the chatbot aware of the user’s emotional condition in real-time. This updating allows the system to refine its understanding of the user’s emotional state, enabling more precise and empathetic responses. (2.) We demonstrate how different mental disorders can be viewed as mixtures of specific emotions, guided by psychological theory.

This framework suggests that emotional states are interconnected components forming distinct patterns linked to various mental health conditions. Emotional profiles for specific disorders can be pre-calculated and compared with users’ emotional profiles to differentiate between conditions, potentially aiding in early detection and diagnosis. These emotional profiles can be viewed as markers for identifying different groups of mental disorders.

The paper is structured as follows. Section 2 discusses the Related Work. Section 3 presents the methodology, data, and provides a psychological rationale supporting our approach. Section 4 presents the results of our model on the task of correct emotion classification and the quality of empathetic response generation. Section 5 discusses the explainable method for generating embeddings associated with various mental disorders and shows qualitative results. In Section 6 we present the results of an experiment using emotional profiles to discriminate users belonging to different subreddit communities. Finally, Section 7 presents the conclusions.