Conversational agent for depression, stress and OCD support among university Students in Uganda

Date
2025
Authors
Katamba, Harun Arnold
Nabaggala, Sarah
Modi, Shedrick
Ojok, Amos
Journal Title
Journal ISSN
Volume Title
Publisher
Makerere University
Abstract
University students in Uganda face a significant mental health crisis characterized by high levels of depression, stress and obsessive compulsive disorder(OCD). This situation is worsening due to limited mental health resources and stigma. To address this pressing need, we present a conversational agent that integrates Retrieval Augmented Generation (RAG) with the Gemini API, that facilitates real time access to localized mental health information and personalized support. The chatbot utilizes a curated dataset from academic literature, social media and web pages focused on Ugandan context specific to mental health. Advanced natural language processing techniques likes sentiment analysis with most of the text being neutral sentiment, lemmatization and semantic search through sentence embeddings, which enhances the chatbot’s ability to understand and empathize with student discourse. The chatbot uses a vector database to quickly find the needed content and connects with external documents using the Gemini API. Our serenity chatbot API, developed using FastAPI, enables seamless integration into diverse applications such as mobile platforms and external systems, supporting conversation continuity with unique session identifiers and offering a modular, scalable framework for broader deployment. Additionally, the Serenity Playground, a dedicated sandbox environment, allows users to use the API’s features in real-time, evaluating its empathetic responses and effectiveness in mental wellness scenarios before integration. This setup helps generate answers that are clear and legally correct. Evaluation was done using state of the art NLP metrics and validated through collaborations with university counseling professionals, the chatbot demonstrates robust performance in detecting and classifying indicators of mental distress, with an overall Mean Reciprocal Rank (MRR) of 77.64%, ROUGE-1 F1 score of 71.33%, and ROUGE-L F1 score of 73.00%, reflecting high relevance and content overlap. Performance analysis across 100 question-answer pairs revealed an average response time of 1.64 seconds and an average length of 112.2 words, showcasing efficiency and adaptability. Explainability features, including document retrieval analysis and decision path visualizations, ensure transparency, with context utilization reaching up to 69% for relevant queries. This paper highlights the transformative potential of combining RAG based models with the Gemini API in delivering scalable, accessible and context aware mental health support to university students in developing regions, paving the way for future enhancements in AI-driven mental health solutions.
Description
A report submitted to the Department of Computer Science in partial fulfillment of the requirements for the degree of B.Sc. in Computer Science of Makerere University
Keywords
Mental Health, Machine Learning, AI, Machine learning
Citation
Katamba, H. A. et al. (2025). Conversational agent for depression, stress and OCD support among university Students in Uganda; Unpublished dissertation, Makerere University, Kampala