A scalable RAG-based AI healthcare backend that provides intelligent medical assistance using LLMs, vector databases, and real-time APIs.
-
🌐 Frontend Repository: 👉 https://github.com/Anmol-pi/MedAI-Frontend
-
🚀 Backend Deployment (Live API): 👉 https://medai-backend-production-a830.up.railway.app
MedAI is an AI-powered healthcare assistant designed to deliver accurate, context-aware medical responses using a Retrieval-Augmented Generation (RAG) pipeline.
The backend integrates advanced AI models with a vector database to ensure responses are relevant, factual, and domain-specific, making it suitable for real-world healthcare support systems.
-
🧠 RAG-based AI System Combines LLMs with vector search for accurate answers
-
🔍 Semantic Search with Vector DB Uses embeddings to retrieve relevant medical context
-
🤖 LLM Integration Generates human-like, contextual responses
-
📂 Document Processing Pipeline Supports ingestion of medical datasets / knowledge sources
-
⚡ FastAPI Backend High-performance API endpoints for frontend integration
-
🔐 Scalable Architecture Designed for production deployment (Railway)
- Python
- FastAPI
- LLM APIs (Groq / LLaMA / etc.)
- Embeddings
- Vector Database (Qdrant)
- REST APIs
- Frontend (React / TypeScript)
User Query
↓
Frontend (React)
↓
FastAPI Backend
↓
Embedding Generation
↓
Vector Search (Qdrant)
↓
Context Retrieval
↓
LLM (Groq / LLaMA)
↓
Final AI Response
MedAI-backend/
│── app/
│ ├── routes/ # API endpoints
│ ├── services/ # Business logic
│ ├── rag/ # RAG pipeline
│ ├── db/ # Database connections
│ └── utils/ # Helper functions
│
│── data/ # Documents / embeddings
│── main.py # Entry point
│── requirements.txt # Dependencies
│── .env # Environment variables
- Python 3.9+
- API Keys (Groq / Cohere / etc.)
- Qdrant setup
git clone <your-repo-url>
cd MedAI-backend
pip install -r requirements.txtCreate a .env file:
GROQ_API_KEY=your_key
QDRANT_URL=your_url
QDRANT_API_KEY=your_keyuvicorn main:app --reload| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Health check |
| POST | /query |
Ask medical questions |
The system follows a Retrieval-Augmented Generation pipeline:
- User sends a query
- Query is converted into embeddings
- Relevant documents are retrieved from vector DB
- Context is passed to LLM
- LLM generates final response
- AI Medical Chatbot
- Health Assistance Platforms
- Clinical Decision Support (basic level)
- Educational Medical Tools
This project is for educational purposes only and should not be used as a substitute for professional medical advice.
- Anmol Kumar Jindal
- HariOm
Contributions are welcome!
fork → clone → create branch → commit → push → PRThis project is licensed under the MIT License
If you like this project:
- ⭐ Star the repo
- 🍴 Fork it
- 🧠 Share ideas