/the garage — 03 / 07

Bachelor's thesis project

Serenity

A gentle space to understand and care for your mental well-being.

Bachelor's thesis · Computer Engineering · University of Calabria

“Agentic AI and Multi-Agent Architectures: Design and Implementation of Serenity for Mental Well-Being Support”

Serenity analyzes and recognizes symptoms of anxiety, depression and stress, and supports the user through guided interactions. It is a complementary tool for people who face economic, cultural or social barriers to traditional psychological care — never a substitute for a professional.

8 specialist agents · 11-task pipeline · 2 validated questionnaires · 1 structured output

Serenity — home screen with daily check-in, mood log and symptom intensity graph

/development

Bachelor's thesis project focused on designing and building an MVP for MentalCare, helping users track mental well-being through a standardized questionnaire, recurring check-ins, mood escalation handling, a Voice RAG assistant, and a dynamically updated mood timeline.

/stack

  • Flutter
  • Next.js
  • FastAPI
  • MySQL
  • CrewAI
  • ElevenLabs
  • Ollama

/the agent crew

The multi-agent architecture is built on CrewAI: eight agents with distinct responsibilities, declared with a role, a goal and a backstory. The Orchestrator routes every input to the right workflow and scopes what each specialist can see — tap an agent to meet it.

🧭 OrchestratorSystems architect of the crew

Receives every input — a PHQ-9 run, a GAD-7 run, a free-text check-in — and routes it to the correct workflow. It enforces execution order, scopes what data each specialist can access, applies version checks on tools, logs every invocation and merges everything into a single structured output for the UI. It never makes clinical diagnoses.

orchestrator:
  role: Serenity Agent Orchestrator
  goal: Coordinate all specialist agents, route user inputs to the
        correct workflow (PHQ-9, GAD-7, free-text), enforce execution
        order, and produce a single structured output — without
        making clinical diagnoses.

Every agent lives in CrewAI's agents.yaml as role + goal + backstory: the whole crew is configuration, not code.

/the pipeline

Every input walks through eleven tasks, each assigned to an agent of the crew. The system keeps two kinds of output strictly separate: machine-readable structures that update graphs and state, and user-facing texts generated under communication constraints and safety-checked before display.

Free text and context enter the system as a structured envelope: session_id, timestamp, consent status, language and the user's description.

/under the hood

One codebase, every platform

The app boots from main.dart into a MaterialApp.router; navigation is centralized in router.dart with GoRouter, keeping the entry point separate from the routing logic.

A single AppTheme defines the palette and the Manrope typography for the whole app — screens, features and services live in separate modules so the UI stays decoupled from business logic and data access.

routes

  • /welcome
  • /gdpr
  • /assessment
  • /home

/the app

Serenity — A gentle space — the welcome
01 A gentle space — the welcome
Serenity — Onboarding: understand how you feel
02 Onboarding: understand how you feel
Serenity — PHQ-9 assessment, one item at a time
03 PHQ-9 assessment, one item at a time
Serenity — Progress: symptom intensity & activity
04 Progress: symptom intensity & activity

/safety by design

An assistant in a domain this sensitive must know exactly where it stops. Serenity enforces two hard gates, on top of agents that act as filters against hallucinated or harmful output.

🚨 Critical mood detected

If a daily check-in reveals a critical emotional state, access is blocked and the app shows a human-support screen with a contact path — “Serenity is not designed to support high-risk situations on its own.”

Serenity — human escalation screen: we noticed that you may need human support

⏳ Questionnaire overdue

After 14 days without renewing PHQ-9/GAD-7, the app locks until the questionnaire is completed again — the system never reasons, or advises, on stale data.

Serenity — lock screen: questionnaire update required

/ux design

Designed the full experience of the MentalCare MVP: onboarding built around a standardized well-being questionnaire, recurring check-ins that stay lightweight over time, an escalation path for concerning moods, and a voice assistant and mood timeline shaped around moments of vulnerability.

/tools & methods

  • User research
  • User flows
  • Wireframes
  • Figma prototype
  • Usability testing

/designing for calm

Color, backed by literature

Saturation and brightness are arousal levers (Valdez & Mehrabian): Serenity uses low-saturation, adequately luminous tones so the interface feels calm and comfortable instead of activating.

Everything under 3 taps

Core operations take fewer than 3 taps on screen. A minimal, non-dispersive interface reduces cognitive load — and with it, the risk of abandoning the app.

Two ways to log a day

Daily Check-in: free text plus an emoji, as often as you want. Mood Log: one tap on 5 emojis, once a day. Depth when you have energy, speed when you don't.

A cadence with a reason

PHQ-9 and GAD-7 measure the previous two weeks, so Serenity re-administers them every 14 days: more often is statistically weak and emotionally taxing, less often misses relevant shifts.

Private repositoryBack to the garage