A comprehensive AI-powered healthcare assistance system that uses multiple specialized agents to provide preliminary medical assessments, medication safety checks, and pharmacy availability information.
- Patient Symptom Agent: Extracts structured medical information from free-text descriptions
- Doctor Agent: Creates preliminary assessments and treatment recommendations
- Pharmacy Agent: Checks medication availability and suggests alternatives
- Safety Guardian: Validates all recommendations against safety rules
- Differential diagnosis with likelihood estimates
- Medication recommendations with dosing instructions
- Drug interaction checking
- Allergy contraindication detection
- Pregnancy safety considerations
- Medication pricing in Indian Rupees (βΉ)
- Integration with Indian pharmacy chains (Apollo, MedPlus, Netmeds)
- Delivery options and timing information
- Stock availability checking
- Red flag symptom detection
- Age-appropriate recommendations
- Risk level assessment (Low/Medium/High)
- Comprehensive safety reviews
smart-health-assistant/
βββ agents/
β βββ __init__.py
β βββ patient_symptom.py # Symptom extraction agent
β βββ doctor.py # Medical assessment agent
β βββ pharmacy.py # Pharmacy checking agent
β βββ guardian.py # Safety validation agent
βββ core/
β βββ __init__.py
β βββ models.py # Data models and structures
β βββ orchestrator.py # Agent coordination
β βββ rules.py # Safety rules engine
βββ data/
β βββ inventory.csv # Medication database
βββ app/
β βββ streamlit_app.py # Web interface
βββ requirements.txt # Python dependencies
βββ .env # Environment variables
βββ README.md # This file
- Python 3.8 or higher
- Gemini API key (optional but recommended)
-
Clone the repository
git clone https://github.com/deeptimaan-k/smart-health-assistant.git cd smart-health-assistant -
Create a virtual environment
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
# Create a .env file and add your Gemini API key echo "GEMINI_API_KEY=your_actual_api_key_here" > .env
Get a free API key from Google AI Studio
-
Run the application
streamlit run app/streamlit_app.py
-
Open your browser Navigate to
http://localhost:8501to access the application
- Enter your age, sex, and other relevant details
- List any allergies or current medications
- Provide information about medical history
Describe your symptoms in detail. Examples:
- "I've had fever of 101Β°F and sore throat for 2 days"
- "Headache with sensitivity to light for 3 hours"
- "Cough and chest congestion with mild fever"
The system will provide:
- π Preliminary assessment with condition likelihood
- π Medication recommendations with Indian pricing
- πͺ Pharmacy availability and delivery options
- π‘οΈ Safety review and risk assessment
- π Health insights and preventive care advice
The system uses Google's Gemini AI for enhanced symptom understanding and medical assessment. While the system works without it, Gemini integration significantly improves accuracy.
Edit data/inventory.csv to add or modify medication information:
name,generic_name,strength,brand,form,manufacturer,in_stock,stock_level,price
paracetamol,paracetamol,500mg,Crocin,tablet,GSK,1,High,15Modify core/rules.py to customize safety checks and validation rules for your specific requirements.
graph TD
A[User Input] --> B(Patient Symptom Agent)
B --> C{Symptom Analysis}
C --> D[Doctor Agent]
C --> E[Pharmacy Agent]
D --> F[Preliminary Assessment]
E --> G[Medication Availability]
F --> H(Safety Guardian)
G --> H
H --> I[Safety Review]
I --> J[Final Recommendations]
"I'm a 28-year-old male with fever of 101Β°F, sore throat, and headache for 2 days. Allergic to penicillin."
- Assessment: Viral pharyngitis (65% likelihood), Streptococcal pharyngitis (30%)
- Medications: Paracetamol 500mg (βΉ15), recommended every 6-8 hours
- Safety Check: β Approved - No penicillin-containing medications
- Pharmacy: Available at Apollo Pharmacy (0.8km away)
This is a demonstration system only and not a medical device.
π¨ CRITICAL IMPORTANT NOTICE:
- This system does NOT provide medical diagnosis
- It is NOT a replacement for professional healthcare
- Always consult with qualified healthcare providers for medical concerns
- In emergencies, call your local emergency services immediately
The system provides informational guidance only and should be used as an educational tool rather than a diagnostic system.
- All processing happens locally in your browser
- No personal health information is stored on servers
- You can run the system completely offline without Gemini API
- No data is shared with third parties
- EHR system integration
- Multi-language support
- Telemedicine provider APIs
- Personal health records
- Adverse reaction monitoring
- Medical image analysis
- Voice symptom description
- Mobile app development
We welcome contributions! Please feel free to submit pull requests, open issues, or suggest new features.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
The system is optimized for:
- Response Time: < 5 seconds for most queries
- Accuracy: Enhanced with Gemini AI integration
- Safety: Multiple validation layers for patient safety
- Scalability: Can handle multiple simultaneous users
- National Emergency Number: 112
- Medical Emergency: 108
- COVID Helpline: 1075
- Mental Health Helpline: 080-46110007
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini AI for enhanced natural language processing
- Indian healthcare providers for medication pricing information
- Open-source healthcare projects that inspired this work
- Medical professionals who provided guidance on safety rules
If you have any questions or need help with setup:
- Check the Issues page
- Create a new issue with your question
- Email: [email protected]
Made with β€οΈ for better healthcare accessibility
Remember: This tool complements but doesn't replace professional medical care