Inspiration
Medical students practice interviews with paid actors, so each gets only a few slots. Avelios's challenge asked for a virtual patient to fill that gap. We also wanted feedback a student can check, starting with psychiatry.
What it does
A student picks a case and a difficulty, reads a short door note, and holds a 15-minute interview with a live AI patient. The patient speaks only from its case, and a locked fact such as passive suicidal thoughts stays back until the student asks about it directly. Then the student fills in a psychiatric assessment, the record: history, mental state examination, risk assessment, an ICD-10 checklist, formulation, diagnosis and plan.
Two grades come back from A to E. Each criterion gets a level from 1 to 5, and the weighted mean of the domains sets the grade.
The interview grade covers seven domains:
- Risk and safety (25%): asking directly about suicide after a risk cue, exploring plans, intent, and what keeps the patient safe, and agreeing on a safety plan.
- Listening and questioning (20%): open questions, reflections, and using the patient's own words.
- Responding to cues (20%): answering emotional cues with specific empathic statements instead of stock phrases.
- Opening (15%): greeting, privacy on a video call, setting the agenda, signposting, summarising, and closing with safety-netting.
- Case tasks and explaining (10%): what this case expects, explained in plain language.
- Non-verbal behavior (6%): gaze toward the patient, a facial expression that fits the moment, nods, and framing on camera.
- Voice and turn-taking (4%): pace, silence after a disclosure, interruptions and volume, each compared with the student's own baseline.
Each finding links to the moment in the recording that supports it. We report behavior, never emotions.
The record grade covers three domains:
- Psychiatric assessment (30%): the ICD-10 symptoms, duration, and code match what the patient said, and the risk assessment records thoughts, plans, past attempts, protective factors, and an overall rating.
- Clinical reasoning (35%, from R-IDEA): a short summary in clinical terms, a lead diagnosis backed by findings and linked to the criteria, and at least two ranked alternatives with what would help decide.
- Documentation quality (35%, from PDQI-9): accurate, thorough, organized, clear and brief, with a plan that covers every problem, a safety plan and follow-up, a formulation that links the factors, and no section contradicting another.
The record view lists each fact the student missed and whether they asked about it.
How we built it
The patient runs on LiveKit, with ElevenLabs for speech and Claude Haiku 5.5 for replies. Each case is a knowledge graph. TypeSafe's Jev decision model labels every student turn, and a controller determines what the patient may say and how open the patient is. The patient's face is a photo that shifts with that openness.
Grading runs on the student's own recording. Speech recognition, Praat, and MediaPipe turn it into numbered events like pauses, smiles, and nods. The judge, Claude Sonnet, answers yes/no checks with quotes. Code verifies every citation, then computes levels and grades by fixed rules. The app is Next.js, FastAPI and Postgres.
Challenges we ran into
- Replies took about 3.6 s to reach the student initially. We cut that to about 1 s!
- Judge runs disagreed on whether a turn held two questions, so code counts them now.
- With no expert ratings available, we tested on scripted sessions and public datasets.
Accomplishments that we're proud of
- All 55 planted behaviors found in 13 scripted synthetic sessions, with no false alarms.
- In a blind audit, 96% of cited evidence supported its finding. 97% of levels stayed identical across five reruns.
- On expert-coded counseling transcripts, our levels separate high- from low-quality sessions (AUC 0.93).
- A judge model ranked our easy, normal, and hard patients correctly in 14 of 14 blind rankings.
What we learned
Models are steadier on small yes/no checks than on counting, so code does the counting and the arithmetic. Recorded GPs also spoke faster than our pace limit, so we now compare each student only with their own baseline.
What's next for Trainr
- Have an expert panel of three raters rate about 50 sessions, so we can measure agreement with experts.
- Test on real student webcams and check for bias by gender, accent, skin tone and glasses.
- Make the alcohol, panic and psychosis cases playable, and review privacy before real students use it.
Built With
- amazon-web-services
- claude
- docker
- elevenlabs
- livekit
- nextjs
- openai
- opencode
- python
- shadcn
- tailwind
- typesafe-ai
- typescript