Skip to content
← All projects
ArchivedFeb 2025 — present

An On-Device AI Therapist

A mental-health chatbot that reads how you feel and never sends it anywhere.

PyTorchTransformersLoRAQLoRAAdaptersRAGQuantizationiOSAndroid

Two degrees, one system

I did a double degree at Deusto — Computer Science and Data Science & AI — which meant two final-year theses. Rather than treat them as separate obligations I built them as two halves of the same product, both directed by Aritz Bilbao Jayo:

  • Computer Science TFG — “Designing an AI-powered virtual therapist based on emotion recognition” (9.2/10). The application: an on-device mobile chatbot that reads a user’s input, identifies their mental-health state, and adapts its responses to give tailored, empathetic support.
  • Data Science & AI TFG — “Development of a fine-grained sentiment analysis system for textual data” (9.1/10). The model underneath it: sentiment and emotion recognition over text, built to detect mental-health patterns and sized from the start for mobile deployment.

Why on-device

Because of what the data is. Someone typing to a mental-health chatbot is handing over the most sensitive text they will write all week, and the honest thing to do with it is not to move it. Nothing is stored in the cloud; inference happens on the phone.

That decision is what made the project technically interesting. It converts a comfortable problem — call a hosted model, get an answer — into a hard one: fit capable language models into a phone’s memory and latency budget without the quality collapsing.

How it was done

The work was mostly post-training and compression:

  • Parameter-efficient fine-tuning — LoRA, QLoRA and adapters — to specialise several LLMs for the domain without full fine-tunes.
  • Quantization to get inference inside the device’s memory and latency budget.
  • Retrieval-augmented generation so responses draw on retrieved material instead of being generated free-hand.
  • Guardrails, because this is a safety-critical domain. A mental-health assistant that says the wrong thing is not a degraded product, it is a dangerous one, and a meaningful part of the work was constraining what the system is allowed to say and when it should defer.

The result shipped as a working iOS and Android application.

Recognition

The work was shortlisted as a top-5 finalist for the Inetum Best Bachelor’s Thesis Award in 2025.