How rishabhdev0/medlife works
Medkit is a browser-based clinical training simulator. A trainee selects an ER case or polyclinic patient, conducts an encounter by voice or text, examines the patient, orders tests and treatment, and completes disposition; an attending agent then grades the session and presents a debrief. The graph covers both documented care modes, the shared state and clinical data layer, and the voice and grading integrations. Some backend and UI relationships are documented in the README rather than shown in source excerpts; those links cite the README.
Main entry points: store.ts Session state · EncounterScreen.tsx Encounter screen · App.tsx Screen router · ExamineOverlay.tsx Examination tools
Components 22
Training experience
- Screen router
src/App.tsx - Case selection
src/components/CaseLibraryScreen.tsx - Encounter screen
src/components/EncounterScreen.tsx - Examination tools
src/components/ExamineOverlay.tsx - Debrief screen
src/components/DebriefScreen.tsx
Clinical simulation
- Session state
src/game/store.ts - Patient case catalogs
src/data/polyclinicPatients.ts - Tests and guidelines
src/data/tests.ts - Clinic specialties
src/game/clinic.ts - 3D clinic scene
src/components/three/Polyclinic.tsx
Patient voice
- Conversation manager
src/voice/conversationStore.ts - Patient persona
src/voice/patientPersona.ts - Voice conversation
src/voice/conversation.ts - Voice worker
backend/voice_agent.py - LiveKit Cloud
- Speech services
Assessment
- Debrief request builder
src/agents/debriefRequest.ts - Attending agent hook
src/agents/useAttendingDebrief.ts - Managed agent client
src/agents/managedAgent.ts - FastAPI proxy
backend/server.py - Claude attending grader
Other components
- Trainee doctor
Connections 25
- Trainee doctor → Screen router: uses
- Screen router → Case selection: routes to
src/App.tsx - Screen router → Encounter screen: routes to
src/App.tsx - Screen router → Debrief screen: routes to
src/App.tsx - Case selection → Session state: selects case
src/components/CaseLibraryScreen.tsx - Encounter screen → Session state: reads session
src/components/EncounterScreen.tsx - Encounter screen → 3D clinic scene: renders
src/components/EncounterScreen.tsx - Encounter screen → Examination tools: renders
src/components/EncounterScreen.tsx - Examination tools → Session state: updates session
src/components/ExamineOverlay.tsx - Session state → Patient case catalogs: loads cases
src/game/store.ts - Session state → Clinic specialties: uses specialties
src/game/store.ts - Examination tools → Tests and guidelines: reads tests
src/components/ExamineOverlay.tsx - 3D clinic scene → Session state: reads clinic state
src/components/three/Polyclinic.tsx - Encounter screen → Conversation manager: manages patient voice
src/components/EncounterScreen.tsx - Conversation manager → Patient persona: builds persona
src/voice/conversationStore.ts - Conversation manager → Voice conversation: creates conversation
src/voice/conversationStore.ts - Voice conversation → LiveKit Cloud: connects room
src/voice/conversation.ts - LiveKit Cloud → Voice worker: transports audio
- Voice worker → Speech services: uses STT and TTS
- Debrief screen → Debrief request builder: builds evaluation request
src/components/DebriefScreen.tsx - Debrief screen → Attending agent hook: starts grading
src/components/DebriefScreen.tsx - Attending agent hook → Managed agent client: streams agent session
src/agents/useAttendingDebrief.ts - Managed agent client → FastAPI proxy: calls proxy
- FastAPI proxy → Claude attending grader: proxies grading
- Claude attending grader → Attending agent hook: returns evaluation