Proactive AI Health Agent
A patient-facing AI assistant and provider portal for a global health-tech company, taken from a MedIQ MVP to production with patient safety and patient-data protection designed in.
Proactive, patient-facing AI health agent for a global health-tech company: symptom triage, specialist routing, booking and follow-ups, built on Gemini (Vertex AI), Mastra and Cloud Run with humans in the loop and HIPAA-aligned data handling.
Stack
9 technologies
Overview
A patient-facing AI assistant for a global health-tech company
The client is a global health-tech company. I work there as a developer and AI engineer on its proactive AI health agent: a patient-facing assistant in the company's mobile app, with a provider portal for the care teams who work alongside it. It helps patients describe what's wrong, find the right kind of care, book a visit and stay on top of follow-ups.
Patient side
A chat assistant in the mobile app for symptom triage, specialist routing, booking and follow-ups.
Provider side
A portal where care teams see what the assistant did and step in when a person needs to.
My role
Developer / AI engineer on the agent: orchestration, safety guardrails, patient-data protection, and integration with the backend and the Flutter app.
Chapter one
The MVP: MedIQ
The agent started as MedIQ, an MVP built to prove the core care journey before any production work began.
Triage
A pre-diagnosis conversation about the patient's symptoms, with red-flag cases flagged for physician review.
Specialist routing
Matches the patient to the nearest suitable doctor or specialist.
Booking
Books the slot where the doctor's schedule and the patient's availability line up.
Follow-ups
Briefs the doctor with a case summary and timeline before the visit, then sends gentle reminders for the next appointment or test.
MedIQ ran as an early pilot with 10 test patients; their feedback on reminders and doctor matching shaped what we kept for production.
Chapter two
What changed for production
Going from MVP to a product real patients use meant changing the model setup, the runtime and how the agent fits into the rest of the company's platform.
Gemini on standard Vertex AI
The model runs through Google Cloud's standard Vertex AI, not a consumer AI API, so patient conversations stay inside the company's cloud environment.
Mastra for the agent
The agent, its tools (routing, booking, follow-ups) and its guardrails are built with Mastra in TypeScript.
Cloud Run
Deployed as a container on Google Cloud Run, next to the rest of the platform.
Wired into the product
Integrated with the company's existing backend and Flutter mobile app, so the assistant works with the same accounts, appointments and records as everything else.
Hard problems solved
The parts that took the most care
A BAA-safe Gemini setup
Configured Gemini so only cloud services covered by the provider's Business Associate Agreement handle patient data, and kept everything else out of that path.
A clinical-safety prompt
Instructions and guardrails that keep the assistant to guidance and navigation: no diagnosis, no prescribing, and clear escalation language when something sounds serious.
PHI redaction in logs
Personal health information is redacted from logs before they're written, so debugging production never means reading patient data.
Mobile and server chat sync
Every message carries a client-generated ID, so the Flutter app and the server keep one chat history: retries and flaky connections don't duplicate or drop messages.
Medical-document checks on uploads
Uploaded files are checked to be medical documents before the agent reads them, so off-topic uploads never reach the model.
Safety by design
Built for patient safety from day one
Designed with HIPAA in mind (HIPAA-aligned), with clinical risk treated as a product requirement rather than an afterthought.
Humans in the loop
Care teams can see conversations in the provider portal and take over; high-risk decisions go to a clinician.
Emergency red-flag escalation
Emergency symptoms stop the normal flow and point the patient to urgent care straight away.
No diagnosis
The assistant guides and routes. It does not diagnose or prescribe.
Per-account data isolation
The agent's tools are scoped to the signed-in account, so each patient only ever sees their own data.
Stack
Frequently asked questions
What does the Proactive AI Health Agent do?
The Proactive AI Health Agent is a patient-facing AI health assistant in a global health-tech company's mobile app. Within a conversation it checks the patient's profile, searches the clinic's own guidelines, sorts urgency and escalates emergencies, recommends the right specialist, and checks existing appointments before requesting a booking. Care teams see its work in a provider portal.
Is the Proactive AI Health Agent HIPAA compliant?
It is designed HIPAA-aligned: the model runs on standard Vertex AI inside the company's Google Cloud project, used only through the access path covered by the provider's Business Associate Agreement, with patient data redacted from logs and each patient's data isolated to their own account. Compliance itself depends on the whole organisation, not one system.
Does the AI diagnose patients?
No. The assistant gives guidance and navigation only: it does not diagnose or prescribe. When symptoms sound serious it stops the normal flow and points the patient to urgent care, and high-risk decisions go to a clinician.
Which model and stack does the Proactive AI Health Agent use?
Gemini on Google Cloud's standard Vertex AI, with the agent, its tools and guardrails built in TypeScript using Mastra, deployed on Cloud Run with Cloud SQL and Cloud Storage, and integrated with the company's existing backend and Flutter mobile app.
How long does it take to build a patient-facing AI assistant like this?
It depends on scope and integrations. The agent went from a MedIQ MVP, piloted with 10 test patients, to production in stages. A focused first version usually starts with a safety review of the existing setup, then the core triage and routing flow, then integrations.
Building healthcare AI?
I help health-tech teams ship AI assistants and agent workflows that are safe for patients and patient data. A free consultation is the quickest way to see if I can help.
Writing about this project
- Building a Proactive AI Health Agent: Lessons From Production
What makes an AI health agent proactive (profile, guidelines, urgency, specialist routing, booking) and the four quiet failures that matter most in production.