Inspiration
Every doctor learns to take a history by talking to patients, and medical schools rehearse it with simulated-patient actors. They're brilliant, but paid by the hour and hard to book, so every slot counts and students arrive nervous. Germany alone has about 113,000 medical students. Most get only a handful of tries before an exam, always with someone watching, and the rest of the practice happens on real patients.
We wanted the patient you practise on first: whenever, a different person every time, as hard to read as a real patient, and afterwards as honest as a good tutor, without any other trained person in the room.
What it does
Patience generates a new GP patient on request: fully random, or with the illness, age, gender, personality or the part of the history you want to practise fixed. The patient appears on a video call with a photorealistic face, lip-synced live, and a natural voice that fits their age and personality. You talk; the reply starts in well under a second, in lay language, with the hesitations of real patients.
The patient behaves like one. Facts only come out when you ask the right way. Jargon gets "sorry, what does that mean?" A wrong fact gets corrected, never agreed to. A "Where it hurts" body map beside the face lights up when they describe pain: "my back" glows dimly, and only when you ask "where exactly?" does it narrow to the precise spot, with spreading pain drawn as a path. Everyone has a hidden worry that only comes out if you explore it, or at the door ("Oh, while I'm here…"). Be rude and they warn you once, then walk out.
In chart mode the GP record is open beside you, and like a real record it can be wrong: a repeat prescription the patient quietly stopped months ago, which you only uncover by asking. You write consultation notes as you go.
The debrief anchors every important moment to your exact words, says why it mattered and what to say instead, and replays it with both voices. It checks the history you took (safety-critical items first), grades your notes against the case (captured, missed, wrong, unsupported), shows whether you found the real worry and checked the record, and lists guideline-linked next steps. Camera and voice are analysed only on your laptop, for coaching, never grading. A progress dashboard finds your weak spots, and "Practise this" generates a patient that tests exactly that.
How we built it
A React + TypeScript frontend talks to OpenAI's Realtime speech-to-speech model over WebRTC; a FastAPI backend mints short-lived tokens, so the key never reaches the browser. Patients come from a medical knowledge base we wrote from NICE guidance: 12 GP illnesses with symptoms, red flags, history checklists and sources, plus a linked background (conditions → medicines → results → lifestyle). The generator samples the facts, an LLM only writes the person and the wording, and a validator rejects anything that wasn't sampled. Each fact carries a disclosure rule and a lay answer. The patient's speaking style is grounded in statistics from 57 real recorded GP consultations (PriMock57).
The face: 8 fictional portraits generated with gpt-image-1.5, matched to the speaker's sex, age and skin tone, animated live by MuseTalk v1.5 on a local laptop GPU at 25 fps. We delay the patient's voice by 0.47 s so lips and sound match. The body map is deterministic: 72 clinical regions, lay-language matching, no LLM, limited to the regions the illness can involve. A turn judge tracks patience, mood and trust; a gpt-4.1 coach plus deterministic checks build the debrief. MediaPipe and Web Audio read gaze, expression and tone on the student's machine.
We tested it like a product: a voice-pipeline bake-off, behaviour probes on the real voice model, 600+ automated tests, and 60 full consultations with AI students at five skill levels, from excellent to rude.
Challenges we ran into
Turn-taking. Speech-to-text invents sentences from room noise and the patient politely answered them; a "mm" cut the patient off mid-sentence. We moved every turn decision into the browser, and then had to win the speed back: a reply now starts the moment you stop, and is cancelled if what you said turns out to be noise.
Consistency over a long conversation, which is why facts are fixed before the consultation starts. Lip sync on a laptop GPU in real time. And a $30 API budget for the whole weekend: every call goes through a ledger with a hard stop.
Accomplishments that we're proud of
0.8 real consistency errors per 100 patient replies across 60 simulated consultations, checked by hand. Rude students were walked out on 12 times out of 12, always after one warning. Scores rank student skill correctly, from 78 for excellent to 29 for rude. Realism measured against real recorded consultations went from 32 to 41 out of 100. The same illness in a different personality is a genuinely different consultation. And it's a full learning loop: generate, consult, debrief, practise your weak spot.
What we learned
Realism lives in small things: short answers, "um"s, a patient who corrects you without apologising, pain you only locate if you ask. Feedback is only useful if it's fair: what you said, wrote and read off the record have to count together. Measure everything, then put a human with a headset on it.
What's next for Patience
Clinician review of the knowledge base comes first. Then the same engine with a bigger knowledge base: OSCE exam stations with a timer and mark scheme, then interns and residents (ward and on-call cases, handover, breaking bad news), then emergency and surgery (vitals that change over time, consent, pre-op history). Teachers can lock attributes or write their own cases. Medical schools and teaching hospitals pay per student; a consultation with debrief costs about $0.35 to run.
And because the GP record and the consultation notes are hospital-record workflows, Patience can train staff inside a hospital's own record system: practise on the record you'll use on Monday.
Built With
- fast-api
- openai
- python
- react
- typescript
- vite