Health professionals

Scientific dossier

This dossier describes what Sommelle does, rule by rule, and which guidelines each rule is based on. It is intended for doctors, psychologists, pharmacists and other health professionals who want to know exactly what the app offers their patients before recommending it, or who want to help us improve it.

Everything written here matches how the app actually works. The numerical values are gathered in a single place in the source code, which is public.

Status. Sommelle is a self-help and education tool, not a medical device. It makes no diagnosis, does not replace a consultation and claims no therapeutic effect of its own. Its effectiveness has not been evaluated in a clinical study.

1. CBT-I in brief

Cognitive behavioral therapy for insomnia (CBT-I) is the first-line treatment for chronic insomnia in adults, ahead of hypnotics, according to European (2023) and American (American College of Physicians, 2016) guidelines. The French health authority (HAS, 2024) also asks for CBT to be offered first, before any medication, for insomnia that is more than occasional. It combines several components: sleep diary, sleep restriction, stimulus control, cognitive work and sleep education.

For digital CBT-I, effectiveness is mainly shown for guided online programs; effects are smaller without human support. The main challenge is for the patient to complete the program: this is what guides Sommelle's design (quick entry, nothing that makes the patient feel guilty).

2. Program outline

WeekWhat the patient experiences
Before startingA 2 to 3 minute entry questionnaire (safety and profile), leading to one of the three pathways described in section 7.
0Observation week: sleep diary every morning, with no demanding instructions.
1First sleep window (bedtime and rise time) and stimulus control instructions.
2 to 5Window adjusted each week; a new cognitive exercise unlocks each week.
6Before/after review.
After thatMaintenance: the patient can keep up the diary, and the window keeps adjusting.

A forgotten night can be filled in up to 48 hours later. There is no daily score, no streak to maintain and no red: a bad week is presented as information, never as a failure.

3. The sleep diary

The diary uses the Core version of the Consensus Sleep Diary (Carney et al., 2012). Each morning, the patient enters:

Durations are estimated from simple choices ("less than 5 min", "15 min", "30 min"…), never timed: asking for exact minutes would push the patient to check the time at night. In an experimental study, watching a clock while trying to sleep increased pre-sleep worry and the perceived time to fall asleep (Tang et al., 2007). An entry takes a few moments. The app checks that times are consistent and flags inconsistencies without blocking the patient.

Calculations from the diary

Time spent in bed before turning off the light counts towards time in bed but not towards sleep, which is consistent with the instruction to keep the bed for sleep.

A night broken down Into bed at 11 pm, lights out at 11:15 pm, asleep after 45 minutes, two awakenings of 25 and 15 minutes, final awakening at 6:15 am, out of bed at 6:45 am. Time in bed: 7 hours 45 minutes. Total sleep time: 5 hours 35 minutes. Efficiency: 72%. 23:00 0:00 1:00 2:00 3:00 4:00 5:00 6:00 7:00 sleep sleep Into bed 23:00 Lights out 23:15 Final awakening 6:15 Out of bed 6:45 awake 25 min awake 15 min falling asleep 45 min Time in bed: 23:00 → 6:45 = 7:45 Sleep: 7:00 − 45 min − 40 min = 5:35
Figure 1. A night as the patient describes it in the diary. Sleep efficiency for the night: 5 h 35 min ÷ 7 h 45 min = 72%. The fifteen minutes of reading before lights out and the half hour in bed after waking count towards time in bed, not sleep.

4. The sleep window (sleep restriction)

The principle (Spielman et al., 1987): temporarily reduce time in bed to the time actually slept, to consolidate sleep, then gradually extend it.

RuleValue in Sommelle
Observation period before any restriction7 days
Logged nights requiredAt least 5 out of 7, otherwise the window is kept and the patient is told
Initial windowMean total sleep time during the observation week, rounded up to the next quarter hour
Minimum length6 h, the same for every profile (design choice). Réseau Morphée (2019) gives 6 h as the lower limit of time in bed; other published protocols accept 5 h (Spielman et al., 2011; RACGP), and reviews report minimums of 4.5, 5 or 6 h depending on the protocol (Riemann et al., 2023). A window already under way below 6 h is raised to 6 h at the next calculation. This floor is the upper end of the published range: it is the most cautious of the minimums found
Maximum length9 h (design choice: we found no published source for this ceiling). The same bounds, 6 h and 9 h, apply to every profile: this is also a design choice
AnchorFixed rise time, chosen by the patient, 7 days a week; the bedtime follows from it
Weekly adjustmentEfficiency ≥ 85%: +15 min; < 80%: −15 min (without going below the minimum); in between: unchanged. For comparison, the Spielman et al. (2011) manual lengthens from 90% and shortens below 85%, and Réseau Morphée (2019) waits for an index above 85% before moving bedtime earlier: Sommelle's thresholds (85% and 80%) are therefore more lenient than the manual's (90% and 85%), while staying within the published ranges. This is a cautious choice for an app used without a therapist: the window is lengthened earlier and shortened less often
From age 65Thresholds lowered by 5 points (80% and 75%). The Spielman et al. (2011) manual also lowers thresholds by 5 points for older adults (85% and 80%); the age of 65 is a design choice
Weekly adjustment rule Under 65: efficiency below 80%, the window shrinks by 15 minutes; from 80 to 85%, it is unchanged; 85% and above, it grows by 15 minutes. From age 65, the thresholds are 75% and 80%. Under 65 −15 min unchanged +15 min 65 and over −15 min unchanged +15 min 70% 75% 80% 85% 90% 95% 100% Weekly efficiency (sleep time ÷ time in bed)
Figure 2. Each week, the efficiency calculated over the logged nights decides the adjustment. The window never goes below the minimum length and never exceeds 9 h.

Example

During the observation week, a 50-year-old patient spends on average 8 h 30 min in bed and sleeps 5 h 50 min: her efficiency is 69%. Her initial window is 6 h (5 h 50 min rounded up to the next quarter hour). She chooses to get up at 6:45 am: she will go to bed at 12:45 am.

The following week, she sleeps 88% of her time in bed. The window grows by 15 minutes: bedtime at 12:30 am. If her efficiency had stayed between 80 and 85%, the window would not have changed.

The sleep window over the weeks Example. Observation: in bed from 10:15 pm to 6:45 am, efficiency 69%. Week 1: window from 12:45 am to 6:45 am, efficiency 88%, the window grows. Week 2: 12:30 am, 91%, it grows. Week 3: 12:15 am, 83%, unchanged. Week 4: 12:15 am, 87%, it grows. Week 5: midnight, 86%, it grows to 7 hours. 22:00 23:00 0:00 1:00 2:00 3:00 4:00 5:00 6:00 7:00 Fixed rise time 6:45 Efficiency, decision Observation 22:15 69% initial window 6:00 Week 1 0:45 88% ≥ 85%: +15 min Week 2 0:30 91% ≥ 85%: +15 min Week 3 0:15 83% 80-85%: unchanged Week 4 0:15 87% ≥ 85%: +15 min Week 5 0:00 86% ≥ 85%: +15 min
Figure 3. The same example over six weeks. The rise time does not move; only the bedtime moves earlier or later by a quarter of an hour. The window starts clearly shorter than the time spent in bed during observation, then grows as sleep fills the time in bed.

Precautions

Restriction causes transient daytime sleepiness, objectively measurable: in a small laboratory study, measured sleepiness was higher at weeks 1 to 3 of a 4-week restriction and back to baseline at 3 months (Kyle et al., 2014). Guidelines list sleepiness and its effect on driving among the safety points to monitor (Riemann et al., 2023; Edinger et al., 2021). A warning about driving and dangerous machinery is shown for every pathway with restriction, before the first window, and repeated at the first three weekly reviews. Each review also asks: “This week, did you fall asleep unintentionally during the day, or nearly do so?”. If yes, the window is not reduced that week (lengthening is still allowed) and the app advises talking to a doctor. Restriction is never offered in the situations listed in section 7.

5. Stimulus control and evening sleep habits

Stimulus control (Bootzin, 1972; CBT-i Coach) aims to re-associate the bed with sleep. In Sommelle, it relies on five elements:

The two evening landmarks and the habits are design choices, not established values. Here is what the open sources allow us to say.

6. Cognitive and relaxation exercises

Six short exercises (about five minutes each, plus a 4 s / 6 s paced breathing guide available from day one) unlock over the course of the program and remain available afterwards.

WeekExerciseWhat the patient doesTechnique
2Ideas about sleepSpots five common beliefs ("I need 8 hours", "I have to catch up in bed"…) and reads a more nuanced version of eachCognitive restructuring of dysfunctional beliefs (Morin)
2Putting your day to restEarly in the evening, writes down their concerns and the next small action for each, then puts the sheet awayWind-down time and "constructive worry" (Carney and Waters, 2006)
3Stop chasing sleepIn bed, calmly keeps their eyes open in the dark instead of trying to sleepParadoxical intention (Espie and Lindsay, 1985)
4Back to the most likelyAnswers four questions about what they fear for the next day and what actually happened the other timesDecatastrophizing
5Relaxing the bodyTenses then relaxes six muscle groups, in the eveningProgressive muscle relaxation (Jacobson)

7. Safety and referral

The entry questionnaire leads to one of three pathways: full program, program without restriction (stimulus control, cognitive exercises, education), or referral to a doctor without a program.

Reported situationWhat the app does
Loud snoring with observed breathing pauses, or marked daytime sleepinessNo restriction; advice to see a doctor (possible sleep apnea)
Bipolar disorder, epilepsyNo restriction; advice to talk to the treating doctor
Sleepwalking, night terrors or behaviours during sleepNo restriction; advice to talk to a doctor before considering a shorter time in bed
Depression or another mood disorder at presentNo restriction; advice to talk to a doctor before considering a shorter time in bed
Risk of falling, or a sleeping pill or sedative taken in the eveningNo restriction; advice to talk to a doctor before considering a shorter time in bed
Unstable condition, or one that lack of sleep can worsen (severe migraines, heart disease, poorly controlled chronic pain)No restriction; advice to talk to a doctor before considering a shorter time in bed
PregnancyNo restriction
Driving for work, dangerous machinery, safety-critical jobNo restriction by default; message: restriction can increase sleepiness, to discuss with a doctor
Very late schedule with normal sleep once asleepNo restriction; possible delayed sleep phase flagged and advice to see a doctor
Shift or night work, nights interrupted by someone else (infant, sick relative), under 18Outside the app's scope; referral
Distress expressedCrisis line highlighted (3114, the French suicide prevention line, always present in the app, with advice to contact a local crisis line elsewhere); path without time-in-bed restriction and invitation to see a doctor

In all these cases the sleep diary, stimulus control, tips and exercises remain available: only the reduction of time in bed is not offered. Answers are self-reported and are not a diagnosis.

8. Follow-up: before/after review and summary for the doctor

Before/after review

From week 6, the app compares the observation week with the last 7 nights: sleep onset latency, wake after sleep onset, total sleep time, efficiency and perceived quality. The change is written out in words: "Improving", "Stable" or "Declining".

A question about daytime impact (from 0 to 4) is asked at the start and end of the program. It is not a validated scale. The Insomnia Severity Index (ISI) would be the reference tool, but it is subject to a license and is not included at this time.

Summary for the doctor

The patient can show you a summary directly on screen, or send it to you:

These files are created on the phone and it is the patient who chooses to share them (messaging, printing…). Sommelle has no server and sends nothing by itself.

9. What Sommelle does not do, and points to validate

Gaps and limits

Several parameters are reasoned design choices rather than established values. We would like them to be reviewed by sleep professionals:

10. Sources

11. Code and formula auditability (file-by-file mapping)

Sommelle embeds no artificial intelligence: all protocol rules are purely deterministic, isolated in the core/protocol module with no Android dependency, and verified by automated unit tests on every build.

Clinical componentExact formula and thresholds in codeSource file and unit tests to audit
Versioned clinical parameters baselineDays = 7, minimumLoggedNightsPerWeek = 5, defaultMinimumWindow = 6h00, absoluteMinimumWindow = 6h00, maximumWindow = 9h00, increaseThreshold = 0.85, decreaseThreshold = 0.80, seniorThresholdOffset = 0.05. ProtocolConfig.kt
Diary metrics (TIB, TST, SE) TIB = outOfBed − inBed; TST = (finalWake − lightsOff) − SOL − WASO; weighted weekly sleep efficiency SE = ΣTST / ΣTIB. SleepMetrics.kt
SleepMetricsTest.kt
Sleep window & weekly adjustment Initial window = mean baseline TST rounded up to the next 15 min, clamped to [minWindow, 9h00]. Weekly adjustment (if ≥ 5 logged nights): +15 min if SE ≥ 85% (80% from age 65), −15 min if SE < 80% (75% from age 65), unchanged otherwise. SleepWindowCalculator.kt
SleepWindowCalculatorTest.kt
Safety screening & referral Deterministic decision tree excluding sleep restriction when sleep apnea, bipolar disorder, epilepsy, pregnancy or delayed sleep phase is suspected, and also excluding it for declared distress or safety-critical or driving occupations. ScreeningEvaluator.kt
ScreeningEvaluatorTest.kt
Diary consistency validation Checks chronological order (inBed ≤ lightsOff ≤ finalWake ≤ outOfBed) and wake durations without blocking the patient. DiaryValidator.kt
DiaryValidatorTest.kt
Progression & relapse prevention 6-week scheduling, before/after review, and maintenance guide for handling an isolated bad night versus a multi-week relapse. ProgramPlanner.kt
ProgramPlannerTest.kt

Your comments on the protocol, thresholds or wording are valuable, whether you are a sleep physician, a psychologist trained in CBT-I, a general practitioner or a pharmacist. Write to us at pilmil.studio@proton.me or open an issue on GitHub.