- Role
- CTO & Founding Engineer
- Period
- Jun 2026 – present
- Client
- confidential
- Status
- Clinical go-live underway
A clinical AI platform where rules decide and the LLM writes
The full technical foundation of an AI-native preventive-health platform, built from zero in 5 months, with ~2,500 of ~2,900 commits.
Results
Problem
A preventive health and longevity platform for the Canadian market, run with physician partners, needed patient insights, recommendations, reports and SOAP notes written by an LLM. Free-text generation alone could not be trusted there: a model mistake must never become a clinical mistake, and every output has to be auditable.
Constraints
One main engineer, five months, physician review on every clinical change, and a cloud budget to respect. The scope covered a patient app, a doctor hub, an admin console, GCP infrastructure and the medical intelligence engine.
Architecture
Rules decide, the LLM writes. Deterministic, versioned clinical rules make every decision; the model only explains them. A safety gate catches emergencies and critical labs before any LLM call and escalates to clinicians on a 15-minute tier.
- Guarded generation. 9 output types use structured JSON and 9 deterministic checks: grounding, claim entailment, number attribution and prompt-leak detection. Only signed reports need doctor time; everything else that passes is released automatically.
- Lab extraction. PDF parsing, Gemini vision OCR with two independent reads and unit normalisation: 69 of 69 blood values correct across 6 fresh runs, and zero wrong values saved.
- Clinical logic as data. PCL, a domain-specific language (Lark LALR(1) grammar, 18 primitives, three-valued logic), so physician changes ship in hours as replayable catalogue releases (64 to date) instead of code deploys.
- Measurable quality. A reference-patient evaluation gate (347 checks, zero regressions, 30/30 safety replays), 14,000+ automated tests, 23 engine audit rounds and an MCP server with 38 tools to inspect and replay any run.
- Speed and cost. Report generation cut ~8× (639 s to 77 s) by replacing a hot path called ~250,000 times per run with a prebuilt index; fixed GCP cost down ~33%; four reasoning agents consolidated into one call per run.
What I'd do next
Widen the reference-patient set with each physician review, and keep turning clinical decisions (19 documented so far) into rules and checks rather than prompts.
Stack
- Python
- FastAPI
- PostgreSQL
- React Native
- GCP
- Claude
- Gemini
- MCP