Skip to content

Ganesh153/MedicalChatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📅 AI Medical Assistant Chatbot — RAG-based Application

🧠 Project Overview

This application is a Medical Domain Chatbot built using Retrieval-Augmented Generation (RAG). It allows users to upload their own medical documents (e.g., textbooks, reports), and the system intelligently answers queries by retrieving the most relevant content before generating a final response.


🎓 What is RAG?

RAG (Retrieval-Augmented Generation) enhances language models by supplying relevant external context from a knowledge base, preventing hallucinations and improving accuracy, especially for factual or specialized domains like medicine.


🔄 Architecture

User Input
   ↓
Query Embedding → Pinecone Vector DB ← Embedded Chunks ← Chunking ← PDF Loader
   ↓
Retrieved Docs
   ↓
     RAG Chain (Groq + LangChain)
   ↓
LLM-generated Answer

📚 Features

  • Upload medical PDFs (notes, books, etc.)
  • Auto-extracts text and splits into semantic chunks
  • Embeds using HuggingFace Sentence-transformers embeddings
  • Stores vectors in Pinecone DB
  • Uses Groq's openai/gpt-oss-120b via LangChain
  • FastAPI backend with endpoints for file upload and Q&A

🌐 Tech Stack

Component Tech Used
LLM Groq API (openai/gpt-oss-120b)
Embeddings HuggingFace Sentence-transformers
Vector DB Pinecone
Framework LangChain
Backend FastAPI
Deployment Render

📚 API Endpoints

POST /upload_pdfs/ --- Upload one or more PDF files

POST /ask/ --- Ask a question --- Form field: `question`

⚡ Quick Setup

# Clone the repo
$ git clone https://github.com/Ganesh153/MedicalChatbot.git
$ cd medicalAssistant/backend

# Create virtual env
$ uv venv
$ .venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies
$ uv pip install -r requirements.txt

# Set environment variables (.env)
GROQ_API_KEY=...
PINECONE_API_KEY=...
PINECONE_INDEX_NAME=...

# Run the server
$ uvicorn main:app --reload --port 8000

# Frontend
$ cd medicalAssistant/frontend

# Create virtual env
$ uv venv
$ .venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies
$ uv pip install -r requirements.txt

# Run the server
$ streamlit run app.py

🌐 Deployment

  • Hosted on Render

  • Configure start command as:

    uvicorn main:app --host 0.0.0.0 --port 10000

🌟 Credits

  • Built by Ganesh
  • Inspired by LangChain, Groq, Pinecone, and FastAPI ecosystems

🎉 License

This project is licensed under the MIT License.

About

This application is a Medical Domain Chatbot built using Retrieval-Augmented Generation (RAG). It allows users to upload their own medical documents (e.g., textbooks, reports), and the system intelligently answers queries by retrieving the most relevant content before generating a final response.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages