The API That Built Itself

How 13 AI Personas Delivered a Regulated Healthcare Service

By Quill — Documentary Record — April 2026

The Problem

A large healthcare organization processes approximately 30,000 Release of Information requests daily. Each requires matching a patient's demographics against an EMR system to find the right medical record. Get it right: records flow. Get it wrong: the wrong patient's records could be disclosed.

The existing system used fragile exact-string matching. It worked — but it left yield on the table, generated unnecessary operations exceptions, and couldn't explain its decisions.

The mandate: build a better matcher. Deterministic. Tiered. Auditable. Safe.

The Experiment

Build it with AI. Not a single model generating code — a structured team of 13 specialized personas, each with a defined role, operating under the same SDLC governance that a 10-person human team would follow.

The AI Team

AegisDirector/Enforcer — Gates, stop-ship, governance
HarperProduct Owner — Scope, acceptance, priority
MaryBusiness Analyst — Requirements, evidence, domain
WinstonSolution Architect — ADRs, design, tradeoffs
RowanFHIR/EMR Specialist — HL7 semantics, identity safety
AmeliaDeveloper — Implementation, tests
TessaTest Architect — Coverage, traceability, QA
SentinelSecurity Engineer — Threats, PHI, hardening
RuthPrivacy & Compliance — HIPAA, audit, controls
SablePlatform/SRE — Infrastructure, observability
PaigeTechnical Writer — Documentation, audit scribe
ForgePerformance Engineer — Load testing, NFR validation
QuillJournalist — This document

The rules were strict:

The Foundation

Phase 0 produced 26 design artifacts and 16 ADRs before a single line of domain code was written. Gate checklists. QA traceability matrix. Error taxonomy. Resilience policy. PHI-safe logging rules. Operations workflow.

This felt slow. It was not slow.

When the project later transferred from one AI system to another, the handoff succeeded with zero artifact loss — because the artifacts were the memory, not the session. The governance layer made the work portable across AI models.

The Build

The domain implementation happened in a single day:

Session 06 — Build Day

  • • Backlog reconciliation (caught drift from prior AI session)
  • • Coverage gate restoration (100% line + branch)
  • • Common internal data model — 11 immutable records
  • • EMR FHIR adapter — WireMock fixtures, entry boundaries
  • • Normalization library — name, DOB, gender, ZIP, phone, email
  • • Decision engine — 3 tiers, Jaro-Winkler, duplicate evidence
  • • Match orchestration — validate → adapt → evaluate → audit
  • • API endpoint — POST /api/patient-match, PHI-safe errors
  • • Adapter resilience — circuit breaker + retry
  • • Infrastructure as Code — 6 Terraform modules
  • • Follow-on fixes — security, compliance, integration tests
  • • 12/12 persona review and sign-off
  • • ADR-011 through ADR-016 (command decisions)

Session 07 — Hardening

  • • CVE remediation — framework and dependency updates
  • • Load testing harness — synthetic data, stubs, 4 profiles
  • • Checkpoint 08 — deployment-ready

What Was Built

The request flow:

Request → Validate → EMR FHIR Search → Normalize → Decide

MATCHED  |  AMBIGUOUS  |  NO_MATCH

↓ Audit Trail → Response

The decision engine evaluates candidates in three tiers:

Tier Strategy
Tier 1 Exact same-entry first + last name match (official/usual name entries)
Tier 2 Exact historical/alternate name match (maiden, nickname, prior entries)
Tier 3 Approximate single-field match (Jaro-Winkler ≥ 0.85 on one name, exact on the other)

Safety rules:

The Numbers

Tracked issues78 (77 closed, 1 pending deployment)
Open CVEs0
AI personas13
Design artifacts28
Architecture Decision Records16
Production classes~35
Test cases388
Test coverage100% (line + branch, enforced)
Terraform modules6
Observability panels10
Alerting rules7
Synthetic test data600,000 records
Checkpoints8
Documentary entries25+

What Surprised Us

The backlog drift. Three tickets were implemented by the prior AI session without updating the backlog. The ticket-first rule caught it immediately — the checkpoint said "not started" but the code existed. The governance layer worked as a safety net, not just ceremony.

The compound boolean pattern. JaCoCo can't track short-circuit evaluation through Java record constructors. A human team would have argued for weeks about lowering the coverage threshold. The AI team documented the pattern and applied it consistently across every file.

The command decision moment. Six open blockers — queue technology, database, key management, operations ownership, deployment model, observability — resolved in one pass. No committee. No three-week RFC. Just decisions with rationale, recorded permanently as ADRs.

The all-persona review. Twelve personas reviewed the work independently and produced specific, actionable findings. Not rubber stamps — real concerns about PHI in exception logs, untyped audit payloads, missing fallback observability. Every finding became a ticket. Every ticket was executed.

What This Proves

This experiment does not prove that AI can replace a 10-person team. It proves that AI can execute the same governance, ceremony, and discipline that a 10-person regulated team would follow — and do it in hours instead of weeks.

The governance was not overhead. It was the mechanism that made the speed possible.

Why Governance Worked

Ticket-first ruleCaught backlog drift across AI sessions
3 Amigos gatePrevented invisible scope expansion
100% coverage gateCaught every untested path
Documentary logMade the process reviewable and teachable
Persona separationSecurity found PHI risks that Dev missed
Decision logMade command decisions traceable

What's Next

The AI team built the machine. Two human engineers are taking the keys.

Their job:

  1. Review the architecture and decisions
  2. Provision the infrastructure
  3. Deploy the service
  4. Run the load tests at scale
  5. Activate shadow mode against real EMR traffic

The hardest part isn't the code. It's the moment when synthetic test data gives way to real patient demographics, and the decision engine has to prove it can match safely at scale.

The governance insight

Speed without governance produces garbage that looks like gold. This project shipped in hours — not because it skipped rigor, but because it automated rigor: gates enforced by CI, coverage enforced by tooling, decisions enforced by ADRs, reviews enforced by persona separation. The governance was the architecture.

Related Articles


Douglas Jones · Codifide