Spaces:
Runtime error

medi-bot / README.md
devserg's picture
Fix sdk_version to 6.11.0 and pin gradio version
4f9cf3b
|
Raw History Blame Contribute Delete
2.62 kB
---
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*