jainsandesh960/symptomap-ai
๐ฟ SymptoMap.ai
Your Calm Companion for Understanding Body Sensations
SymptoMap.ai is a wellness education web application that helps users understand everyday body sensations in a calm, educational way. It provides general wellness information without diagnosis or medical advice.
โ ๏ธ Important Disclaimer
SymptoMap.ai is NOT a medical device, diagnostic tool, or healthcare provider.
This application provides general educational information only and should NEVER be used as a substitute for professional medical advice, diagnosis, or treatment. Always consult with qualified healthcare professionals for any health concerns.
โจ Features
- ๐ Sensation Input Form - Describe your experience with structured fields
- ๐ค AI-Powered Insights - Get calm, educational explanations using Google Gemini
- ๐ง Interactive Body Map - Visual highlighting of affected body regions
- ๐ Session History - Track past sensations with timestamps
- ๐ Dark Mode - Toggle between light and dark themes
- ๐พ Export Function - Download your wellness insights as markdown
- ๐ Intensity Trends - Visual chart of intensity over time
- ๐ง Breathing Exercise - Quick calming exercise widget
- ๐ฑ Mobile Responsive - Works on all devices
- ๐ Safety First - Built-in filters prevent medical claims
๐ ๏ธ Tech Stack
- Frontend: Streamlit
- AI: Google Gemini Flash API
- Language: Python 3.9+
- Styling: Custom CSS with premium design system
๐ Quick Start
Prerequisites
- Python 3.9 or higher
- Google API Key (Gemini)
Installation
- Clone the repository
git clone <repository-url>
cd symptomap_ai- Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Configure environment variables
cp .env.example .env
# Edit .env and add your GOOGLE_API_KEY- Run the application
streamlit run app.py- Open in browser Navigate to
http://localhost:8501
๐ Project Structure
symptomap_ai/
โโโ app.py # Main application entry point
โโโ requirements.txt # Python dependencies
โโโ .env.example # Environment template
โโโ README.md # This file
โ
โโโ page_modules/ # Page modules
โ โโโ __init__.py
โ โโโ home.py # Main input/analysis page
โ โโโ about.py # About page
โ โโโ safety.py # Safety & disclaimer page
โ
โโโ utils/ # Utility modules
โ โโโ __init__.py
โ โโโ llm_client.py # Google Gemini API client
โ โโโ prompts.py # Prompt templates
โ โโโ response_safety.py # Response sanitization
โ โโโ body_map.py # Body region management
โ โโโ ui_components.py # Reusable UI components
โ
โโโ assets/ # Static assets
โ โโโ styles.css # Custom CSS styles
โ
โโโ .streamlit/ # Streamlit configuration
โโโ config.toml๐ Safety Features
SymptoMap.ai includes multiple layers of safety:
- System Prompt Engineering - AI is instructed to never diagnose or use medical terminology
- Response Sanitization - Post-processing filters remove:
- Medical terms and disease names
- Percentages and statistics
- Diagnostic phrases
- Mandatory Disclaimers - Every response includes safety reminders
- Fallback Responses - Safe generic responses if AI fails
- Emergency Guidance - Clear (non-diagnostic) emergency information
๐จ Customization
Themes
Edit .streamlit/config.toml to customize colors:
[theme]
primaryColor = "#4A90A4"
backgroundColor = "#F8FBFC"
secondaryBackgroundColor = "#EEF5F8"
textColor = "#2C3E50"Adding Body Regions
Edit utils/body_map.py to add new body regions:
BODY_REGIONS["New Region"] = {
"keywords": ["keyword1", "keyword2"],
"color": "#HEXCOLOR",
"icon": "๐",
"svg_id": "new_region"
}๐ API Configuration
Getting a Google API Key
- Go to Google AI Studio
- Click "Create API Key"
- Copy the key and add it to your
.envfile
Rate Limiting
The application includes built-in rate limiting (1 second minimum between requests) to avoid API quota issues.
๐งช Development
Running in Development Mode
streamlit run app.py --server.runOnSave trueCode Quality
The codebase follows:
- PEP 8 style guidelines
- Type hints where appropriate
- Comprehensive docstrings
- Modular architecture
๐ License
MIT License - See LICENSE file for details.
๐ค Contributing
Contributions are welcome! Please ensure:
- Code follows existing style
- Safety features are maintained
- No medical claims or diagnostic language
- All new features include proper disclaimers
๐ Support
For questions or issues, please open a GitHub issue.
Remember: SymptoMap.ai is for educational purposes only. Always consult healthcare professionals for medical concerns.
๐ฟ Understanding your body, one sensation at a time.
