/the garage — 05 / 09
Bachelor's thesis projectSerenity
A gentle space to understand and care for your mental well-being.

/overview
A bachelor's thesis MVP: eight CrewAI agents, two validated questionnaires and a voice assistant, working together to help someone track their mental well-being — never standing in for a professional.
/approach
Research
Grounded the design in validated instruments — PHQ-9, GAD-7 — and color/arousal literature instead of guesswork.
Agent architecture
Designed eight CrewAI agents with distinct roles, orchestrated through an 11-task pipeline with machine state kept separate from user-facing copy.
Safety gates
Built two hard gates — critical-mood escalation and a 14-day questionnaire lock — so the system never reasons on stale or risky data.
Calm UI
Kept the interface to low-saturation tones and under-3-tap flows, so checking in never feels like a chore.
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
/development
- 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.
🧭 Orchestrator — Systems 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




/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.”

⏳ 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.

/ux design
- 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.
- User research
- User flows
- Wireframes
- Figma prototype
- Usability testing
