An AI-powered chatbot that helps users assess the urgency of medical symptoms and recommends appropriate actions like monitoring at home, visiting a doctor, going to the ER, or calling an ambulance.
Built with FastAPI, React, and OpenAI GPT.
- Collects user inputs: symptom description, severity, duration, age, and risk factors.
- Rule-based triage scoring system determines urgency:
- Monitor at home
- Visit doctor
- Visit ER
- Call ambulance NOW
- GPT summarizes symptoms and provides friendly advice.
- Critical alert with on-screen warning and sound.
- Ethical disclaimer to ensure safety.
- Interactive frontend using React and Axios.
| Frontend | Backend | AI Integration |
|---|---|---|
| React + Axios | FastAPI | OpenAI GPT-3.5/4 |
| HTML/CSS | Python 3.10+ | Dotenv for API key |
EmergencyTriageBot/
├── backend/
│ ├── main.py
│ ├── models.py
│ ├── scoring.py
│ ├── gpt_response.py
│ ├── requirements.txt
│ └── .env
├── frontend/
│ ├── public/
│ │ └── alert.mp3
│ └── src/
│ └── components/
│ ├── TriageForm.js
│ └── AlertBanner.js
│ └── App.js
│ └── App.css
cd backend
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txtCreate a .env file with your OpenAI key:
OPENAI_API_KEY=sk-your-openai-key
Run the backend:
uvicorn main:app --reloadAPI Docs: http://127.0.0.1:8000/docs
cd frontend
npm install
npm startAccess the app: http://localhost:3000
Place alert.mp3 in the frontend/public/ folder.
This tool does not provide medical advice. Always consult a licensed physician in case of emergencies. This app is for demonstration and educational purposes only.
- Store interaction history with SQLite.
- Simulate email alerts for critical cases.
- Add reset button and better error handling.
- Multi-language support.
- Deploy backend (Render) and frontend (Vercel/Netlify).