MedGuard: AI Health Concierge for Safer Medication Management
Inspiration
In Canada, 1 in 9 emergency hospital visits are caused by adverse drug reactions. The scary part? Most of these start as small symptoms at home, like dizziness after a new prescription or nausea that seems "normal," that patients dismiss until it's too late.
By the time a doctor hears about it at the next scheduled appointment, weeks have passed and a simple dosage adjustment has become an ER visit.
We built MedGuard to close that gap. What if an AI could sit between the patient and the doctor, monitoring symptoms 24/7, cross-referencing medications in real time, and automatically escalating to a physician when something looks wrong?
What It Does
MedGuard is a dual-sided AI health concierge that connects patients and doctors through intelligent symptom monitoring.
For Patients:
- Chat with an AI health assistant to report symptoms naturally ("I feel dizzy when I stand up")
- The AI scores symptom severity (1 to 10) while cross-referencing the patient's active medications for potential side effects and drug interactions
- A dynamic Risk Score dashboard updates after every check-in
- If severity hits 7 or higher, a clinical report is automatically generated and sent to their doctor, no appointment needed
For Doctors:
- A real-time dashboard shows all patients with live risk scores
- High-risk patients are flagged with alerts the moment a report is generated
- Full clinical summaries include symptom rationale, linked medications, and suggested follow-ups
- Patient data polls every 10 seconds, so doctors always see the latest without refreshing
The key differentiator: MedGuard doesn't wait for the next appointment. It turns healthcare from reactive to proactive.
How We Built It
Backend: Python, FastAPI, SQLite, and Uvicorn, exposing a RESTful API with SSE streaming for real-time chat responses
Frontend: React and Vite, styled with Tailwind CSS and shadcn/ui, with separate Patient Portal and Doctor Portal dashboards
AI Engine: Google Gemini API (gemini-3.1-flash-lite), powering the conversational health assistant with tool-calling for symptom assessment and report generation
MCP Integration: PharmacyMCP (Model Context Protocol), a local MCP server that provides real-time drug data including side effects, dosages, and interaction profiles. The AI agent queries PharmacyMCP during every symptom assessment to cross-reference patient medications.
Key Technical Details:
- Agentic AI loop where Gemini calls
assess_symptomsandgenerate_doctor_reportas tools, deciding autonomously when to escalate - Keyword severity floors as a clinical safety net, so vomiting always scores 8 or higher regardless of what the AI model returns
- Risk scores persist in SQLite and only increase (never overwritten by a lower score) until a doctor clears them
- Session-based auth with hashed passwords and chat history persistence across sessions
Challenges We Ran Into
Getting AI severity scoring right. Early on, Gemini rated "I threw up" as 2/10. For a health app, underscoring a serious symptom is dangerous. We solved this with a dual-layer approach: clinical guidelines in the AI prompt plus keyword-based minimum severity floors as a safety net.
Bridging two user experiences. The patient needs simplicity and reassurance. The doctor needs density and clinical precision. Designing one system that serves both required careful thought about what information goes where.
Real-time data flow. Making sure a patient's symptom report instantly appears on a doctor's dashboard, complete with correct risk badges, report links, and medication context, required careful orchestration between the AI agent, SQLite persistence, and frontend polling.
Accomplishments We're Proud Of
- A fully functional end-to-end flow: patient reports symptom, AI scores and triages it, report auto-generates, and the doctor sees it in real time
- PharmacyMCP integration that gives the AI actual drug knowledge, not just general medical training data
- A clinical safety layer that prevents the AI from underscoring serious symptoms, because in healthcare, false negatives are worse than false positives
- Clean, intuitive UI on both sides that makes complex health data immediately understandable
What We Learned
Building AI for healthcare is fundamentally different from building AI for other domains. Accuracy isn't optional. A chatbot that underrates chest pain isn't just a bad UX, it's a safety risk. This pushed us to think about AI guardrails, severity floors, and fail-safes in ways we hadn't before.
We also learned that the hardest part of a health AI isn't the AI itself, it's the information design. Deciding how to present risk scores, when to alert versus reassure, and how to make a clinical report useful to both a patient and a doctor.
What's Next for MedGuard
- EHR integration to connect with electronic health record systems so the AI has full patient history, not just self-reported data
- Wearable data ingestion including heart rate, blood pressure, and sleep data from Apple Health and Fitbit to add objective signals alongside subjective symptom reports
- Multi-language support, critical for serving Canada's diverse population
- Doctor-to-patient messaging so doctors can respond to reports directly through the platform, closing the communication loop entirely
Built With
Python · FastAPI · SQLite · Google Gemini AI · PharmacyMCP (Model Context Protocol) · React · Vite · Tailwind CSS · shadcn/ui · SSE Streaming · Uvicorn


Log in or sign up for Devpost to join the conversation.