Skip to content
/ MedRAG Public

Engineered a secure backend using FastAPI with role-based authentication. The platform manages the ingestion of PDF reports, utilizes Groq/LLaMA 3 for advanced AI diagnosis, and integrates Pinecone for effective vector-based retrieval (RAG) with MongoDB for data management, creating a scalable and intelligent medical document analysis system.

Notifications You must be signed in to change notification settings

hit1403/MedRAG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medical Diagnosis RAG

This is the FastAPI-based backend for the Medical Diagnosis Application, which provides authentication, PDF report upload, AI-powered medical diagnosis using LLaMA 3 via Groq API, and stores metadata in MongoDB with Pinecone for vector storage.


Core Features

Role-based Authentication ( Doctor / Patient)

PDF Report Upload

Text Extraction & Chunking from PDFs

AI Diagnosis Generation using Groq LLaMA 3

Vector Storage with Pinecone for RAG retrieval

MongoDB Integration for user, report, and diagnosis records

Role-based Access Control for viewing and requesting diagnoses


Tech Stack

  • Backend Framework: FastAPI
  • Database: MongoDB
  • Vector DB: Pinecone
  • LLM API: Groq (LLaMA 3)
  • PDF Processing: PyPDF2
  • Environment Management: Python 3.10+

⚙️ Setup Instructions (Local)

1️⃣ Clone the Repository

git clone https://github.com/hit1403/Medic_chatBot.git
cd Medic_chatBot

2️⃣ Create Virtual Environment

python -m venv venv
source venv/bin/activate   # On Linux/Mac
venv\Scripts\activate      # On Windows

3️⃣ Install Dependencies

pip install -r requirements.txt

4️⃣ Configure Environment Variables

Create a .env file and add:

MONGO_URI=
DB_NAME=
PINECONE_API_KEY=
PINECONE_INDEX_NAME=
PINECONE_ENV=
GROQ_API_KEY=
UPLOAD_DIR=
API_URL=

5️⃣ Run the Application

uvicorn server.main:app --reload

API will be available at: http://127.0.0.1:8000


▶️ API Endpoints

Method Endpoint Description
POST /auth/signup Register a new user
POST /auth/login Login user
POST /reports/upload Upload medical report
POST /diagnosis/from_report Request AI diagnosis
GET /diagnosis/by_patient_name View past diagnoses

About

Engineered a secure backend using FastAPI with role-based authentication. The platform manages the ingestion of PDF reports, utilizes Groq/LLaMA 3 for advanced AI diagnosis, and integrates Pinecone for effective vector-based retrieval (RAG) with MongoDB for data management, creating a scalable and intelligent medical document analysis system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages