PatientSim | Avelios Challenge
Inspiration
Medical students practice history-taking with trained actors, but those sessions take time to organize and can be hard to repeat. When you only get a few tries, it’s easy to spend the first one worrying about getting it right. We wanted a patient you could practice with at 11 p.m., as often as you like, with no one watching.
What it does
PatientSim lets medical students take a history by speaking with a simulated patient in a live consultation. Each patient has a medical background, a life story, and a distinct way of responding. The same clinical presentation can feel very different depending on whether the patient is anxious, guarded, or quick to dismiss their symptoms.
Patients speak in everyday language. They volunteer some details, while others emerge through a specific follow-up question or after the student builds trust. Students can also practice in text mode.
After the interview, students see which symptoms and history topics they explored, with links to the relevant moments in the transcript. An empathy score explains what they did well and gives one concrete improvement when there’s room for it. The score reflects how the student responds to the patient’s concerns, even if the patient remains upset.
How we built it
We built the frontend with React and TypeScript and the backend with Python and FastAPI. OpenAI GPT-Live powers the voice conversation over WebRTC. The text mode tags facts as patients disclose or brush them off. For voice interviews, we identify those facts from the transcript during review. Both modes feed the same checklist.
Each case is stored as validated JSON with medical facts, disclosure rules, personality, emotional triggers, and the patient’s own ideas, concerns, and expectations. A shared Jinja template turns each case into patient instructions.
We also built a case creator using Synthea. It generates a synthetic medical history, and a language model builds a patient and interview scenario around it. The case can be reviewed and edited before it’s saved. The generator currently supports appendicitis, type 2 diabetes, and osteoarthritis.
Challenges we ran into
Keeping the patient consistent was harder than making them talk. Patient replies sometimes gave away clues too early or introduced symptoms outside the case. We added explicit disclosure rules so the same fact could be volunteered, shared when asked directly, or held back until the patient felt comfortable.
Live voice introduced another challenge. Transcripts arrive in fragments, and feedback needs to link a finding to the exact exchange that supports it. We had to balance that accuracy with the pace of a natural conversation.
Accomplishments we’re proud of
We built the full practice loop from creating a synthetic case to reviewing a completed voice interview. Students can repeat the same clinical presentation with different patient personalities and practice adapting their approach. The feedback points them back to what they said and what the patient disclosed, giving them something concrete to work on next time.
What we learned
A believable patient is partly defined by what they hold back. Selective disclosure, everyday language, and small personality details made the consultation feel more realistic. We also learned that a patient’s mood adds realism, while the student’s actual words provide better evidence for coaching.
What’s next for PatientSim
We’d like to expand the case library across specialties and include difficult conversations such as breaking bad news. We also want to test the feedback with students and clinical educators, and explore self-hosting with open-source models for institutions that need to run PatientSim on their own infrastructure.
Built with
React · TypeScript · Vite · Tailwind CSS · Python · FastAPI · Pydantic · Jinja · OpenAI GPT-Live · WebRTC · Synthea · Java