HealthRAG is a Retrieval-Augmented Generation (RAG) chatbot designed for medical document question-answering, built with Python, LangChain, FAISS, and Hugging Face API.
HealthRAG is a medical Q&A chatbot that responds to user queries by retrieving relevant information from PDF documents. It is intended for:
- 🩺 Patients seeking general medical insights (may contain technical language)
- 👨⚕️ Medical students for revision, summarization, and context-based querying
The quality of answers depends heavily on the PDFs provided as context.
- Users upload one or more PDF files containing medical content
- The content is split into chunks and converted into embeddings
- FAISS is used to store the embeddings and retrieve the most relevant context
- A custom prompt sends the context + user question to a hosted LLM via Hugging Face Router
- The chatbot responds concisely using only the retrieved context
git clone https://github.com/Y1D1R/HealthRAG.git cd HealthRAGCreate a .env file in the root with:
HF_TOKEN=your_huggingface_access_token HF_API_TOKEN=your_huggingface_api_token👉 You can get this from https://huggingface.co/settings/tokens
pip install -e .Place your medical .pdf files in the data/ directory.
python app/components/data_loader.pypython app/application.pyVisit the app at: http://127.0.0.1:5000
Place your PDF documents in the local data/ folder before building the image.
Ensure your .env file with API keys is available in the root before the build.
docker build -t healthrag .✅ During the build, the vector store will be automatically generated from the contents of
data/.
docker run -p 5000:5000 --name healthrag-container healthragThen visit the app at: http://localhost:5000
HealthRAG/ ├── app/ │ ├── components/ # pdf_loader, embeddings, vector store │ ├── config/ # API keys, chunk config │ ├── common/ # Logger, custom exception │ └── application.py # Flask web interface ├── templates/ # Frontend HTML ├── static/images/ # Logo ├── data/ # Your medical PDFs ├── Dockerfile ├── setup.py ├── Jenkinsfile └── README.md - Python 3.11
- Flask
- LangChain
- Hugging Face Hub & Router
- FAISS (vector store)
- Sentence Transformers (embeddings)
- OpenAI-compatible
openaiPython client
This chatbot is a proof of concept and not intended for clinical use. Its accuracy depends solely on the content of the provided PDFs.
