Skip to content

Repository files navigation

Medic AI 🚑 — Private Medical RAG Chatbot

Python FastAPI Streamlit LangChain Pinecone Groq

Medic AI is a private, retrieval-augmented medical assistant that reads your uploaded PDFs (such as lab reports or research articles) and explains their contents in clear, plain English. Built to prioritize privacy and accuracy, the assistant only answers using the provided document context.


🌐 Live Demo

Experience the live application here: Medic AI Live Demo

Medic AI Interface Screenshot


🏗️ System Workflow

graph LR
    PDF[1. Upload Medical PDF] --> Split[2. Chunk & Embed]
    Split --> Pinecone[(3. Pinecone Index)]
    Pinecone --> Retrieve[4. Semantic Search]
    Retrieve --> LLM[5. Groq Llama 3.1 Q&A]
    LLM --> Out[6. Safe Plain-English Answer]
    
    style PDF fill:#e6f7ff,stroke:#1890ff,stroke-width:1px
    style Pinecone fill:#f6ffed,stroke:#52c41a,stroke-width:1px
    style LLM fill:#fffbe6,stroke:#d4b106,stroke-width:1px
Loading

✨ Features

  • 📄 Context-Bound Q&A: Answers are strictly limited to your uploaded documents—zero hallucinations.
  • 🧠 Advanced RAG Pipeline: Leverages Google Gemini embeddings (gemini-embedding-2-preview), Pinecone serverless vector database, and Groq llama-3.1-8b-instant.
  • 🔌 Detached Architecture: Async FastAPI backend and modular Streamlit UI frontend.

🚀 Quick Start (Local Setup)

1. Install Dependencies

Activate your virtual environment and run:

# Install server & client packages
pip install -r server/requirements.txt
pip install -r client/requirements.txt

2. Configure API Keys

Create a .env file in the server/ directory and add your secret keys:

GOOGLE_API_KEY=your_google_api_key_here
PINECONE_API_KEY=your_pinecone_api_key_here
GROQ_API_KEY=your_groq_api_key_here

(Other settings like Pinecone index name and cloud/region fallbacks have pre-coded defaults in the project)

3. Run the App

Start both services in separate terminal windows:

# Term 1: Start Backend API (runs on port 8000)
uvicorn server.main:app --reload

# Term 2: Start Streamlit Frontend (runs on port 8501)
streamlit run client/app.py

☁️ Deployment

  • Backend & Frontend (Render Blueprint): Deploys automatically using the provided render.yaml. Remember to manually configure your environment secrets (GOOGLE_API_KEY, PINECONE_API_KEY, GROQ_API_KEY) under the medic-ai-api web service dashboard.
  • Frontend (Streamlit Cloud): Deploy directly using client/app.py as the entrypoint. Add your backend URL as API_URL under your Streamlit Advanced Settings -> Secrets.

Developed with 🩺 by Dhineshkumar272005

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages