Skip to content

PialGhosh2233/medical-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏥 Medical Chatbot

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.


Features

  • 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.

Tech stack

  • Frontend: HTML, CSS, JavaScript
  • Backend: Fastapi
  • Vector database: Pinecone
  • LLM: Google Gemini 2.5 Flash

Demo

Medical Chatbot UI Screenshot


Quickstart

1. Clone the Repository

git clone https://github.com/PialGhosh2233/medical-chatbot.git
cd medical-chatbot/medical-chatbot

2. Install Python Dependencies

It 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.txt

3. Set Environment Variables

Create 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

4. Run the Backend

uvicorn main:app --reload

5. Open the Frontend

Open frontend.html in your browser. The frontend connects to http://localhost:8000 by default.


API Endpoints

  • GET /health — Health check
  • POST /chat — Chat with the bot ({"message": "your question"})
  • GET / — API info

Project Structure

medical-chatbot/
│   main.py            # FastAPI backend
│─── templates/
│       index.html     # Web UI
│─── static/
│       script.js      # javascript
│       style.css      # css
│   requirements.txt   # Python dependencies
|   README.md
└── 

License

MIT


Acknowledgements

Contact

For questions or support, open an issue or contact PialGhosh2233.

About

A modern AI-powered medical chatbot using Retrieval-Augmented Generation (RAG) with Pinecone, LangChain, and Gemini 2.5 Flash.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors