AI-Health-Symptom-Checker-

🩺 AI Health Guidance Assistant

An AI-powered health triage and guidance application built with Streamlit and the OpenAI API. It allows users to describe symptoms in natural language and receive contextual, safe, and general health guidance, simulating an initial patient intake process.

🚀 Tech Stack

🛠️ How to Run Locally

  1. Clone the repository: git clone https://github.com/Kashika-17/AI-Health-Symptom-Checker.git
  2. Install dependencies: pip install -r requirements.txt
  3. Create a .streamlit/secrets.toml file and add your OpenAI API key: OPENAI_API_KEY = "sk-..."
  4. Run the app: streamlit run streamlit_app.py

⚠️ Challenges & Solutions (Engineering Trade-offs)

During development, I identified and resolved two critical production risks:

  1. Safety & Hallucination Risk:
    • Problem: The base model occasionally generated overly confident, specific medical diagnoses when given vague inputs.
    • Solution: Implemented a strict system prompt with explicit negative constraints (forbidding definitive diagnoses). Lowered the temperature to 0.3 to reduce creative hallucination, and enforced a mandatory medical disclaimer in the UI.
  2. API Fragility & Context Overflow:
    • Problem: Network hiccups or rate limits caused the app to crash. Long conversations risked exceeding the token context window.
    • Solution: Wrapped the API call in a try/except block with a 15-second timeout to prevent hanging. Implemented a sliding window in st.session_state to only send the last 10 messages to the API, ensuring stable memory usage and graceful error messaging to the user.

📈 Future Ambitions