Dockerized medical RAG app with:
- FastAPI backend for retrieval, reranking, and answer generation
- Next.js frontend with a polished query workspace
- one Docker service that runs both app processes in the same container
The backend wraps the existing prototype behavior behind API endpoints:
GET /api/healthGET /api/examplesPOST /api/query
It uses the shared RAG implementation in rag_query.py, so the CLI and API use the same retrieval and answer generation path.
Local Python dependency management is handled with uv.
The frontend is a Next.js app-router interface built for:
- submitting natural-language medical queries
- showing health and collection state
- rendering structured answers
- exposing source document snippets
It proxies browser requests to the internal FastAPI process, so the browser only talks to one app origin.
- Copy
.env.exampleto.envand fill in your real credentials. - Start the stack:
docker compose up --build- Open:
- app:
http://localhost:3000 - backend docs through the container network:
http://localhost:3000for the UI, internal FastAPI stays on port8000
From the backend folder:
uv sync --dev
uv run pytest
uv run uvicorn app.main:app --reloadbackend/ FastAPI API layer
frontend/ Next.js UI and API proxy routes
memory_bank/ Project context and working notes
rag_query.py Shared RAG service used by CLI and backend
upload_data.py Original upload script
docker compose up --buildnow starts a single containerized app service.- The backend defaults to
drug_docs_v1, but you can override that withQDRANT_COLLECTION. - If your Qdrant collection uses a different name, set it in
.envbefore starting Docker.