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.
✅ 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
- Backend Framework: FastAPI
- Database: MongoDB
- Vector DB: Pinecone
- LLM API: Groq (LLaMA 3)
- PDF Processing: PyPDF2
- Environment Management: Python 3.10+
git clone https://github.com/hit1403/Medic_chatBot.git
cd Medic_chatBotpython -m venv venv
source venv/bin/activate # On Linux/Mac
venv\Scripts\activate # On Windowspip install -r requirements.txtCreate a .env file and add:
MONGO_URI=
DB_NAME=
PINECONE_API_KEY=
PINECONE_INDEX_NAME=
PINECONE_ENV=
GROQ_API_KEY=
UPLOAD_DIR=
API_URL=
uvicorn server.main:app --reloadAPI will be available at: http://127.0.0.1:8000
| 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 |