Inspiration

Taking a history is one of the first things medical students learn, and one of the hardest to practise. Actors are expensive. Classmates tell you everything the moment you ask "what's wrong?".

Real patients don't. Margaret, 71, will tell you she's "felt a bit hot and cold". Only when you ask whether she took her temperature do you hear: 38.6 °C last night.

Avelios asked for a virtual patient like that. We built one you can call.

What it does

VIP – Virtual Interview Patient is a patient on the other end of a voice call. You take the history, name your diagnosis, and get feedback.

  • 2 patients, 3 personalities each. Daniel Reyes (reflux) and Margaret Ellis (pneumonia). Pick a personality, tweak one, or get a random patient and find out why they came by asking. Five more cases (angina, pulmonary embolism, atrial fibrillation, migraine, panic disorder) are written and wait for their answer banks.
  • 29 facts, 3 red flags. Every fact has a vague and a full answer. Ask loosely, get the vague one. Ask precisely, get the full one.
    • "Do you smoke?" → "Not any more."
    • "Have you ever smoked?" → "I stopped twenty years ago. Before that about fifteen a day, for thirty years."
  • Every case hides one real worry, and it only comes out after a bit of empathy. "I don't want any fuss" becomes "Bill went into hospital with his chest and never came home."
  • She reacts to you. Interrupt her and she gets more upset; talk over her three times and she gets angry. With the optional camera on, she notices when you look away or turn away, and a nod calms her. Only head-pose numbers leave the browser, never video.
  • Feedback right after the call: a score out of 100, every fact you missed with the question that would have found it (red flags in red), how the patient felt along the way, and an optional AI coach that quotes your own words.

How we built it

1. Patient data

The medicine

Only openly licensed sources:

  • NHS.uk condition pages (Open Government Licence v3.0): symptoms, red flags, risk factors, how long attacks last.
  • GOV.UK (Open Government Licence v3.0): everyday rules patients worry about, like angina and driving.
  • DDXPlus (Mila, CC BY 4.0): synthetic patient profiles, for which symptoms go together and which are absent.
  • PriMock57 (Babylon Health, CC BY 4.0): recorded mock GP consultations. Real patient sentences, used word for word as speaking examples for the voices.
  • The Avelios challenge case.

Every case file lists its sources with links and licences, and the app shows them for each patient.

The person around it

On top of the medicine, each patient gets what makes them believable:

  • An everyday story: a job, a family, a normal reason to come in today, and times said the way people say them ("four days or so").
  • Lay words, three ways per fact: the truth (for scoring), a full answer and a vague answer. Plus the phrases that unlock it, a red-flag mark where it matters, and the symptoms the patient doesn't have.
  • Checked: a medical cross-check of every case, and a test that makes sure the real patient sentences never give away a case fact.

2. Personalities

  • Six HEXACO personality traits per persona (honesty, emotionality, extraversion, agreeableness, conscientiousness, openness), following the method of the paper Patients with Personality.
  • Plus humour, speaking style, language level and a voice.
  • Some bring things up unasked, some play them down: the chatty one mentions she's tired, the brave face "felt a bit warm" with a fever of 38.6 °C.
  • Kept separate from the medicine, so one case can be played by many different people.

3. Selective disclosure

  • A rule-based controller on our server checks every question and unlocks only the facts that were asked for. Follow-ups like "Since when?" are understood from the question before, and repeated questions are recognised.
  • The AI voice sees just those facts. The rest never leaves the server, not even to the browser.
  • The same rules drive the feedback, so the score counts exactly what the student found.

4. Two ways to talk

  • Live call: one WebRTC call to OpenAI's Realtime speech-to-speech model. Natural, fast, and you can interrupt by simply speaking. Our server listens in on a side channel, unlocks facts mid-call and books every reply's cost.
  • Turn by turn: we transcribe the question and look it up in a bank of approved answers (Qdrant with embeddings + BM25, safety checks, and a cross-encoder that would rather miss than guess). A match is spoken directly in the persona's voice; anything else goes to a small text model that only knows the unlocked facts. You can talk over her mid-sentence here too, and it works on networks that block WebRTC.

5. The rest

  • FastAPI backend, React + TypeScript frontend, works on a phone, dark Avelios-style look.
  • Feedback by rules (instant and free), plus an AI coach with a strict JSON schema.
  • A budget ledger that reserves every paid call before it happens, with a hard cap.
  • Deployed on our own server: every push to main is tested, packaged and deployed by GitHub Actions, with automatic rollback.
  • 400+ automated tests.
  • A bot that runs several spoken interviews at once, and a consistency check that replays our question bank to catch a patient leaking, missing or contradicting a fact.

Challenges we ran into

  • The AI wants to help. Give a model the whole case and it tells you everything in its first answer. So the AI no longer decides what to reveal; fixed rules do.
  • Two systems, two opinions. The answer bank said "a bit hot and cold" while the score credited the 38.6 °C fever. Now every bank answer is tagged with the fact it reveals, and the controller has the last word.
  • Fast without speech-to-speech. Turn by turn means three steps: transcribe, answer, speak. Each one adds delay, so a reply takes 3–5.5 seconds against about 2 in the live call, and every misheard word becomes a wrong question. Timing every step showed a whole second lost just closing a connection.
  • Interrupting a patient. Noise must not cut her off, real words must. We settled on loud-voice detection in turn by turn, and in the live call the controller lets her finish if it was only noise.
  • Works on my machine. The tests passed on the full repo, but the server package was missing the engine's code, so a deploy failed (and rolled back by itself). Now CI checks the exact package the server gets.

Accomplishments that we're proud of

  • 51 automated spoken turns, each unlocking exactly the facts it should.
  • Not one wrong answer from the bank on 103 trick questions (negations, wrong side, relatives, other drugs).
  • One illness, three personalities, identical medicine.
  • Cheap: a bank answer costs about $0.001, and a 17-question interview 6–9 cents.
  • Making it to the end, with both ways to talk running on our own server.

What we learned

  • Put rules around the AI where correctness matters. Let it do what it's good at: sounding human.
  • For a medical answer, "I don't know" is cheap and a wrong answer is expensive.
  • Measure step by step. The slow parts weren't where we guessed.

What's next for Avelios Penguins

  • Replies in under a second: live transcription and pre-recorded bank audio.
  • More cases, reviewed by doctors and educators, and scoring against real OSCE checklists.
  • German, then other languages.

Built With

Share this project:

Updates

Submission history