Curamind is a full-stack clinical AI assistant that helps answer doctor-facing medical questions using retrieved evidence from biomedical sources. It combines retrieval-augmented generation, patient context, session memory, and response evaluation in a single product.
- Accepts a clinical question from the frontend chat interface
- Uses patient intake context such as name, age, sex, and conditions
- Retrieves relevant medical evidence from stored biomedical data
- Generates a grounded response with citations
- Stores chat sessions and message history
- Runs a post-response audit for faithfulness, relevance, and correctness
- Surfaces trust and evaluation signals in the UI
- Full-stack application with a React frontend and FastAPI backend
- Retrieval pipeline over medical content using embeddings and
pgvector - MMR-style reranking to diversify retrieved evidence
- Gemini-based clinical response generation with fallback model rotation
- Background extraction of evolving patient facts into session state
- Analytics page for response quality monitoring
- JWT-based authentication and protected routes
Frontend
- React
- Vite
- React Router
- Framer Motion
- Recharts
- React Markdown
Backend
- FastAPI
- SQLAlchemy
- PostgreSQL
pgvector- Pydantic
- JWT authentication
AI / Retrieval
- Google Gemini
- Sentence Transformers
- PubMedBERT embeddings
- FAISS and vector search tooling
- Biomedical ingestion scripts for PubMed, DrugBank, and ClinicalTrials
Curamind follows a simple full-stack flow:
- A doctor signs in and opens a consultation session.
- The frontend sends a question plus patient context to the backend.
- The backend retrieves relevant medical chunks from stored biomedical data.
- The generation layer builds a grounded prompt and calls Gemini.
- The answer is stored with session history and returned with citations.
- A background evaluator scores the answer for quality and trust.
- The frontend polls for evaluation results and shows trust badges.
CURAMIND/
├── backend/
│ ├── app/
│ │ ├── core/ # config, database, security, LLM client
│ │ ├── modules/
│ │ │ ├── auth/ # signup, login, password reset
│ │ │ ├── orchestrator/ # main chat flow
│ │ │ ├── search/ # retrieval logic
│ │ │ ├── generation/ # prompt building, LLM calls, evaluation
│ │ │ ├── ingestion/ # medical data pipeline
│ │ │ └── sessions/ # session history APIs
│ │ └── main.py
│ └── tests/
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── services/
│ │ └── utils/
│ └── public/
└── docker-compose.yml
-
backend/app/modules/orchestrator/Handles the main request flow for clinical Q&A, session creation, message storage, and background tasks. -
backend/app/modules/search/Encodes the query, searches vectorized medical records, and reranks results before generation. -
backend/app/modules/generation/Builds the clinical prompt, calls Gemini models, deduplicates citations, and updates patient state. -
backend/app/modules/ingestion/Contains scripts for fetching, cleaning, chunking, embedding, and storing biomedical data.
Start the full stack with:
docker compose up --buildThis starts:
- PostgreSQL with
pgvector - pgAdmin
- FastAPI backend
- React frontend
Typical local ports:
- Frontend:
http://localhost:5174 - Backend:
http://localhost:8000 - pgAdmin:
http://localhost:5050
Backend:
cd backend
pip install -r requirements.txt
cd app
uvicorn main:app --reload --host 0.0.0.0 --port 8000Frontend:
cd frontend
npm install
npm run dev -- --host 0.0.0.0 --port 5174The backend expects a .env file with values similar to:
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_SERVER=
POSTGRES_PORT=
POSTGRES_DB=
SECRET_KEY=
ALGORITHM=
ACCESS_TOKEN_EXPIRE_MINUTES=
GEMINI_API_KEY=
GEMINI_API_KEY_2=
GEMINI_API_KEY_3=The repository includes a multi-step ingestion pipeline under:
backend/app/modules/ingestion/CURAMINDv2/scripts/
This pipeline is designed to:
- fetch biomedical content
- clean and normalize text
- extract entities
- chunk documents
- filter noisy chunks
- generate embeddings
- store metadata for retrieval
The orchestration script is:
python backend/app/modules/ingestion/CURAMINDv2/scripts/run_pipeline.pyBackend tests are located in:
backend/tests/test_smoke.pybackend/tests/unit/
Run tests with:
cd backend
pytest