---- MediSim AI: The 24/7 Intelligent Triage Nurse --Inspiration -The global healthcare system is under immense pressure. Emergency rooms are overcrowded, and wait times for simple medical advice can stretch for hours. On the other hand, "Dr. Google" often terrifies patients by suggesting that a mild headache is a terminal illness.

-We wanted to build a bridge: an intelligent, empathetic, and voice-active interface that feels like talking to a real nurse. MediSim AI was born from the desire to make professional-grade medical triage accessible to anyone, anywhere, instantly—without the panic of web searches or the wait times of a clinic.

--What it does --MediSim is a voice-first AI application

-Voice Interface: The user clicks "Start Call" and speaks naturally to the nurse (e.g., "My chest hurts and my left arm is numb").

-Real-time Processing: The voice is captured and transcribed by ElevenLabs Conversational AI.

-Medical Analysis: The transcript is sent to our Python backend, where Google Gemini (Flash Model) acts as the medical brain.

-Risk Assessment: Gemini analyzes the symptoms against medical protocols to determine a risk level ($High$, $Medium$, or $Low$).Empathetic Response: The AI generates a comforting, accurate response and speaks it back to the user with a human-like voice.

--How we built it -We built MediSim using a modern, multi-modal tech stack: Frontend: A custom HTML/CSS interface designed with a "Glassmorphism" aesthetic for a clean, medical look. We used the ElevenLabs Conversational AI Widget for low-latency voice streaming.

-The Brain (AI): We utilized Google Gemini 2.0 Flash, chosen for its incredible speed. We engineered a specific system prompt that forces the LLM to act as a Triage Nurse, outputting structured JSON data for risk classification. -The Logic: Risk = f(symptoms, \text{severity}, \text{duration})

-Backend: A robust Python Flask server hosted on Replit.

-Deployment: We deployed the application using Gunicorn on Replit's cloud infrastructure to ensure 24/7 availability.

-Challenges we ran into The road to a working demo was not smooth!

-The "Sleep" Cycle: Our biggest hurdle was the backend server "going to sleep" during idle times, causing the API to fail. We had to implement a custom Gunicorn configuration and a "Lazy Loading" strategy for the AI models to pass the strict health-check timeouts (1 second limit!) required for deployment.

-Widget Integration: Integrating the ElevenLabs widget into a custom dark-mode UI caused several CSS conflicts where the button would disappear or the chat window would get cut off. We had to reverse-engineer the container styling to make it responsive.

-Latency: Real-time conversation requires milliseconds of latency. We optimized our Python code to remove all blocking startup processes, ensuring the Gemini API is called only when a user speaks.

-Accomplishments that we're proud of -Latency Optimization: We achieved a near-instant response time by using the gemini-flash -model and optimizing the server startup to pass strict health checks.

-Seamless Voice UI: The transition from speaking to hearing the response feels natural, not robotic.

-Resilience: We built a self-healing backend that can recover from crashes and handle "cold starts" without the user noticing.

-What's next for MediSim Multilingual Support: Using Gemini's translation capabilities to offer triage in 40+ languages.

-Geo-Location: Integrating Google Maps API to direct high-risk patients to the nearest open hospital immediately.

-Vision Support: Allowing users to upload photos of visible symptoms (rashes, wounds) for Gemini Vision to analyze alongside the voice data.

Built With

Share this project:

Updates