A real-time AI-powered medical tool that transcribes patient-healthcare professional interactions and extracts key insights using OpenAI Whisper and GPT-4.
- 🎤 Real-time Voice Recording - Click-to-record microphone interface
- 📝 Live Transcription - Powered by OpenAI Whisper
- 🤖 AI Summarization - GPT-4 generates medical summaries
- 💾 Data Persistence - Saves summaries to JSON files
- 🎨 Beautiful UI - Modern, responsive interface
- Doctor-patient interaction with real-time insights
- Vector similarity search for relevant medical history
- WebSocket real-time updates
- Medical record integration and updates
- Backend: FastAPI + Python
- AI: OpenAI Whisper (transcription) + GPT-4 (summarization)
- Frontend: Vanilla HTML/CSS/JavaScript
- Storage: JSON files (simple, no database needed)
- Python 3.8+ (tested with Python 3.13)
- OpenAI API account and key
- Microphone access in your browser
# Clone or download the project
cd hackathon
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install fastapi "uvicorn[standard]" openai python-multipart aiofiles python-dotenv websockets
pip install git+https://github.com/openai/whisper.gitCreate a .env file in the project root:
# Get your API key from: https://platform.openai.com/api-keys
OPENAI_API_KEY=your_openai_api_key_here# Start the server
python main.py
# Or alternatively:
uvicorn main:app --reload --host 0.0.0.0 --port 8000The application will be available at: http://localhost:8000
- Access the Interface: Open http://localhost:8000 in your browser
- Patient Context: See the current patient info (Sarah Michelle Johnson)
- Record Conversation:
- Click the microphone button to start recording
- Speak your nurse-patient conversation
- Click again to stop recording
- View Transcription: See the live transcription appear
- Generate Summary: Click "Generate Summary" for AI analysis
- Save to Record: Click "Save to Record" to persist the data
- Real-time Transcription: Using Whisper's "base" model for speed
- Medical Context: GPT-4 receives patient medical history for context
- Professional Summaries: AI generates clinical documentation
- Persistent Storage: All interactions saved to
summaries/directory
hackathon/
├── main.py # FastAPI application
├── medical_record.md # Patient medical history
├── requirements.txt # Python dependencies
├── summaries/ # Generated summaries directory
│ ├── all_summaries.json # Master file with all summaries
│ └── summary_*.json # Individual session files
└── README.md # This file
GET /- Main nurse interfacePOST /transcribe- Upload audio for transcriptionPOST /summarize- Generate medical summaryPOST /save-summary- Save summary to JSONGET /summaries- Retrieve all saved summaries
The AI generates professional medical notes like:
**Chief Complaint**: Patient reports chest discomfort and shortness of breath with exertion over the past week.
**Vital Signs**: Blood pressure elevated at 145/92 mmHg, heart rate 88 bpm.
**Assessment**: Given patient's history of diabetes, hypertension, and family cardiac history, chest symptoms warrant further cardiac evaluation.
**Plan**: ECG ordered, cardiology referral initiated, continue current medications.
- Microphone not working: Ensure browser permissions for microphone access
- OpenAI API errors: Check your API key in
.envfile - Whisper loading slowly: First model load takes time, subsequent uses are faster
- Module not found: Ensure virtual environment is activated and dependencies installed
- Use Chrome/Firefox for best microphone support
- Speak clearly for better transcription accuracy
- Keep recordings under 30 seconds for optimal processing
- The "base" Whisper model balances speed and accuracy
This is a hackathon project! Feel free to:
- Add new features
- Improve the UI/UX
- Optimize performance
- Add error handling
- Implement additional medical workflows
Based on your PRD, the next features to implement:
- Doctor interface with real-time insights
- Vector similarity search using sentence-transformers
- Medical record highlighting based on conversation
- WebSocket real-time updates
MIT License - Built for the hackathon!