--- title: MediBot - AI Medical Symptom Checker emoji: ๐Ÿฅ colorFrom: blue colorTo: indigo sdk: gradio sdk_version: "6.11.0" app_file: app.py pinned: false license: mit tags: - medical - nlp - langchain - faiss - rag - openai - symptom-checker --- # ๐Ÿฅ MediBot โ€” AI Medical Symptom Checker An intelligent medical chatbot that uses **Retrieval-Augmented Generation (RAG)**, **FAISS vector search**, and **LangChain ReAct agents** to help users understand their symptoms and identify possible conditions. ## โš ๏ธ Disclaimer MediBot is for **informational purposes only** and does NOT replace professional medical advice. Always consult a licensed healthcare provider. ## Architecture ``` User Input โ†’ LangChain ReAct Agent โ†’ FAISS VectorStore (41 diseases) โ†“ โ†“ Tool Selection Semantic Symptom Search โ†“ โ†“ Disease Details Lookup Severity Score Calculation โ†“ Gradio Chat Response ``` ## Tech Stack | Component | Technology | |---|---| | LLM | OpenAI GPT-4o-mini | | Embeddings | OpenAI text-embedding-3-small | | Vector Store | FAISS (Facebook AI Similarity Search) | | Agent Framework | LangChain ReAct | | Memory | LangGraph MemorySaver (per thread_id) | | UI | Gradio | | Deployment | HuggingFace Spaces | ## Key Features - **Semantic symptom search**: Finds diseases even when you don't use exact medical terms - **Multi-agent ReAct reasoning**: Dynamically selects the right tools for each query - **Conversation memory**: Remembers symptoms mentioned in previous messages - **Severity scoring**: Weighs each symptom by clinical importance (scale 1โ€“6) - **Structured output**: Disease descriptions, precautions, and severity levels - **Edge case handling**: Graceful responses to unknown symptoms, empty input, or ambiguous queries ## Data Sources - `dataset.csv` โ€” 4,920 rows mapping 41 diseases to 17 symptoms each - `symptom_Description.csv` โ€” Medical descriptions for 41 diseases - `Symptom-severity.csv` โ€” Clinical severity weights for 133 symptoms - `symptom_precaution.csv` โ€” Up to 4 precautions per disease ## Setup (Local) ```bash # Clone and install pip install -r requirements.txt # Set your OpenAI API key cp .env.example .env # Edit .env and add your key # Run python app.py ``` ## HuggingFace Spaces Deployment Set `OPENAI_API_KEY` as a **Secret** in your Space settings. The FAISS index is built on first launch (takes ~30 seconds, then cached). --- *MediBot Capstone ยท Interview Kickstart*