Empowering Healthcare Accessibility through Secure AI Orchestration
Overburdened medical facilities often leave patients waiting hours for basic triage, delaying critical care and increasing anxiety. The Health Triage & Tracking Agent is an intelligent, secure personal health assistant designed to perform initial symptom assessments and provide safe, actionable guidance. By filtering non-emergency cases and organizing patient data before they even reach the clinic, this system drastically reduces the load on healthcare infrastructure while ensuring universal, immediate access to reliable health information.
Global healthcare systems are experiencing unprecedented strain. Patients struggle to access timely medical advice for preliminary symptoms, while doctors are overwhelmed by administrative data collection. There is a critical need for an automated, secure, and accurate first-line triage system that bridges the gap between patients and professional care.
(Insert architecture diagram here: [Architecture Flow Diagram])
Our architecture decouples the conversational AI from the medical knowledge base using a robust Model Context Protocol (MCP) design, ensuring both fluid patient interaction and rigid data security.
The system leverages a sophisticated multi-agent workflow to simulate a real-world clinical triage process:
- Intake Agent (The Receptionist): Responsible for gathering patient symptoms iteratively. It dynamically asks clarifying questions until sufficient data is collected, enforcing a strict turn limit to prevent conversational loops.
- Assessment Agent (The Specialist): Once the intake is complete, this agent analyzes the compiled symptoms against medical guidelines and patient history to provide a structured clinical summary and actionable, non-prescriptive advice.
- Implementation: Found in
python-ai-agent/app.pywhere the state machine dictates the handoff ([HANDOFF]) betweenworkflow_stage == "intake"andworkflow_stage == "assessment".
To prevent the LLM from hallucinating medical facts or accessing unauthorized data, all critical operations are routed through a secure backend acting as an MCP Server.
- The Java Spring Boot backend provides strict, API-driven Skills:
getUserProfileandgetMedicalGuidelines. - This architecture guarantees that the AI only reasons over verified database records rather than its pre-trained weights.
- Implementation: The MCP server endpoints are defined in the Spring Boot backend, specifically within
backend-mcp-server/src/main/java/com/example/demo/controller/HealthController.java.
For a healthcare application, Data Flow Control is paramount. We implemented strict guardrails to ensure patient privacy and system integrity:
- Real-time Redaction: Sensitive patient information (e.g., real names, National ID numbers) is proactively anonymized via regex before any prompt is sent to the LLM cloud provider.
- System-level Guardrails: The model is strictly instructed via
system_instructionto refuse medication prescriptions and enforce clinical disclaimers. - Environment Isolation: Secrets and database credentials are injected via
.envfiles and environment variables, never hardcoded. - Implementation: The anonymization logic (
redact_sensitive_info) and AI guardrails are implemented directly in the data pipeline withinpython-ai-agent/app.py.
Follow these steps to deploy the system locally.
Ensure you have PostgreSQL running. Create a database for the application. The Spring Boot backend will automatically run the schema migrations via Hibernate.
Navigate to the backend directory, configure your database credentials, and start the MCP Server:
cd backend-mcp-server
# Ensure your database environment variables or application.properties are set
./mvnw spring-boot:runThe backend will run on http://localhost:8080.
Navigate to the AI agent directory, set up your Python environment, and start the Streamlit interface:
cd python-ai-agent
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Create a .env file and add your GEMINI_API_KEY
streamlit run app.py- Multimodal AI Integration: Incorporating computer vision models (e.g., MobileNetV2) to allow patients to upload images of skin rashes or wounds for visual preliminary analysis.
- Wearable Device Syncing: Direct integration with Apple Health and Google Fit to stream real-time vitals (heart rate, SpO2) into the Intake Agent's context.
- Electronic Health Record (EHR) Export: Generating FHIR-compliant triage summaries that can be directly imported into standard hospital management systems.