Project Info
Inspiration
Healthcare conversations often happen at the most vulnerable moments in a patient's life. Post surgery recovery calls, medication follow ups, or mental health check ins are charged with anxiety. In those moments, critical signals get lost. A patient might casually mention chest discomfort that is actually ischemic pain. A caregiver might describe confusion that could indicate neurological decline. A provider may overlook a potential adverse event that legally must be reported within 24 hours. We asked ourselves a simple question: "What if AI could act as a real time clinical co listener, surfacing high risk signals while the conversation is happening?" MedCall is born from the idea that AI should not replace clinicians but augment their vigilance when cognitive load is highest.
What it does
MedCall is a real time AI powered patient call monitoring system. It listens to live clinical conversations, transcribes them, and runs four specialized agents in parallel: Emergency Detection Agent\ Identifies high acuity phrases such as chest pain, sudden weakness, slurred speech, or respiratory distress.\ If detected, the system recommends immediate escalation such as calling emergency services. Adverse Event Detection Agent\ Extracts and flags potential adverse drug events in compliance with pharmacovigilance requirements.\ Ensures time sensitive AE reporting within the regulatory 24 hour window. Appointment and Adherence Agent\ Detects missed medications, scheduling conflicts, or follow up non compliance and suggests actionable next steps. The result is structured, actionable intelligence generated from unstructured conversation.
How we built it
MedCall is a full stack system built with React and Flask. Audio Pipeline: The browser captures microphone input using the MediaRecorder API. Audio is chunked into 3 second windows and streamed to the backend via WebSockets using Socket.IO. Transcription Layer: Each audio chunk is transcribed using the OpenAI Whisper API. This produces near real time text transcripts. Parallel Agent Architecture: The transcript is dispatched to four concurrent AI agents powered by OpenAI GPT models. Each agent operates independently on the same transcript segment, allowing specialized reasoning per task. Conceptually, for a transcript segment (T), we compute: [ A_i = f_i(T), \quad i \in {\text{emergency}, \text{AE}, \text{scheduling}} ] where each (f_i) represents a domain specific reasoning function implemented via structured prompting. Real Time Feedback: Results are streamed back to the frontend over WebSockets, enabling immediate clinician facing alerts and structured summaries. The backend uses Flask for REST endpoints, Flask SocketIO for bidirectional streaming, Eventlet for concurrency, python threading for parallel agent execution. All configuration is managed securely using environment variables.
Challenges we ran into
Speech Emotion Recognition Limitations\ We explored SER models to detect vocal stress markers such as tremor or stutter. However, production ready APIs with reliable clinical accuracy were limited. Integrating emotion recognition in a medically meaningful way remains a challenge. Latency vs. Safety Tradeoff\ We optimized chunk size to balance responsiveness and transcription accuracy. Smaller chunks reduce latency but increase context fragmentation. Regulatory Sensitivity\ Adverse event detection must prioritize recall without overwhelming clinicians with false positives. Designing prompts that balance sensitivity and precision required iterative refinement. Resource Constraints\ Advanced features such as automatic emergency dialing or direct AE submission to pharmaceutical safety portals require deeper integration and compliance review.
Accomplishments we're proud of
Successfully built a real time, multi agent clinical monitoring system within hackathon constraints Designed a parallel AI architecture instead of a single monolithic model Integrated live transcription with concurrent reasoning pipelines Addressed a real pharmacovigilance compliance use case rather than a generic chatbot scenario Created a system that feels clinically aware, not just conversational
What we learned
How to architect real time AI pipelines using streaming audio and WebSockets Practical integration of Whisper for incremental transcription Prompt engineering for domain constrained reasoning The operational realities of adverse event reporting in healthcare The limitations and promise of speech emotion recognition systems We also learned that building AI for healthcare requires thinking about safety, latency, compliance, and human trust simultaneously.
What's next
Integrate a clinically validated speech emotion recognition model Add structured adverse event auto reporting workflows Develop clinician configurable alert thresholds Deploy to a secure HIPAA compliant cloud environment Explore reinforcement learning for adaptive agent sensitivity Long term, MedCall aims to become an AI clinical co pilot that ensures no critical signal in patient communication is ever missed again.
MedCall - AI-Powered Post-Surgery Call Monitoring π₯
MedCall is a clinical AI system that monitors post-surgery patient phone calls in real-time using parallel AI agents. Built for TreeHacks 2026, it detects adverse events, scheduling conflicts, emergencies, and hidden danger signals through audio-sentiment mismatch analysis.
π― The Problem
After surgery, patients call with symptoms and concerns. Nurses manually take notes during these calls, and critical information gets lost, delayed, or misunderstood:
- π΄ Infection symptoms dismissed as "normal healing"
- π΄ Severe pain (8/10) documented but urgency missed
- π΄ Medication side effects buried in 10-minute conversations
- π΄ Scheduling conflicts delay critical follow-ups
Result: Preventable ER visits, complications, and poor patient outcomes.
π‘ The Solution
MedCall AI analyzes post-surgery calls in real-time with 4 specialized clinical agents running in parallel:
1οΈβ£ Adverse Event (AE) Detector β οΈ
Identifies post-surgery complications with medical precision:
- Infection symptoms: Fever >100.4Β°F, redness, drainage, swelling
- Severe pain: Pain level 7+/10, sudden pain increase
- Medication issues: Side effects, allergic reactions, non-response
- Bleeding/circulation: Excessive bleeding, DVT risk
- Respiratory/cardiac: Breathing difficulty, chest pain
Clinical accuracy: Detects pain levels, days post-surgery, specific symptoms
2οΈβ£ Emergency Detector π¨
Triages sudden health concerns requiring immediate action:
- CRITICAL: PE risk, stroke symptoms, severe bleeding β Call 911
- URGENT: High fever, wound dehiscence, uncontrolled pain β Contact surgeon within 1 hour
- MODERATE: Low-grade fever, mild drainage β Contact doctor within 24 hours
Time-sensitive escalation based on complication type and severity
3οΈβ£ Appointment Agent π
Manages post-surgery follow-up scheduling:
- Missed wound checks, PT sessions, suture removal
- Scheduling conflicts affecting recovery timeline
- Urgent rescheduling due to complications
- Follow-up needs (specialist referrals, additional visits)
Tracks clinical impact on patient recovery
4οΈβ£ Sentiment Mismatch Analyzer π (Ambitious Feature)
Detects hidden danger through audio-content discrepancies:
- Coercion/abuse: Patient minimizing pain under pressure
- Hidden complications: Says "fine" but describes concerning symptoms
- Mental health crisis: Depression/suicidal ideation masked
- Access barriers: Can't afford care but claiming recovery is good
Identifies patterns: Coached responses, third-party influence, financial barriers
π How It Works
Parallel AI Architecture
Microphone β Audio Capture β Whisper Transcription
β
ββββββββββββββ΄βββββββββββββββ
β Parallel Processing β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌβββββββββββββββ
β β β β β
AE Detector Appointment Emergency Sentiment Clinical
(Infections, (Missed (Critical (Hidden Note Gen
Pain 7+/10, Follow-ups, PE/DVT, Distress, (Future)
Med Issues) Scheduling) Sepsis) Coercion)
β β β β β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄βββββββββββββββ
β
Real-time Alerts + Live Transcript
All 4 agents run simultaneously - no blocking, instant analysis.
π Key Features
β Clinical Precision
- Detects pain levels (0-10 scale)
- Tracks days post-surgery
- Identifies specific complication types (PE, DVT, infection, dehiscence)
β Real-Time Processing
- Live audio transcription with OpenAI Whisper
- Parallel agent execution (Python threading)
- WebSocket updates to dashboard
β Structured Clinical Output
- Severity classification (mild/moderate/severe)
- Urgency levels (immediate/1hr/24hr)
- Actionable recommendations (Call 911, Contact surgeon, Schedule follow-up)
β Comprehensive Monitoring
- Post-surgery adverse events
- Missed appointments affecting recovery
- Life-threatening emergencies
- Hidden danger signals (coercion, mental health, access barriers)
π οΈ Tech Stack
Backend
- Python 3.8+ with Flask
- OpenAI API (GPT-4 + Whisper)
- Flask-SocketIO for real-time communication
- Threading for parallel agent execution
Frontend
- React 18
- Socket.io Client for WebSocket
- Web Audio API for microphone
- Responsive design
π¦ Quick Start
Prerequisites
- Python 3.8+
- Node.js 16+
- OpenAI API key
1οΈβ£ Run Setup Script (Windows)
.\setup.ps1
2οΈβ£ Add Your OpenAI API Key
Edit backend/.env:
OPENAI_API_KEY=your-actual-api-key-here
3οΈβ£ Start Backend
cd backend
.\venv\Scripts\Activate.ps1
python app.py
4οΈβ£ Start Frontend (New Terminal)
cd frontend
npm start
Access at: http://localhost:3000
π§ͺ Testing with Clinical Scenarios
Test 1: Post-Surgery Infection
Say: "I had my appendectomy 3 days ago, and now I have a fever of 101 degrees. The incision site is red and there's some yellowish drainage coming out."
Expected Alerts:
- β οΈ AE Detector: Infection symptoms (fever, drainage, redness)
- π΄ Emergency Detector: Urgent - Contact surgeon within 1 hour
- Pain Level: Extracted if mentioned
- Days Post-Op: 3 days
Test 2: Severe Pain Crisis
Say: "The pain is unbearable - I'd rate it 9 out of 10. The pain medication isn't helping at all, and it's getting worse."
Expected Alerts:
- π¨ AE Detector: Severe pain (9/10), medication non-response
- π¨ Emergency Detector: Urgent - Uncontrolled pain
- Action: Immediate surgical consultation
Test 3: Missed Follow-up Appointment
Say: "Oh no, I completely forgot about my wound check appointment yesterday. I've been having some drainage but thought it was normal."
Expected Alerts:
- π Appointment Agent: Missed wound check
- β οΈ Clinical Impact: Yes (drainage present, needs evaluation)
- Action: Urgent rescheduling + wound assessment
Test 4: Sentiment Mismatch (Ambitious)
Say (in distressed tone): "Everything is fine, I'm managing okay. My husband says I'm doing great and I shouldn't bother the doctor..."
Expected Alerts:
- π Sentiment Analyzer: Potential coercion/hidden distress
- Red Flags: Third-party influence, minimizing symptoms
- Action: Private follow-up call, welfare check
Test 5: Critical Emergency
Say: "I'm having severe chest pain and I can't catch my breath. My left leg is also really swollen and painful."
Expected Alerts:
- π¨π¨ Emergency Detector: CRITICAL - Possible PE/DVT
- Action: Call 911 immediately
- Symptoms: Chest pain, dyspnea, leg swelling (classic PE presentation)
π Clinical Accuracy
- β Pain Level Detection: Extracts numeric scale (0-10)
- β Timeline Tracking: Days post-surgery calculation
- β Symptom Classification: Maps to clinical categories
- β Urgency Triage: Follows post-op emergency protocols
- β Conservative Flagging: Better false positive than missed emergency
π¨ Dashboard Features
Real-Time Alert Panel
- Color-coded severity (π¨ Critical, π΄ High, β οΈ Medium)
- Alert statistics (Critical/High/Medium counts)
- Recommended actions for each alert
- Timestamp tracking
Live Transcript View
- Auto-scrolling conversation
- Speaker identification
- Searchable history
- Timestamp on each entry
Audio Monitor
- Visual level meter
- Recording status indicator
- Microphone access control
ποΈ Architecture Details
Session Management
- Each call = unique session ID
- Conversation history maintained
- Alerts linked to sessions
- Summary statistics on session end
Parallel Processing
# All agents run simultaneously
threads = [
Thread(target=ae_detector.analyze),
Thread(target=appointment_agent.analyze),
Thread(target=emergency_detector.analyze),
Thread(target=sentiment_analyzer.analyze)
]
for thread in threads:
thread.start()
Real-Time Communication
- WebSocket for bi-directional updates
- Audio chunks sent every 3 seconds
- Instant alert notifications
- Live transcript streaming
π Privacy & Compliance
- Audio Processing: Real-time, not permanently stored (MVP)
- HIPAA Readiness: Encryption, audit logging (production roadmap)
- Data Retention: Configurable session cleanup
- Access Control: Role-based permissions (future)
π§ Roadmap
Phase 1: Clinical Validation (Current)
- Core 4-agent system
- Post-surgery focus
- Clinical note generation
- Structured medical reporting
Phase 2: Production Features
- OpenEvidence API integration (clinical guidelines)
- EHR integration (Epic, Cerner)
- Advanced audio analysis (pitch, tone, stress detection)
- Multi-language support
- HIPAA compliance certification
Phase 3: Scale
- FDA clearance as clinical decision support
- Hospital pilot programs
- Automated workflow triggers (paging, scheduling)
- Analytics dashboard for outcomes tracking
π TreeHacks 2026 Submission
Target Prizes
- Zingage Healthcare Voice AI (Primary)
- Anthropic Claude SDK Prize
- OpenEvidence Medical AI
- Most Impactful Project
Demo Video Script
- Problem: Show nurse manually taking notes, missing fever mention
- Solution: MedCall detects fever + infection β urgent alert
- Technical: Show parallel agents running simultaneously
- Impact: "Prevents ER visits, saves lives, reduces nurse burnout"
π₯ Team & Acknowledgments
Built for TreeHacks 2026
Technologies:
- OpenAI (GPT-4 + Whisper)
- React + Flask
- Socket.io
- Web Audio API
Special Thanks:
- Clinical advisors for medical accuracy validation
- TreeHacks organizers
- Open source community
π License
MIT License - See LICENSE file
π Links
Built with β€οΈ for better patient outcomes
Analysis
View
Metric
- 2
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- FlaskIn code
- HTMLIn code
- JavaScriptIn code
- OpenAIIn code
- PythonIn code
- ReactIn code
7 of 7 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
88 KB
Source files
27
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
joshitaarora/MedCall
35 files Β· 739 KB Β· @ a303f00
Structure
Interface
10 files Β· 29%Screens, components and styles rendered to the user.
Application logic
15 files Β· 43%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here β open the file browser to check anything the diagram implies.
Languages
- Python41%
- JavaScript24%
- Markdown19%
- CSS14%
- Shell2%
- HTML1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
backend/requirements.txt
pypi Β· 7- eventlet
- flask
- flask-cors
- flask-socketio
- openai
- python-dotenv
- python-socketio
frontend/package.json
npm Β· 7- axios
- lucide-react
- react
- react-dom
- react-scripts
- recharts
- socket.io-client
Declared in the repositoryβs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This projectβs features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.