A hybrid system of rules and an LLM that turns multimodal health data into a simple, reliable weekly note
Every Monday, a review of the week for each patient: rules decide the content, a language model writes it.
Every Monday, the EmoDTx app looks back at the patient’s week and writes them a short note: what changed in mood, activity or routine, in plain sentences. The material is multimodal: a mood estimated from the voice or the face, steps, movements, the answers to a questionnaire. Writing this note by hand for each patient is impossible. Handing it as it is to a language model would be reckless: the person reading it is being treated for depression.
Asking a model for text takes one line of code, but the real work lies in everything around it: deciding what is worth saying without a model, never providing data that identifies the patient, proofreading every sentence, ensuring a note is always generated even when the model is down, never sending the same note twice or repeating information from one Monday to the next, and respecting a predefined cost limit.
As a co-founder of Emobot, I built this chain with the team: a hybrid system, in which rules decide and the model only writes.
The result
What was done
01
Finding
Rules that decide, with no model, what is notable about the week against the patient’s usual, in a way that can be replayed exactly.
Python · NumPy
02
Anonymous sheet
Summary of the week in a few numbers, the only content handed to the model: nothing in it points to the patient.
Python · Pydantic
03
Writing
Note written in an imposed format by a fast model, backed by a more powerful one, then by a fixed text: there is always a note.
Claude · Amazon Bedrock
04
Proofreading
Automatic check of the length, language and vocabulary of every note, with no model, before anything is sent.
Python
05
Cost
Spending ceilings per call, per day and per month: beyond them, the fixed text takes over.
Python
06
Sending once
Fingerprint of each note’s data, so a week can be run again with nothing rewritten or sent again.
Python · MySQL
07
Quality monitoring
Every fallback note and a sample of the accepted ones reread by the team, personal data masked, with alerts when quality drops.
Amazon CloudWatch
08
Versions
Versioned instructions, never changed in place: each note keeps track of the version that wrote it.
MySQL
09
Tests
Reference weeks replayed with every change: the same finding must come out, exactly.
pytest
10
In the app
Monday note, those of past weeks, and a waiting card while the week is not ready.
React Native · TypeScript
How it works
Scroll: the drawing follows.
01 / 06
Check what the week allows saying
A week of raw measurements does not read by itself: we first check what was actually measured, signal by signal. A signal covered too little is set aside: nothing will be said about it. If nothing is sound enough, the patient receives a neutral message, and the model is not even called.
02 / 06
Choose what to say, with no AI
What the note will say is decided by code, not by the model. We compare the week with the patient’s usual, computed with statistics that one exceptional day does not distort. Rules then look for a clear change, a trend over several weeks, a rhythm that repeats, a harder week or a steady one, and a fixed order settles between them. The same computation, replayed later, gives exactly the same finding.
03 / 06
Give the model only what it needs
We pass to the model only a sheet of a few numbers: deviations, days of the week, a direction of change. No name, identifier, date or raw measurement is sent. The patient’s first name appears only on the phone, in the greeting of the home screen: the note itself holds none.
04 / 06
Have it write, with a safety net
A fast model writes the note, in an imposed format: three fields, nothing else. If it fails or runs late, a more powerful model takes over. If that one fails too, or if the spending ceiling is reached, we use a fixed text. The patient always receives a note, and the bill never goes beyond what was planned.
05 / 06
Proofread every sentence before sending
We proofread every note automatically, with no model: length of each field, patient’s language, then lists of forbidden words, starting with those that touch on distress. A refused note is handed to the next model, then replaced by the fixed text. The safety instructions given to the model are written by clinicians, apart from the instructions on tone, and the note never takes the place of the questionnaire’s alert.
06 / 06
Never repeat, never send twice
Every note carries the fingerprint of the data that produced it. If the jobs run again over a week already done, the same fingerprint comes out: nothing is recomputed, rewritten or sent again, and the notification leaves only once. A finding made one week then serves as the basis for the following weeks, so the note does not repeat the same thing Monday after Monday.
Specifications
- Role
- Co-founder and chief product officer; design and development, with Emobot’s team
- Built with
- Python · Claude · Amazon Bedrock · React Native