Skip to content

Aruna168/MedRAG-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A multi-domain medical RAG chatbot using Mistral-7B.

Quickstart

  1. Install dependencies
pip install -r requirements.txt
  1. Build vector index (one-time or whenever PDFs change)
python build_index.py
  1. Run the backend (FastAPI on :8000)
uvicorn app.main:app --reload --port 8000
  1. Run the frontend (Vite dev server)
cd frontend
npm install
npm run dev

Ollama (optional local LLM)

If you prefer a local LLM runner, start Ollama and pull Mistral:

./scripts/run_ollama.sh
# or manually:
ollama run mistral

Expose Backend via ngrok

To expose your local FastAPI backend at port 8000 to the internet:

./scripts/expose_ngrok.sh
# prints: Public URL: https://<random>.ngrok-free.app

The hackathon evaluator can call the API like:

curl -X POST "https://<random>.ngrok-free.app/query" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What are symptoms of heart failure?",
    "top_k": 5,
    "domain": "cardiology"
  }'

Frontend -> Backend Request

The frontend sends:

await axios.post('http://localhost:8000/query', {
  query,
  top_k: 5,
  domain,
})

Response shape:

{
  "answer": "... final answer text ...",
  "sources": [
    "cardiology/CardiologyBook.pdf#12-15",
    "cardiology/AnotherSource.pdf#2-3"
  ]
}

Scripts

  • scripts/start_backend.sh: Start FastAPI on port 8000
  • scripts/start_frontend.sh: Start Vite dev server on port 5173
  • scripts/expose_ngrok.sh: Start ngrok and print the public URL
  • scripts/run_ollama.sh: Run Ollama with mistral
Screenshot 2026-02-22 140301 image

About

Offline medical RAG system for textbook based medical question answering using LLMs and vector search

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors