A Clinical Decision Support Agent built with Google Vertex AI (Gemini 1.5) to assist in recognizing and referring suspected cancer based on NICE NG12 guidelines.
- Risk Assessment: Analyze patient data (age, symptoms, medical history) against NICE NG12 criteria.
- RAG (Retrieval-Augmented Generation): Answers are strictly grounded in official NICE guidelines with page-level citations.
- Conversational AI: Multi-turn chat interface for exploring cancer referral criteria.
- Patient Integration: Mock integration with a simulated JSON patient dataset.
- Framework: FastAPI
- LLM: Google Vertex AI (Gemini 1.5 Flash)
- Vector DB: ChromaDB
- Libraries: LangChain, Pydantic, PyPDF
- Python 3.9+
- Node.js & npm
- Google Cloud Project with Vertex AI API enabled
- Application Default Credentials (ADC) for Google Cloud
- (Optional) Docker & Docker Compose
- Clone the repository and navigate to the project directory.
- Create a
.envfile based on the template:GCP_PROJECT_ID=your-project-id GCP_LOCATION=us-central1
- Initialize the backend environment and ingestion:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt python ingest_guidelines.py
Run this from the root directory:
source venv/bin/activate
python main.pyThe backend will be available at http://localhost:8000.
Run this from the /frontend directory:
cd frontend
npm install
npm run devThe frontend will be available at http://localhost:5173.
If you prefer a containerized environment:
docker-compose up --build- Patient Assessment: Enter a Patient ID to get an AI-powered cancer risk assessment grounded in NICE NG12 guidelines.
- NG12 Chat: A conversational agent to ask questions about the guidelines with multi-turn support and citations.
- Modern UI: Built with React, Tailwind CSS, and Framer Motion for a premium, responsive experience.
POST /assess
- Body:
{"patient_id": "PT-101"} - Response: Risk assessment with reasoning and citations.
POST /chat
- Body:
{"message": "What symptoms trigger lung cancer referral?", "history": []} - Response: Grounded explanation with citations.
- Reasoning Loop: The agent first retrieves patient data, then queries the vector store for relevant criteria, and finally synthesizes the assessment.
- Guardrails: Strict system prompts prevent the agent from providing medical advice outside the scope of the NICE guidelines.
- Citations: All responses include references like
[NICE NG12, Page X]for transparency.