Design of a conversational agent to support people on suicide risk (2025)

Abstract: In this paper, we present a core component of the VisIA project: a conversational agent designed to detect suicide risk factors during real-time chat interactions. By adhering to clinical guidelines and the state-of-the-art theories of suicide, the agent aims to provide a scalable and effective approach to identifying individuals at risk. Preliminary results demonstrate the feasibility and potential of conversational agents in enhancing suicide risk detection.

## introduction suicide is one of the leading causes of death among young adults worldwide, and its prevention remains a critical public health priority @xcite . current suicide risk assessments methods are often short, resulting in false positives and negatives, and highlighting the need for innovative and scalable approaches @xcite . the visia project @xcite ) addresses this challenge by leveraging artificial intelligence (ai) technologies @xcite and multi-modal data, grounded in state-of-the-art theories of suicide @xcite . the project consists of two major steps: first, conducting a clinical trial to gather clinically validated data, and second, developing solutions to improve suicide risk detection and support systems. at its core is visia-bot, a conversational agent designed to detect suicide ideation during chat interactions. by leveraging suicide constructs, the agent identifies key risk factors and provides targeted support for individuals experiencing emotional distress. this paper focuses on the visia-bot conversational agent, particularly on the suicide ideation detection component based on suicide prevention theory and practice. the following sections detail the clinical trial design, the visia-bot's suicide constructs detection system and study findings. ## clinical trial the visia project's clinical trial, see all the details in @xcite , follows a non-interventional, analytical, observational and prospective design aimed at gathering data from adolescents and young adults (aged 11-16) with varying levels of suicide risk. the study includes a total of 339 participants divided in three distinct groups: a clinical, a clinical control and a general control populations. the study has been approved by the clinical research ethics committee of galicia (dictum 2023/029), adheres to the declaration of helsinki, and the standards of the general data protection regulation @xcite . informed consent was obtained from all participants, and the study is registered under nct06341634. ## theory of suicide the understanding of suicide has evolved significantly in recent decades, with contemporary theories emphasizing the interplay of psychological, interpersonal, and experiential factors in the development of suicidal ideation and behaviors. recent multidimensional frameworks provide greater insight into the complex mechanisms underlying suicide risk. among these, klonsky's three-step theory (3st) @xcite and joiner's interpersonal theory of suicide (its) @xcite have gained prominence for their ability to explain both the emergence of suicidal ideation and the progression to suicide attempts. the its posits that suicidal behavior arises from the convergence of two interpersonal constructs, perceived burdensomeness (belief of being a liability to others) and thwarted belongingness (sense of social disconnection), along with the acquired capability for suicide, which develops through habituation to fear and pain via exposure to traumatic or self-injurious experiences. the 3st, provides a structured framework for understanding suicidal ideation and behavior through three progressive stages: the emergence of suicidal thoughts due to intense psychological pain coupled with hopelessness; the amplification of suicidal ideation when individuals feel burdensome and disconnected from others; and the transition to suicide attempts, facilitated by acquired capability. based on these theories, a practical tool called suicide log was presented in @xcite , aiming at co-constructing and understanding the user's emotional pain through several phases. this tool is commonly used in clinical practice. ## related work suicidal ideation detection systems primarily rely on a combination of machine learning, deep learning, and natural language processing (nlp) techniques @xcite . traditional machine learning models, such as support vector machines (svm), random forest (rf), decision trees (dt), and naïve bayes (nb), utilize handcrafted feature extraction methods to classify text. more advanced deep learning approaches, such as long short-term memory (lstm), convolutional neural networks (cnn) and gated recurrent unit (gru) models, leverage word embeddings to capture semantic relationships within text. these methods work on existing datasets (ko-mati, accessed: 2023-12-24) for training and testing the models. the visia project follows a different approach, leveraging llms to adhere to established clinical practices while integrating insights from modern suicide theories and psychiatry experts. ## visia-bot concept the project proposed the development of a tool based on conversational agent technology designed to follow a structured methodology aimed at supporting clinical practices as well as triage and risk assessment in non-clinical settings, such as school counseling and hospital emergency rooms. the tool aims to identify suicidal constructs and potential suicidal ideation, bridging the gap between early detection and professional intervention. to achieve this, the suicide log was chosen as the primary reference, alongside the theoretical framework guiding its implementation. the interaction begins with open-ended questions focused on the participant's emotions. if self-harm or moderate to high suicide risk is detected, the suicide log procedure is started (see 1). visia-bot consists of two functionally distinct components that work in parallel: a conversational agent designed to follow the principles and steps of the suicide log, which guides the conversation, and a suicide construct detector, the focus of this paper, designed to identify relevant constructs in text fragments in order to assess suicide risk based on the theoretical framework previously outlined. the interaction between the two components is constant, as the decisions from the conversational agent are based on both the responses of the user and the results of the suicide construct detector. ## development framework the tool is being developed using langchain foot_0 with langgraph foot_1 to orchestrate the workflow and ollama to run the large language models (llms). this framework was selected over traditional conversational agent tools like rasa @xcite due to its capabilities to generate humanlike organic responses, to make decisions based on detailed instructions and to solve complex tasks while simplifying the development process. one of the key limitations of frameworks like rasa lies in their reliance on predefined intents and entities, which can restrict their ability to handle complex or ambiguous inputs. although traditional frameworks are effective in structured dialogue systems, its rule-based and classification-driven approach struggles with nuanced language, making it less suitable for detecting abstract concepts such as loneliness, distress, or emotional well-being @xcite . additionally, llm-based agent orchestration capabilities provide a clear advantage in decision-making and task-solving @xcite . regarding llms, llama3:8b and mistral:7b were considered for development among other optimized models, being llama3 the best performer in early testing and final option. both models were queried to assess their knowledge of the theoretical framework, confirming their familiarity with relevant concepts and their interrelations. the focus was set on the constructs extracted directly from the theoretical framework, following an integrative approach, since both theories have distinct perspectives on critical constructs. according to klonsky, "disrupted connectedness is similar to low belongingness and burdensomeness as described in joiner's interpersonal theory". for this work, since low belongingness is conceptually very close to disrupted connectedness and would be potentially very difficult to discern, both were integrated into one construct. during development, the construct of acquired capability yielded consistently low detection rates, leading to its replacement with two constructs that could be identified more clearly in adolescent's statements: passive suicidal ideation and active suicidal ideation. in these new constructs, the acquired capability is implicitly included within active suicidal ideation, which represents the higher-risk construct. according to klonsky's theory, suicidal ideation arises from psychological pain and hopelessness, which can be directly expressed in concise chat phrases, such as "i wish i could fall asleep and never wake up". in conclusion, the final suicide constructs to be detected are: psychological pain, hopelessness, burdensomeness, disrupted connectedness (low belongingness), passive suicidal ideation and active suicidal ideation.