An intelligent, Retrieval-Augmented Generation (RAG) powered conversational AI designed to provide accurate medical information from verified documentation.
- β¨ Introduction
- π Key Features
- ποΈ System Architecture
- π οΈ Tech Stack
- π² App Walkthrough (UI Sections)
- βοΈ Installation & Setup
- π¦ Project Structure
- π€ Contributing
- π License
- π Contact
π Try it now:
- Streamlit Profile -[Link]
- Project Demo - [Medical ChatBot Link]
Experience the full flow:
The Medical RAG Chatbot is a state-of-the-art AI application built to bridge the gap between complex medical documentation and accessible, user-friendly health queries. By leveraging Llama-3 (via Hugging Face) for reasoning and FAISS for fast similarity search, this system ingests medical PDFs (e.g., "The Gale Encyclopedia of Medicine"), understands user questions, and retrieves precise, context-aware answers.
Unlike standard chatbots, this system is grounded in RAG (Retrieval-Augmented Generation), meaning every answer is backed by retrieved evidence from trusted sources, significantly reducing hallucinations.
- π RAG-Powered Accuracy:Retrieves relevant context from indexed medical PDFs before answering.
- π€ Advanced LLM Integration: Uses
Llama-3(via Hugging Face API) for high-quality natural language understanding. - β‘ Fast Vector Search: Implements FAISS (Facebook AI Similarity Search) for millisecond-latency document retrieval.
- π§ Conversation Memory: Remembers past interactions to provide context-aware follow-up answers.
- π Source Attribution: Shows exactly which part of the document was used to generate the answer.
- π₯οΈ System Health Dashboard: Real-time monitoring of vector store status, LLM connectivity, and system latency.
- π¨ Premium UI/UX: A polished Streamlit interface with a custom medical green theme, smooth transitions, and interactive components.
- π· Architecture View 1 β Very Simple
- π· Architecture View 2 β Basic Rag Flow
- Architecture View 3 β Rag With Embeddings
- Architecture View 4 β Full Application Architecture
- Architecture View 5 β With Memory (Chat History)
- Architecture View 6 β Production + Devops
- Architecture View 7 β End-To-End (Best Final Diagram)
The system follows a robust data pipeline:
- Ingestion: Loading medical PDFs using
PyPDFLoader. - Chunking: Splitting text into manageable chunks (
RecursiveCharacterTextSplitter). - Embedding: Converting text to vectors using
SentenceTransformer(all-MiniLM-L6-v2). - Storage: Indexing vectors in a local
FAISSdatabase. - Retrieval: Fetching top-k relevant chunks for a user query.
- Generation: Synthesizing the final answer using the LLM.
(See the Architecture tab in the app for an interactive deep dive into each component.)
| Category | Technology | Purpose |
|---|---|---|
| Frontend | Streamlit | Interactive Web UI & Dashboard |
| LLM Engine | Llama 3 (via Groq/HF) | Natural Language Generation |
| Embeddings | SentenceTransformers | Semantic text representation |
| Vector DB | FAISS | High-performance similarity search |
| Orchestration | LangChain | Chaining retrieval and generation flows |
| DevOps | Docker & Jenkins | Containerization & CI/CD Pipelines |
| Security | Aqua Trivy | Container vulnerability scanning |
| Cloud | AWS App Runner | Scalable cloud deployment |
| Language | Python 3.10 | Core programming language |
The main interface where users interact with the AI.
- Input Area: Type medical questions (e.g., "What are symptoms of Pneumonia?").
- Answer Display: Receive detailed, AI-generated responses.
- Reference Context: Expandable section showing the raw source text used for the answer.
- Metrics: Real-time display of execution time and confidence.
A detailed overview of the project's mission.
- Explains the "Why" and "How" of Medical RAG.
- Highlights the datasets used (Gale Encyclopedia of Medicine).
- outlines the solution approach.
Visual representation of the technologies used.
- Cards for LLM, Vector Store, DevOps, and Frontend.
- Explains the role of Docker, Jenkins, and AWS in the deployment pipeline.
An educational hub for developers.
- Interactive Flowcharts: Visualizing the data journey from PDF to Answer.
- Component Deep Dive: Tabs explaining Ingestion, Embedding, and Generation with code snippets.
- Evolution: A gallery showing how the architecture evolved from MVP to Production.
A dashboard for administrators.
- Status Indicators: Green/Red lights for App, Vector Store, and LLM connectivity.
- Live Logs: Scrollable, filterable logs showing system activities and errors.
- Download: Export logs for external analysis.
- Python 3.8 or higher.
- A Hugging Face API Token (for the LLM).
git clone https://github.com/Ratnesh-181998/Medical-RAG-Chatbot.git
cd Medical-RAG-Chatbotpip install -r requirements.txtCreate a .env file in the root directory and add your API token:
HF_TOKEN=your_hugging_face_token_herestreamlit run Medical_Chatbot_streamlit_app.pyThe app will open in your browser at http://localhost:8501.
Medical-RAG-Chatbot/
βββ architecture_images/ # Diagrams for documentation
βββ vectorstore/ # FAISS index files (if local)
βββ Medical_Chatbot_streamlit_app.py # Main Entry Point
βββ requirements.txt # Python dependencies
βββ .env # Environment variables (GitIgnored)
βββ README.md # Project DocumentationContributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.
Ratnesh Kumar Singh
- π§ Email: rattudacsit2021gate@gmail.com
- πΌ LinkedIn: Ratnesh Kumar Singh
- π GitHub: Ratnesh-181998
- π± Phone: +91-947XXXXX46
-
π Live Demo: Streamlit App
-
π Documentation: GitHub Wiki
-
π Issue Tracker: GitHub Issues
-
π¬ Discussions: GitHub Discussions
Built with passion for the AI Community. π
Licensed under the MIT License - Feel free to fork and build upon this innovation! π


.png)