A modern AI-powered medical chatbot using Retrieval-Augmented Generation (RAG) with Pinecone, LangChain, and Gemini 2.5 Flash. This project provides a web-based interface for users to ask medical questions and receive evidence-based, context-aware responses, with clear disclaimers and source references.
- Conversational AI: Chatbot answers medical questions using advanced LLMs.
- Retrieval-Augmented Generation: Combines LLM with vector search over PDF documents for accurate, context-rich answers.
- Source Attribution: Bot responses include references to the source documents/pages.
- Modern Web UI: Responsive, user-friendly frontend with Markdown support.
- Frontend: HTML, CSS, JavaScript
- Backend: Fastapi
- Vector database: Pinecone
- LLM: Google Gemini 2.5 Flash
git clone https://github.com/PialGhosh2233/medical-chatbot.git
cd medical-chatbot/medical-chatbotIt is recommended to use a virtual environment.
python -m venv venv
venv\Scripts\activate # On Windows
# Or
source venv/bin/activate # On Mac/Linux
pip install -r requirements.txtCreate a .env file in the medical-chatbot directory with the following:
PINECONE_API_KEY=your-pinecone-api-key
PINECONE_ENV=us-east-1
GOOGLE_API_KEY=your-google-api-key
- Get a Pinecone API key
- Get a Google Generative AI API key
uvicorn main:app --reloadOpen frontend.html in your browser. The frontend connects to http://localhost:8000 by default.
GET /health— Health checkPOST /chat— Chat with the bot ({"message": "your question"})GET /— API info
medical-chatbot/
│ main.py # FastAPI backend
│─── templates/
│ index.html # Web UI
│─── static/
│ script.js # javascript
│ style.css # css
│ requirements.txt # Python dependencies
| README.md
└──
For questions or support, open an issue or contact PialGhosh2233.
