A comprehensive AI-powered medical chatbot with symptom analysis, emergency detection, appointment scheduling, and health record management.
- โ AI Medical Chatbot - Natural language symptom analysis
- โ Emergency Detection - Instant first-aid guidance for critical situations
- โ Severity Classification - 4-level urgency system (Mild to Critical)
- โ Doctor Matching - Find specialists based on symptoms
- โ Appointment Scheduling - Book and manage appointments
- โ Health Records - Track vitals, symptoms, and medical history
- โ Image Analysis - Analyze injury/medical images
- โ Family Doctor System - Save and consult family physician
- โ Real-time Chat - LLM-style conversational interface
- ๐ Health Dashboard - Visualize health trends
- ๐ Smart Notifications - Appointment reminders and health alerts
- ๐ฑ Responsive Design - Works on all devices
- ๐ Multi-language Support - (Coming soon)
- ๐ Data Privacy - Local storage, HIPAA-compliant ready
medisence-ai/
โโโ backend/ # Flask backend server
โ โโโ app.py # Main Flask application
โ โโโ database.py # Database management
โ โโโ auth_manager.py # Authentication & sessions
โ โโโ symptom_analyzer.py # Symptom extraction
โ โโโ severity_classifier.py # Urgency classification
โ โโโ emergency_detector.py # Emergency detection
โ โโโ camera_analyzer.py # Image analysis
โ โโโ gemini_service.py # AI integration
โ โโโ otp_service.py # OTP management
โ โโโ medical_kb.json # Medical knowledge base
โ โโโ doctors_db.json # Doctors database
โ โโโ requirements.txt # Python dependencies
โ
โโโ frontend/ # Frontend application
โ โโโ index.html # Main page
โ โโโ script.js # Core JavaScript
โ โโโ dashboard.js # Dashboard functionality
โ โโโ style.css # Styles
โ โโโ auth.html # Authentication page
โ
โโโ API_DOCUMENTATION.md # Complete API docs
โโโ README.md # This file
- Python 3.8 or higher
- Modern web browser
- VS Code (recommended)
git clone https://github.com/Shivansh1146/MedicSense-AIcd backend
pip install -r requirements.txtDependencies installed:
- Flask 2.3.3 - Web framework
- flask-cors 4.0.0 - Cross-origin support
- Pillow 10.1.0 - Image processing
python app.pyYou should see:
๐ MedicSense AI Backend Starting...
๐ก Server running at http://localhost:5000
๐ Medical chatbot ready to assist
Open your browser and go to:
http://localhost:5000
- Click the chat icon in the bottom-right corner
- Describe your symptoms naturally
- Get instant AI-powered analysis
"I have a severe headache and fever"
"My chest hurts and I feel dizzy"
"I twisted my ankle while playing"
"I need a doctor for heart problems"
The system automatically detects emergencies and provides first-aid guidance:
- Chest pain
- Severe bleeding
- Difficulty breathing
- Loss of consciousness
- Save your family doctor
- Book appointments with specialists
- Manage and reschedule appointments
- Record vital signs
- Monitor health trends
- Store medical history
| Level | Severity | Action Required |
|---|---|---|
| 1 | Mild | Self-care, monitor symptoms |
| 2 | Moderate | Consult family doctor |
| 3 | Serious | See specialist soon |
| 4 | Critical | Emergency - Call 911 |
POST /api/chat- Chat with AIPOST /api/auth/otp/send- Send OTPPOST /api/auth/otp/verify- Verify OTPPOST /api/appointments/book- Book appointmentGET /api/appointments/<user_id>- Get appointmentsPOST /api/health/vitals- Save vital signsGET /api/health/vitals/<user_id>- Get health recordsPOST /api/analyze-injury-image- Analyze imagesGET /api/find-doctors- Search doctors
See API_DOCUMENTATION.md for complete API reference.
- Get a free API key from Google AI Studio
- Create
.envfile in backend folder:
GEMINI_API_KEY=your_api_key_here- Restart the server
Edit backend/medical_kb.json to add:
- New symptoms
- Medical conditions
- Treatment recommendations
Edit backend/doctors_db.json to add local doctors and hospitals.
- โ Session token management
- โ Local data storage
- โ CORS protection
- โ Input sanitization
- โ Secure file uploads
# In backend folder
python test_api.pySend messages with emergency keywords:
- "chest pain"
- "can't breathe"
- "severe bleeding"
heroku create medisense-ai
git push heroku main- Connect your GitHub repository
- Deploy from
mainbranch - Set environment variables
See deployment guides in docs/ folder.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License.
Shivansh
- GitHub: @Shivansh1146
- Flask framework
- Google Gemini AI
- Medical knowledge databases
- Open-source community
For issues and questions:
- Open an issue on GitHub
- Email: support@MedicSense-AI.com
- Multi-language support
- Prescription management
- Lab report analysis
- Medicine reminders
- Telemedicine integration
- Insurance integration
- Mobile app (React Native)
MedicSense AI is an educational tool and should not replace professional medical advice.
Always consult with qualified healthcare professionals for medical concerns. In emergencies, call your local emergency number (911 in the US).
Made with โค๏ธ for better healthcare access
Star โญ this repository if you find it helpful!