Mira Mace System Design: From the DME Agent to an Autonomous, Configurable Care-Ops Platform
The expected format: the interviewer describes the product (as it is today, or a version they want), then asks you to extend it. Make the agent more autonomous, make it configurable, turn it into a platform. Your DME take-home is the natural starting point, because it's already one workflow built on a deterministic policy, an engine and an LLM at the edges. This page covers what's known about Mira Mace, a 60-minute plan for the format, the core reframing (from one hardcoded policy to workflows built on shared primitives), autonomy and configurability in depth, the target architecture with data model and runtime, voice, evals, compliance, multi-tenancy for B2B, likely questions with answers, and what to ask at the end.
Part 1 (this page): the overview and argument. Part 2: Deep dive: every box dissected (party profiles and how agents update them, memory in Postgres / pgvector / graph and how it's retrieved, schedules and follow-ups, durability, primitives, gateway, channels, human plane, observability, config). Part 3: Mock scenarios: eight scoped interview scenarios with curveballs, checklists and answer outlines.
TL;DR: the argument in eight lines
- Start from the user, then the flow, then the boxes. Name the advocate, the patient and the vendor, and walk one real case before drawing anything. (The CEO's feedback was "feature first, not user first"; don't repeat it.)
- The reframe: today's take-home is one policy hardcoded around DME. The platform is many workflows built from the same primitives: converse, qualify, obtain, commitment, consent, book, notify, human task, escalate.
- Autonomy is not one switch. It's granted per workflow step, per risk class, per tenant, and earned with metrics (L0 suggest → L4 act with sampled audit). Every handled escalation type becomes a new automated branch.
- Configurability has layers: platform code (primitives) → workflow definitions (versioned data) → tenant/enterprise config → patient preferences → learned knowledge (vendor facts). Each layer has an owner and a release process.
- Decisions stay deterministic and replayable; the LLM talks, reads, extracts and drafts. Open-ended requests go to a bounded planner that can only compose allowed primitives, under policy checks. "Workflows where you can, agents where you must."
- The runtime is a durable workflow engine: an event log per case, a generic scheduler (today's
decide()generalised), timers, one writer per case, idempotent actions, correlation for inbound faxes and callbacks. - Humans are part of the system, not a fallback. The Mira agent and workmate become the advocate's console: approval queues, exception handling, one-click decisions, and every correction feeds the evals.
- Quality is a number: autonomous resolution rate, correct-escalation rate, fact accuracy against ground truth, time to resolution, calls per case; gated by simulations, replays, shadow mode and canaries.
What's known, and what's guessed
- The format comes from a former colleague who interviewed there recently: the system design round was an extension of the DME assignment, about system-level architecture to make the agent more autonomous, more configurable, and a platform.
- The product today comes from the CEO's own description at the end of your 14 Nov call (paraphrased from the transcript; the speech-to-text was imperfect).
- The take-home is your repo:
care-coordination-agent. They have read it. - Public facts about the company are in the next section, with sources, and marked where unverified.
- Guessed: the exact prompt. Prepare for three variants: (1) "here's the DME agent; make it autonomous and configurable"; (2) "here's our product (advocates + companion + calling); design the platform under it"; (3) "an enterprise customer wants X; how does the platform support it?"
What Mira Mace says publicly
Researched 18 Nov 2026. The Ashby board and the trust centre load with JavaScript and couldn't be read, so the job details below are paraphrased from Built In re-posts.
- The offer: each Medicare beneficiary gets a dedicated care advocate, reachable by text or phone: "Imagine a health expert doing it for you — covered by Medicare." Advocates explain coverage, appeal prior-auth denials and delays, find in-network providers and in-home support, help with chronic illness, get records and approvals ready before appointments, and review bills. Onboarding: sign up → care plan → the advocate takes over. miramace.com
- Structure: clinical services are provided by Mira Mace Medical Group PA, a physician-owned professional corporation; Mira Mace provides "non-clinical administrative and technology support". miramace.com Inference, not verified: this looks like a physician-group model billing Medicare for navigation or care-management services, which would make traditional Medicare the payer. Ask, don't assert.
- Company: founded 2025, about 20 employees (Built In); investors named in job ads as Foundation Capital and Define Ventures plus angels (not independently confirmed). Values: Patient First, Sense of Urgency, Ownership, Insist on the Highest Standards, Question Everything. Built In Agents JD
- Stack (from the Staff Engineer ad): FastAPI, Next.js, Postgres; Python and TypeScript. The ad stresses systems that "must not fail or produce silently wrong results", tooling so non-engineers can ship changes safely, and build-vs-buy ownership. Staff Engineer JD That last phrase is the configurability theme in their own words.
- Agents JD: agents that complete multi-step tasks across systems and know when to hand off to a human; evaluation and regression detection, "make quality a number we can move, not a vibe"; copilots; architecture that scales. Built In
- Voice JD: own the real-time pipeline (telephony, STT, LLM orchestration, TTS, endpointing, barge-in, latency); replayable audio and transcripts, regression suites, per-turn scoring; IVRs, holds, transfers, voicemail, dropped calls, older callers; "thousands of calls a day" with clean human handoffs; SIP/PSTN, "Twilio or similar". Built In
- HIPAA: the site shows a "HIPAA Compliant" badge linking to trust.miramace.com (not readable here, so subprocessors are unknown). miramace.com
- Not found publicly: the names "Mira agent" / "Mira companion", B2B offerings, founder names and roles, telephony or model vendors. Those come only from your call; don't attribute them to public sources.
Adjacent companies (from general knowledge, not re-verified today): Solace (Medicare patient advocates), Infinitus (AI calls to payers for benefits and prior auth), Hippocratic AI (healthcare voice agents), Assort Health (inbound voice for specialty practices), Rightway (employer-sold navigation), Cohere Health (payer-side prior auth). Useful only if they ask "who else does this?"
The product as the CEO described it (14 Nov)
| Surface | Users | What it does (per the CEO) | Owner on the team |
|---|---|---|---|
| Mira agent | Care advocates | Daily assistant: before calling a patient or a vendor, deciding who to focus on, sending a fax. Vendor search now hits Mira's own vetted database: every interaction enriches the vendor record, so advocates use it instead of ChatGPT or Claude, because humans vetted the quality. | 2 engineers: one UX, one core ML and quality |
| AI phone calling to vendors | Advocates | "Press a button": the AI calls a vendor and comes back with whether it carries the product, covers the insurance and serves the ZIP code. Used to process external vendor lists not touched before. | Voice lead |
| Workmate | Advocates | Moving from "an agent you ask for tasks" to an always-present companion in voice mode that follows the advocate across screens, guiding and steering what to do and when. | Mira agent team / voice |
| Voice activation agent | New customers (inbound) | People calling to sign up used to reach a team of about 20 onboarding/support staff; the agent now handles these activation calls and automates onboarding. | Voice lead |
| Mira companion | Patients | A list of all their doctors and their care advocate. A patient types a question for, say, their cardiologist; the AI calls the office, collects the answer and brings it back. Voice mode like ChatGPT/Claude voice; guidance based on their day, progress and symptoms, which creates new tasks and requests for advocates. | 1 engineer, built from scratch to launch |
| B2B / enterprise | Enterprise customers | Enterprises have their own needs, so the product has to be customised for them. | 1 engineer owns the whole B2B motion |
Team: about 6–7 engineers, each with large scope, working directly with customers. Voice: "one person leads all of voice" across advocates, patients and activations. That's the seat the Voice role would fill or join.
Look at the list. Vendor calling, the companion's "AI calls your cardiologist", the activation agent, the fax step in the Mira agent and your DME take-home are the same few primitives in different arrangements: converse with a party over a channel, extract typed facts with evidence, track a promise, ask a human for one step, notify someone. Each was probably built separately by a different engineer. The platform play is to make them one runtime with shared primitives, shared knowledge (the vendor DB), shared evals and shared compliance, so the B2B engineer can configure a new enterprise workflow without writing a new agent. Saying this early shows you listened to the CEO and that you think in platforms.
The 60-minute plan for an "extend this product" round
| Minutes | Phase | What you say / do |
|---|---|---|
| 0–3 | Restate the picture | Play back the product they described in one sentence per surface. "So today: advocates use the Mira agent, the AI can call vendors, patients use the companion. You want the agent to take on more of a case end to end, and to be configurable per customer. Right?" |
| 3–9 | Clarify | Ask 5–6 questions (list below): who's the user of "autonomy" (advocate? patient? enterprise?), what does success mean, what must never go wrong, scale, which workflows, what's configurable and by whom. |
| 9–14 | One case, end to end | Walk a concrete case through the user's eyes: "Mrs. Martinez tells the companion she needs a wheelchair…". Mark where a human is involved today and where the agent would act alone. |
| 14–20 | Reframe + principles | "Today it's one hardcoded policy. Here's how it becomes a platform": primitives, workflow definitions, the autonomy ladder, decisions in code with the LLM at the edges. |
| 20–35 | Architecture | Draw the target architecture: intake → case service → workflow runtime → primitives → channels; knowledge plane; human plane; eval plane. Walk the case through the boxes. |
| 35–48 | Deep dive | Offer two: "the runtime and data model (how a workflow is defined and executed)" or "how autonomy is granted and measured". Go to LLD: tables, the scheduler pseudocode, a workflow definition. |
| 48–56 | Failure, safety, scale | Stuck cases, provider outages, wrong facts, PHI disclosure, broken promises, 10× volume, a bad prompt release. |
| 56–60 | Rollout + wrap-up | Phased plan sized for a 6–7 person team; top two risks; what you'd build first and why. |
Clarifying questions worth asking
Product
- "Autonomous for whom? Do we want fewer advocate-hours per case, faster resolution for the patient, or more cases per advocate?" (Pick the metric before the design.)
- "Which workflows matter most beyond DME? Specialist questions, appointments, prescriptions, prior auth, billing disputes?"
- "What's configurable, and by whom? An engineer, an ops lead, the enterprise customer, the advocate?"
- "Is an enterprise customer a health plan, a provider group, an employer?" (Changes who owns the patient relationship and the rules.)
Constraints
- "What must never go wrong?" (Disclosing PHI to the wrong person, committing a patient to a cost, a wrong medical statement.)
- "Scale: patients, cases per day, calls per day, peak concurrency?"
- "Channels: phone, fax, SMS, email, payer and provider portals, EHR integrations?"
- "Which parts must a human approve today, for legal or trust reasons?"
If they say "you decide", state assumptions with numbers and move on. See the estimates section for a ready set.
- "Feature first, not user first." Open with a user journey (advocate's day, patient's request), not with "an orchestrator and some agents". Every box should answer "which step of the journey does this serve?"
- "Talking like an engineer." In a system design round engineering talk is expected, but tie each choice to an outcome: "event sourcing, so that when a patient asks why their wheelchair is late, the advocate sees the whole history in one screen".
- "Don't worry about limitations." Don't spend minutes on what models can't do yet. Design for what's coming (better models, cheaper calls), and put the limitations where they belong: in guardrails and evals, stated once.
Your starting point: the DME take-home in 90 seconds
Have this ready as a spoken summary; they've read the code, so it anchors everything that follows.
decide(case, now) that returns one of ten typed actions; an engine performs it; the result becomes an event; state is a fold of the events. The LLM only holds the call and turns transcripts into typed facts with evidence quotes. There are no confidence scores: unknown is a real state. It ran against a simulated world of difficult suppliers and clinics."policy.decide(case, now) → Action pure: no I/O, no model, no network engine performs the Action calls / faxes / books the result becomes an Event the only way state changes reducer folds it into state case = replay(events)
What already generalises, and what doesn't
Already a platform idea
- Decide / perform / event / fold: the shape of a durable workflow engine.
- Typed facts with Ternary values and evidence quotes.
- Commitments with a verify-at time ("a promise is not an outcome").
RequestHumanTask(block one track, keep the rest going) vsEscalate(hand the case over), with typed reasons.- Business-hours clock and backoff derived from history.
- A simulated world with personas as the eval set.
Hardcoded to one workflow
- Gates (
stocks_k0001), tracks (ORDER / SUPPLIER / PATIENT) and priorities live inpolicy.py. - The engine has DME-specific perform methods and makes a few decisions itself.
- Strings like "Dr. Chen's office" and "K0001" in the policy.
- One case at a time, one action per step, the log carried by the browser, no persistence or auth.
- Phone and fax are simulated; no real telephony, IVR or inbound.
- Facts die with the case: nothing is written back to a vendor database.
An independent review of the repo found these. If the interviewer has read the code, naming them first reads as maturity; each is also a natural lead-in to the platform design.
- A provider error can leave a case stuck OPEN with no escalation. An LLM failure mid-call is recorded as "no answer". Platform answer: a watchdog (any open case with nothing due and nothing scheduled raises a typed escalation), and infrastructure errors never count as a dial attempt.
- Grounding checks words, not meaning: "we do not accept assignment" can ground a "yes". Platform answer: per-field quotes plus an entailment check (a small model or NLI classifier asked "does this quote support
accepts_assignment=yes?"), and a re-ask when it fails. - The eval is small and partly circular: 6 seeded worlds, an LLM-simulated world grading an LLM agent, the patient always agreeable, extraction never compared against the simulator's truth. Platform answer: per-field precision and recall against persona truth, adversarial personas, repeated runs with variance, and replay of real calls.
- The engine makes some decisions itself (gives up after broken holds, defaults lead time), contradicting "the engine holds no opinions". Platform answer: those move into the workflow definition as named knobs.
- PHI handling gaps: no identity check before discussing the patient with whoever answers; the agent introduces itself as a person. Platform answer: identity verification and AI/recording disclosure are properties of the converse primitive, not of a prompt.
The reframe: from one policy to workflows built on primitives
The key observation: today's decide() is already a generic scheduler with DME details baked in. It finds which tracks are due, checks join conditions, picks the highest-priority action, otherwise waits. Extract the DME specifics as data, keep the scheduler generic, and the same engine runs any workflow.
The primitives (the platform's verbs)
| Primitive | In the take-home | Generalised | Where Mira already uses it |
|---|---|---|---|
| Fact | Ternary + evidence quote, grounded() | Typed field on an entity, with value, evidence, source, observed-at, verified-by | Vendor enrichment DB |
| Party | Supplier, clinic, patient | Any counterparty with channels, hours, timezone, disclosure rules, identity checks | Vendors, doctors' offices, patients, payers |
| Converse | caller.py + extract.py | "Ask this party these questions over this channel, within this disclosure policy" → typed facts | Vendor calling, companion "ask my cardiologist", activations |
| Qualify | Four gates + speed tiebreak | Search a candidate set against gates, rank by a scoring rule | Vendor search |
| Obtain | Chase the written order: phone ×3, fax, verify | Get a document or answer from a party, escalating channels on a ladder | Faxes, records, prescriptions |
| Commitment | Promise + verify_at | Any "they said they'd do X by Y", checked independently | "The office will call back tomorrow" |
| Consent | Cost call; "agreement without understanding is not consent" | Informed agreement from a subject about stated terms, recorded with evidence | Cost, sharing records, booking |
| Book | ScheduleDelivery + hold confirmation | Reserve a slot with a party, then confirm and re-verify | Deliveries, appointments |
| Notify | Tell the patient the delivery window | Message a party on their preferred channel, with read/ack tracking | Companion messages, SMS |
| Human task / Escalate | Typed reasons; block one track | Same, routed to the right queue (advocate, supervisor, enterprise contact) with SLAs | Advocate tasks created by the companion |
| Wait / clock | Business hours, backoff | Per-party hours and timezones, durable timers | Everywhere |
The same primitives, Mira's actual workflows
| Workflow | Tracks (in parallel) | Join → finish |
|---|---|---|
| DME delivery (take-home) | qualify(suppliers) ∥ obtain(written order from clinic) ∥ consent(patient, cost) | book(best supplier) → notify(patient) → verify delivery → close |
| Vendor enrichment (live today) | converse(vendor, {carries item, takes insurance, serves ZIP}) | write facts to the vendor DB with evidence → close |
| Companion: "ask my cardiologist" | converse(provider office, patient's question) with identity/consent on file | commitment if "we'll call back" → notify(patient, answer) → task for advocate if clinical judgement is needed |
| Voice activation (inbound) | converse(caller, activation script) → verify identity → collect consents | create account → notify(advocate) → schedule welcome |
| Appointment scheduling | qualify(specialists: in network, accepting new patients, distance) ∥ obtain(referral) | book(appointment) → notify → reminder → verify attendance |
| Prior authorization follow-up | obtain(clinical notes from provider) → converse(payer status line or portal) | commitment("decision in 5 days") → notify → escalate on denial |
| Billing dispute | obtain(EOB, itemised bill) → converse(provider billing, payer) | commitment(corrected claim) → verify → notify |
The test of the abstraction is the second and third workflow, not the first. Say that out loud: you'd extract primitives from DME, then prove them by building the companion's provider-question workflow on the same runtime, and only then consider a definition language.
Making it autonomous
"More autonomous" is ambiguous; define it before designing it. A useful definition: the fraction of a case's steps the system completes correctly without a human, at an acceptable risk. Then autonomy becomes something you grant per step, measure, and expand.
The autonomy ladder (per step, not per product)
| Level | What the agent does | Human role | Example at Mira |
|---|---|---|---|
| L0 · Suggest | Recommends the next action | Does it | Workmate: "you should call Lakeshore next; they open at 9" |
| L1 · Draft | Prepares the action fully (call script, fax, message) | Approves with one click | Fax to the clinic drafted with the order request; advocate sends |
| L2 · Act, then report | Does it, notifies immediately, easy to undo | Reviews after the fact | Vendor qualification calls; info-gathering calls to offices |
| L3 · Act, escalate on exception | Runs the whole step; hands over only on a typed exception | Handles exceptions | Chasing the written order; booking a delivery once consent exists |
| L4 · Fully autonomous, audited | Runs end to end; humans sample for QA | Audits a sample | Vendor enrichment of a new list; reminder calls |
The level is a property of (workflow step, risk class, tenant), stored as config, and changed only when the metrics justify it. That makes "more autonomous" a release process, not a leap of faith.
Deciding what can be autonomous: risk × reversibility × verifiability
| Action | Risk if wrong | Reversible? | Can we verify it independently? | Starting level |
|---|---|---|---|---|
| Ask a vendor what they stock | Low: a wasted call | Yes | Yes (another call, the vendor DB) | L3–L4 |
| Request records or an order from a clinic | Low–medium | Mostly | Yes (the document arrives or not) | L3 |
| Send a document containing PHI | High: disclosure to the wrong party | No | Partly (verified fax number, recipient check) | L1 → L3 once the recipient is verified |
| Tell a patient what they'll owe | High: financial harm, trust | Hard | Partly (plan terms, fee schedule) | L1 until coverage terms are typed data |
| Commit the patient to a booking | Medium | Usually (cancel) | Yes (confirmation) | L3 after consent is on record |
| Relay a clinician's answer to a patient | High: medical content | No | Partly (quote the source verbatim) | L2 with verbatim relay; anything interpretive goes to an advocate |
| Anything resembling medical advice or plan enrollment advice | Very high, regulated | No | No | Never autonomous; route to a licensed human |
Seven mechanisms that actually increase autonomy
- Turn escalations into branches. Every escalation has a typed reason, so you can count them. The top reason each month becomes a new handled path (e.g. "supplier wants the MBI" → a secure-fax branch that sends identifiers in writing instead of escalating). Autonomy grows as the escalation distribution shrinks. This is the single best answer to "how do you make it more autonomous?"
- Close the loop with the world. Today every fact is pulled by dialling out. Add inbound: faxes arriving (OCR + classify + match to a case), suppliers calling back, delivery confirmations by SMS, the companion's patient messages. Without inbound, the agent waits for humans to tell it what happened.
- Memory that outlives the case. Vendor facts with freshness ("stocks K0001, confirmed 3 days ago by phone"), behavioural facts ("never answers before 10am", "always asks for the written order first"), patient preferences (language, caregiver, best time). The fiftieth case shouldn't repeat the first case's calls. Mira already has this for vendors; make every workflow read and write it.
- Verification instead of trust. Cross-check facts across sources, re-verify stale facts before relying on them, verify promises at their due time, verify bookings again the day before. Autonomy is safe only when the system can check its own work.
- A bounded planner for the long tail. Requests that match no workflow (a companion message like "my pharmacy says my prescription needs approval") go to a planner that can only compose existing primitives into a proposed plan, checked against policy, approved by an advocate at L1. Plans that get approved repeatedly become new workflow definitions. Workflows where you can, agents where you must.
- Self-monitoring. A watchdog for stuck cases (open, nothing due, nothing scheduled), SLA timers per step, provider health with circuit breakers, and a budget per case (calls, model spend, elapsed days) that escalates when exceeded.
- Learn from the humans in the loop. Every advocate approval, edit or override is a labelled example: what the agent proposed, what the human did, and why. That's the training and eval set for raising a step's level.
- Yes: holding conversations; extracting typed facts with evidence; classifying inbound documents and messages; summarising a case for an advocate; drafting workflow definitions from an SOP (reviewed and simulation-tested before release); proposing plans for unmatched requests.
- No: deciding eligibility, cost, sequencing, retries, when to give up, or what counts as consent. Those stay in deterministic, replayable code, so every decision has a stored reason and the same inputs give the same answer.
- Why it matters to them: "why did the agent do that?" has to be answerable to an advocate, a patient, an enterprise customer and, eventually, an auditor.
Making it configurable
"Configurable" means different things to different people. Separate the layers, give each an owner, a storage format and a release process.
| Layer | What's in it | Who changes it | How it's released |
|---|---|---|---|
| 1. Platform primitives | Converse, qualify, obtain, consent, book, notify, the scheduler, guards, channels | Engineers | Code review, tests, deploy |
| 2. Workflow definitions | Tracks, joins, gates, priorities, knobs (retry counts, timeouts), escalation reasons, question banks, prompts per step, autonomy level per step | Engineers + ops leads | Versioned; must pass the workflow's simulation suite; canary; each case pinned to the version it started with |
| 3. Tenant / enterprise config | Which workflows are enabled, their rules (e.g. preferred suppliers, network lists), escalation contacts, SLAs, channels, branding and voice for patient-facing surfaces, reporting | B2B engineer, then customer success, eventually the customer in a console | Versioned per tenant, validated against a schema, previewed in simulation |
| 4. Patient preferences | Language, caregiver contact and permissions, contact hours and channel, accessibility (hearing), consent records | Patient, advocate | Immediate, audited |
| 5. Learned knowledge | Vendor facts and behaviours, provider office quirks, payer phone trees | The system, with human vetting | Written continuously with provenance; facts decay and get re-verified |
How a workflow is expressed: the key design choice
| Option | For | Against |
|---|---|---|
A. Each workflow is code (a Python decide()) | Most flexible; what the take-home does | Every new workflow needs an engineer; logic copied between workflows |
| B. Fully declarative language (YAML / visual graph) | Ops can author; easy to visualise and diff | Grows into a bad programming language; hard to test edge cases |
| C. An LLM planner decides every step | Handles novelty | Gives up determinism, replay, auditability and cost control |
| D. Hybrid (recommended) | Declarative tracks, joins, gates, knobs and autonomy levels; small typed code hooks for unusual conditions; a bounded planner only for unmatched requests | You must police what goes into hooks, and keep the definition language small |
One case, through the user's eyes first
Walk this before drawing boxes. It shows user-first thinking and gives every box a reason to exist.
- Patient (companion, 7pm): "My doctor says I need a wheelchair. I don't know where to get one." The companion acknowledges, asks two clarifying questions (which doctor; is anyone helping at home), and says "your advocate's team will handle it; I'll keep you posted here."
- Intake: the message is classified as a DME request, matched to the DME delivery workflow, and a case opens with the patient's profile, plan and preferences attached. If nothing matched, the planner would draft a plan for an advocate to approve.
- Overnight: the system schedules everything for business hours, pre-ranks suppliers from the vendor database (already-known facts skip the call), and drafts the order request to the doctor's office.
- Morning (advocate): the advocate's inbox shows one item: "Approve fax to Dr. Chen's office requesting the written order" (L1, because it's PHI to a verified fax number). One click. Everything else proceeds without them.
- Day 1: qualification calls run in parallel (L3); facts are written back to the vendor DB with evidence. The clinic promises the order "by tomorrow" → a commitment with a verify-at time.
- Day 2: the promise is broken → the system calls again, then faxes. The patient gets a companion update: "Still waiting on Dr. Chen's office; we've followed up."
- Day 3: the order arrives by fax → OCR, classified as a written order, matched to the case, coded K0001 as expected. The cost call to the patient: informed consent recorded with the quote. Booking with the best supplier; the patient is told the date.
- Day before delivery: the system re-verifies the booking. After delivery: confirms with the patient, closes the case, and the supplier's reliability is updated for next time.
The advocate touched the case once. That's the autonomy metric made concrete.
Target architecture
What each part is responsible for
| Component | Responsibility | Key decision |
|---|---|---|
| Intake & case service | Turn any request (companion message, advocate ask, enterprise referral, inbound fax/call) into a case on a workflow, or attach it to an existing case | Classification by LLM with a closed set of workflow labels plus "none"; "none" goes to the planner, never to a guessed workflow |
| Workflow runtime | Durable execution: event log, scheduler, timers, action outbox, one writer per case | Postgres-based (fits their stack) vs Temporal; see below |
| Autonomy gate | Before any action executes, check its risk class against the step's autonomy level and policies; downgrade to "request approval" when needed | A single choke point, so autonomy is changed by config and audited in one place |
| Primitives | Reusable state machines (converse, qualify, obtain, …), each exposing next(state, params, now) | Domain-agnostic; workflow specifics come in as parameters |
| LLM gateway | All model calls: routing, fallbacks, timeouts, schema validation, guards, cost tracking, PHI redaction in logs | One place for provider BAAs, retries and "this output is unusable" handling |
| Channels | Voice (telephony + real-time pipeline), fax, SMS, email, portals; each produces interaction records | Every channel emits the same Interaction shape, so primitives don't care which channel was used |
| Knowledge plane | Entities and facts with provenance and freshness; patient profiles and consents; definitions and tenant config | Facts are append-only with evidence; "current value" is a view; stale facts trigger re-verification |
| Human plane | Advocate inbox with approvals, exceptions and human tasks; QA sampling | The Mira agent and workmate become the UI over this queue; every human decision is captured as a label |
| Eval & observability | Traces, recordings, replays, simulations, metrics, release gates | Every event carries workflow version, prompt version, model and autonomy level |
Data model (LLD)
-- definitions and config: versioned, immutable once live
workflow_definitions(id, version, spec JSONB, status draft|sim_passed|canary|live|retired,
created_by, created_at, PRIMARY KEY (id, version))
tenant_configs(tenant_id, version, spec JSONB, created_by, created_at, PRIMARY KEY (tenant_id, version))
autonomy_policies(tenant_id, workflow_id, step, level SMALLINT, risk_class,
min_metrics JSONB, approved_by, effective_at)
-- the case and its history
cases(id, tenant_id, patient_id, workflow_id, workflow_version, tenant_config_version,
status open|waiting_human|escalated|closed, opened_at, closed_at, outcome)
case_events(case_id, seq, type, payload JSONB, actor policy|llm|human|world|system,
workflow_version, prompt_version, model, created_at,
PRIMARY KEY (case_id, seq)) -- append-only; the audit trail
case_snapshots(case_id, seq, state JSONB) -- so replay doesn't start from zero
-- execution
actions(id, case_id, decided_at_seq, track, type, params JSONB,
idempotency_key UNIQUE, status pending|running|done|failed|cancelled,
attempts, next_attempt_at, result_seq) -- the outbox
timers(case_id, due_at, reason, INDEX (due_at))
case_leases(case_id PRIMARY KEY, worker_id, expires_at) -- one writer per case
-- humans
tasks(id, case_id, kind approval|exception|human_step, blocks_track, queue,
assignee, status, sla_due_at, packet JSONB, resolution JSONB)
-- the world
entities(id, scope global|tenant, tenant_id NULL, kind vendor|provider|payer|pharmacy,
name, npi, phones, fax, address, hours, timezone)
facts(id, entity_id, field, value, evidence_quote, source_interaction_id,
observed_at, verified_by llm|human|document, expires_at) -- append-only
interactions(id, case_id, entity_id, channel voice|fax|sms|email|portal, direction,
started_at, ended_at, outcome, recording_uri, transcript_uri, step)
consents(id, patient_id, kind, terms, evidence_interaction_id, given_at, revoked_at)
patients(id, tenant_id, name, dob, plan, language, timezone, caregiver_id,
contact_prefs JSONB) -- PHI: encrypted columns, RLS
- Why an event log and not just a status column: it's the audit trail, the debugging tool ("replay case X at seq 40"), the source for metrics, and it lets a new workflow version be tested by replaying old cases. The take-home already proves the model.
- Why facts are append-only: a vendor's answer can change; keeping every observation with its evidence and date lets you show "who told us, when" and decay stale facts instead of overwriting them.
- Why version pinning: a case that started on definition v7 finishes on v7 unless explicitly migrated, so a release never changes the meaning of events already written.
- Tenancy:
tenant_idon every row and Postgres row-level security; global entities (public business facts about a vendor) are shared, tenant facts (negotiated preferences, notes) are not, and PHI is never global.
The runtime: how a workflow executes
A workflow definition
workflow: dme_delivery
version: 8
tracks:
supplier:
primitive: qualify
candidates: { source: vendor_db, filter: { serves_zip: $patient.zip, item: $case.hcpcs } }
gates: [accepts_new_medicare_patients, stocks_item, accepts_assignment, serves_patient_area]
rank_by: earliest_delivery_days
converse: { channel: voice, questions: qbank/dme_supplier_v3, disclosure: minimum_necessary }
knobs: { max_dials: 3, max_conversations: 3, parallel_calls: 3, stop_when_delivery_days_le: 5 }
autonomy: L3
order:
primitive: obtain
document: standard_written_order
from: $case.ordering_provider
ladder: [ { channel: voice, attempts: 3 }, { channel: fax, verify_after: 1bd } ]
expect: { hcpcs: $case.hcpcs } # mismatch → ORDER_CODING_MISMATCH
autonomy: { voice: L3, fax: L1 } # fax carries PHI: approve until recipient verified
consent:
primitive: consent
subject: $patient
terms: { coinsurance: "20%", item: $case.item }
requires: [ supplier.has_qualified ]
autonomy: L2
joins:
book:
primitive: book
requires: [ supplier.best, order.received, consent.yes ]
steps: [ send_order_to_supplier, schedule_delivery, reverify_day_before ]
then: [ notify(patient, delivery_window), verify_delivered, close ]
escalations: [ no_qualified_supplier, order_unobtainable, order_coding_mismatch,
patient_declined_cost, consent_not_informed, patient_unreachable, stuck ]
priorities: [ order, supplier, consent, book ] # longest pole first
The same primitives, a different workflow: the companion's "ask my cardiologist".
workflow: provider_question
version: 2
tracks:
ask:
primitive: converse
party: $case.provider_office
goal: "get an answer to the patient's question"
payload: { question: $case.patient_message }
precheck: [ patient_authorised_contact, provider_verified_number ]
on_promise: commitment # "nurse will call back tomorrow"
autonomy: L3
joins:
relay:
requires: [ ask.answered ]
primitive: notify
to: $patient
content: verbatim_with_source # never paraphrase clinical content
route_to_advocate_if: [ answer_is_clinical_judgement, patient_distress ]
autonomy: L2
escalations: [ provider_unreachable, answer_needs_clinician, stuck ]
The generic scheduler (today's decide(), generalised)
def decide(case, defn, now) -> list[Action]:
if (t := defn.terminal_condition(case)): # coding mismatch, declined, …
return [Escalate(t.reason, packet(case))]
ready, due = [], []
for track in defn.tracks_and_joins():
if case.blocked(track) or not track.requirements_met(case):
continue
result = PRIMITIVES[track.primitive].next(case.state(track), track.params, now)
match result:
case Act(action): ready.append((track.priority, track, action))
case DueAt(t): due.append(t)
case Failed(reason): return [Escalate(reason, packet(case))]
case Done(): pass
if ready:
chosen = pick(ready, max_parallel=defn.knobs.parallel_actions) # by priority
return [autonomy_gate(case, track, a) for _, track, a in chosen] # may become RequestApproval
if due:
return [Wait(until=min(due))]
if case.open_tasks():
return [Wait(until=next_business_day(now))]
return [Escalate("stuck", packet(case))] # the watchdog: never idle silently
- The last line fixes the take-home's stuck-case bug structurally: "nothing to do" is never a silent state.
- It returns a list, so independent tracks run in parallel (three supplier calls at once), bounded by a knob.
autonomy_gateis where L0–L4 is enforced: an L1 step turnsSendFaxintoRequestApproval(SendFax), which becomes a task in the advocate's inbox.
The execution loop
trigger: new event on a case, or a timer is due
└▶ worker takes the case lease (one writer per case; SELECT … FOR UPDATE SKIP LOCKED)
└▶ load snapshot + events since → state
└▶ decide(state, definition@pinned_version, now) → actions
└▶ ONE transaction: append ActionDecided events + insert outbox rows + set timer
executors (separate pools per channel) pick outbox rows
└▶ perform with idempotency_key (call, fax, SMS, model call) — minutes, not milliseconds
└▶ append result events (CallCompleted, FactsExtracted, FaxDelivered …) → triggers the case again
- Deciding is fast and transactional; doing is slow and asynchronous. A phone call takes minutes; it must never hold a lock or a transaction open.
- Idempotency: each action's key is
case_id:decided_at_seq:track, so a retried executor never places a second call or sends a second fax. - Crash safety: if a worker dies after deciding but before executing, the outbox row is still there; if it dies mid-call, the call's provider webhook or a timeout produces a result event.
Build on Postgres, or adopt Temporal?
| Postgres event store + outbox + timers | Temporal | |
|---|---|---|
| Fit | Matches their stack (Postgres, FastAPI); the take-home already replays deterministically | Purpose-built: durable timers, retries, signals, history; workflow code must be deterministic, activities do the I/O |
| Cost | You build leases, timers, retries, versioning yourself | New infrastructure to run (or a paid cloud), new mental model, versioning rules for workflow code |
| Querying | Cases and events are just tables: dashboards, metrics and the advocate UI read them directly | History lives in Temporal; you still project into Postgres for product queries |
| My call | Start on Postgres with a small, well-tested runtime (team of 6–7, one stack). The mapping to Temporal is clean (decide = workflow code, primitives = activities, events = history), so migrate if timers and retries start to dominate the engineering time. | |
Inbound: when the world pushes back
- Every waiting track registers an expectation: "case 123 expects a standard written order from Sunrise Family Medicine, patient Eleanor Martinez, item K0001".
- A fax arrives: OCR → classify the document type → extract identifiers (patient name, DOB, ordering provider, item code) → match against open expectations. Two independent identifiers match → attach automatically; one or ambiguous → a human task "match this fax", with candidates ranked.
- A vendor calls back: caller ID → entity → its open cases. One case → continue it. Several → the agent asks which patient it's about, within the disclosure rules, or takes a message.
- Unsolicited news ("we can't deliver Tuesday after all") reopens the relevant track; a closed case can be reopened by a new event within a window.
- Patient messages from the companion attach to their open cases first; only otherwise do they start a new one.
The human plane: advocates as part of the system
- One inbox, three kinds of item: approvals (an L1 action waiting for a click), exceptions (an escalation with a typed reason), and human steps (something only a person can do). Each comes with a packet: a two-line summary, the evidence, transcripts one click away, and a recommended action.
- The workmate is the voice interface over this inbox: "Three approvals waiting. First: fax to Dr. Chen's office requesting Mrs. Martinez's wheelchair order. Approve?" That connects the CEO's workmate direction to the platform.
- Prioritisation: by SLA, patient risk and how long the patient has waited, not first-in-first-out.
- Every decision is a label: approved unchanged, edited (store the diff), rejected (store the reason). Approval rate per step is the main evidence for raising its autonomy level.
- Batching: "approve these 12 identical vendor faxes" turns many clicks into one, which matters at scale.
- Supervisors see queue depth, SLA breaches, escalation mix by reason, and per-workflow autonomy rates.
Voice: the channel that carries most of the work
"One person leads all of voice" across vendor calls, the companion, activations and the workmate. A platform view of voice:
| Concern | Design |
|---|---|
| Shared voice runtime | One real-time pipeline (telephony → STT → turn detection → LLM → TTS) used by every voice surface; each workflow step supplies a call spec: party, goal, questions, disclosure policy, persona, max duration. Outbound and inbound use the same pipeline. |
| Outbound to offices and vendors | IVR navigation (send DTMF; listen to spoken menus; per-entity learned phone trees stored in the knowledge plane, e.g. "press 2 then 4 for orders"); hold detection with a cheap listener (VAD plus a classifier) instead of the LLM during hold music; voicemail detection with a per-workflow policy (leave a message or not; never PHI in a voicemail). |
| Handoff to a human | Warm transfer to an advocate with a whispered summary, or a "conference in" for a difficult call; the call record continues on the same case. |
| Patient-facing voice | Older callers: slower speech rate, shorter sentences, patience with long pauses, confirm numbers digit by digit, offer to repeat; caregiver as a second contact. |
| Disclosure | AI and recording disclosure as part of the converse primitive, configured by jurisdiction; identity verification before discussing anything about the patient. |
| Quality | Per-turn traces linked to audio; replayable calls; per-call outcome scoring (did we get the facts? were they right?); regression suites of recorded calls with known outcomes. |
| Capacity | e.g. 5,000 calls/day × ~6 min ≈ 30,000 call-minutes over ~8 business hours ≈ 60 concurrent on average, ~200 at peak (Little's law; peak ≈ 3×). Long holds with payers inflate this, which is another reason to keep the hold listener cheap. |
Quality as a number: evals for a platform
Four layers of evaluation
| Layer | What it checks | How | When it runs |
|---|---|---|---|
| 1. Deterministic | Scheduler, primitives, definitions: given these events, this decision | Unit tests and golden event logs, no model (the take-home's 87 tests) | Every commit |
| 2. Components | Extraction accuracy per field; converse behaviour (asks one thing, no invented identifiers, discloses nothing extra) | Labelled transcripts with per-field truth; precision and recall per field; guard red-team sets | Every prompt or model change |
| 3. Workflows | End-to-end outcomes against a simulated world that knows the truth | Persona decks per workflow, many seeds, repeated runs with variance; metrics: resolved without a human, correct escalation, wrong facts acted on, calls and days per case | Every definition release; nightly |
| 4. Production | Real outcomes and drift | Shadow mode for new versions, canary by tenant, sampled human QA (the call-review team), LLM judge calibrated against human labels, alerts per metric | Continuously |
The metrics that matter
| Metric | Why |
|---|---|
| Advocate touches per case (and minutes per case) | The business metric for autonomy: more patients per advocate |
| Autonomous resolution rate | Share of cases closed without an exception |
| Correct-escalation rate | Escalating the right cases is success, not failure; escalating avoidable ones is the improvement backlog |
| Wrong-fact-acted-on rate | The safety metric: a wrong "accepts assignment" costs the patient money |
| Time to resolution (days) and patient-visible updates | What the patient feels |
| Calls per case, cost per case | Efficiency; vendor-DB reuse should push calls down over time |
| Approval rate per step (unchanged / edited / rejected) | Evidence for raising or lowering autonomy |
| Compliance violations (PHI to an unverified party, missing disclosure) | Must be zero; any one is a release blocker |
To raise a step from L1 to L3 for a tenant: at least N recent cases at L1 with an unchanged-approval rate above a threshold, zero severe errors, the simulation suite passing at the new level, then a canary with sampled QA. To lower it: automatically, when an alert fires (e.g. extraction accuracy drops after a model change). Autonomy becomes a dial the system turns with evidence.
B2B: configurable per enterprise
- Who the enterprise might be (ask): a health plan, a provider group, an employer, a hospital system. Each wants different things.
- What they configure: which workflows are on; their preferred or in-network suppliers (a ranking rule in qualify); their escalation contacts and SLAs; their channels and branding for patient-facing surfaces; their reporting; extra gates (e.g. "only contracted suppliers").
- How: a tenant config layer over the same workflow definitions, validated against a schema, previewed by running the workflow's simulation suite with that tenant's config, then rolled out with canary. The one B2B engineer stops writing per-customer code.
- Isolation: tenant ID on every row with row-level security; per-tenant encryption keys for PHI if required; per-tenant eval sets and dashboards; noisy-neighbour limits on calls and model spend.
- Integrations as channels: an enterprise's EHR or referral system becomes another intake source and another place facts can come from.
- Later: a console where the enterprise edits its own config within guardrails, with the same preview-and-canary flow.
Domain and compliance facts that shape the design
Researched 18 Nov 2026. Use these to make design choices concrete, not to lecture. Rules change; where it says unverified, phrase it as "my understanding is…".
Medicare DME rules → design consequences
| Fact | Design consequence |
|---|---|
| Written order elements: beneficiary name or MBI, item description, quantity, order date, practitioner name or NPI, practitioner signature. 42 CFR 410.38(d) | The obtain primitive's document validator checks these six fields on an incoming order; a missing signature is a typed "order incomplete" branch, not a human surprise later. |
| When the order must be on file: before delivery for power mobility devices and items on CMS's Face-to-Face/Written Order Prior to Delivery list; otherwise before the claim is submitted. 410.38(d)(1)(ii) CMS | The take-home blocked booking until the order arrived for every item. That's conservative. A platform makes it a per-item rule in the workflow definition: requires: order.received only where the item is on the list. Good example of "rules as data". |
| Prior authorization list includes power mobility devices, some support surfaces, orthoses, some prosthetics, pneumatic compression devices, and the K0005 ultralight manual wheelchair from 28 Oct 2026; standard decisions within 7 calendar days, expedited 2 business days. CMS | A prior-auth track is an optional track switched on by item code: obtain(decision from the contractor) with a commitment due in 7 days. Same primitives, new configuration. |
| Capped rental: monthly rental up to 13 months of continuous use, then ownership transfers. 42 CFR 414.229 Medicare.gov: "You may have to rent your manual wheelchair first." K0001 is commonly described as capped rental (not confirmed in the fee schedule file). | The cost explanation should say "20% of each monthly rental payment", not a one-off share. The take-home framed it as a purchase; a coverage-terms model makes the consent step accurate. |
| Assignment: a supplier that accepts assignment is paid by Medicare directly and can charge only the deductible and coinsurance; others may charge more. For rentals, assignment must be accepted for every month. Medicare.gov booklet | Why "accepts assignment" is a hard gate, and why it's re-confirmed at booking time. |
| Competitive bidding: no round active in 2026; next contracts targeted no later than 1 Jan 2028, bidder registration from 1 Dec 2026. CMS | When it returns, contract status becomes another qualification gate per item and area: a config change if gates are data. |
| Finding suppliers: Medicare's supplier directory and a bulk CMS dataset. data.cms.gov | Seed the knowledge plane's entities from the dataset; calls then add the facts the dataset lacks (stock, speed, behaviour). |
| Medicare Advantage: members must check their plan for costs and which suppliers they can use; MA prior-auth decisions are due in 7 calendar days (standard) and 72 hours (expedited) since 1 Jan 2026. CMS-0057-F | Plan type selects different gates (network membership) and different prior-auth rules: the strongest argument for tenant- and plan-level configuration. |
Privacy and calling rules → design consequences
| Fact | Design consequence |
|---|---|
| HIPAA minimum necessary: limit PHI to the minimum needed; disclosures to a provider for treatment and to the individual are exempt. HHS | Each workflow step declares its disclosure scope; the converse primitive only receives those fields (the take-home's qualification call got no identifiers at all). |
| Verification: verify the identity and authority of an unknown requester before disclosing. 45 CFR 164.514(h) | Identity checks are a step in the converse primitive before any patient detail is discussed, especially on inbound calls and callbacks. |
| BAAs: a cloud provider that handles ePHI is a business associate even if data is encrypted. HHS OpenAI, Anthropic, AWS Bedrock, Google Cloud and Twilio publish BAA options, each with conditions (e.g. retention settings, excluded features, plan tiers). | The LLM gateway only routes PHI to providers under a BAA, with the right retention configuration; a fallback provider must also be covered, or the fallback path strips PHI. |
| AI voices under the TCPA: the FCC ruled in Feb 2024 that AI-generated voices are "artificial" voices, so those calls need prior express consent unless exempt. FCC There is a health-care message exemption for covered entities and business associates, with conditions; calling hours of 8am–9pm local apply to solicitations. 47 CFR 64.1200 | Consent records per patient (the consents table); calling windows per recipient timezone as a channel rule even where not strictly required; identification and opt-out handling built into the voice runtime. Confirm the exact obligations with counsel. |
| Recording consent: federal law is one-party; several states require all parties for phone calls (California, Florida, Illinois, Pennsylvania, Washington and others; lists vary by source). RCFP | Disclose recording at the start of every call, everywhere. Simpler than per-state logic and safe. |
| AI disclosure: California's bot law covers communicating "online" to sell or influence a vote; whether it reaches phone calls is unclear to me. | Disclose that it's an AI assistant anyway: it's a trust decision, and it avoids the take-home's "Sam Rivera" problem. |
| Fax persists because counterparties choose their own technology; HIPAA-oriented fax APIs exist. Documo (vendor source) | Fax is a first-class channel with inbound OCR and correlation, not an afterthought. |
Two references worth naming
- Anthropic, "Building effective agents" (Dec 2024): distinguishes workflows ("LLMs and tools orchestrated through predefined code paths") from agents (LLMs directing their own process and tool use), and lists patterns: prompt chaining, routing, parallelisation, orchestrator-workers, evaluator-optimiser, autonomous agents; advice: start simple, add agency only where needed. anthropic.com Map it: intake is routing; parallel tracks are parallelisation; the bounded planner is orchestrator-workers; extraction with an entailment check is evaluator-optimiser.
- Feng, McDonald and Zhang, "Levels of Autonomy for AI Agents" (2025): five levels defined by the user's role: operator, collaborator, consultant, approver, observer. arXiv:2506.12469 The L0–L4 ladder on this page is my own framing for this product; if asked for a source, cite this paper as the closest published scheme.
- Temporal's model (deterministic workflow code; non-deterministic work in activities; durable timers; signals; versioning by patching) is the industrial version of decide/perform. Temporal docs
Scale assumptions (if asked to estimate)
| Quantity | Assumption (state it as such) | Consequence |
|---|---|---|
| Patients | 50,000 | Small for Postgres |
| Active cases | ~5–10% of patients have an open case → 2,500–5,000 | Scheduler work is tiny; correctness matters more than throughput |
| Events | ~100–200 per case | Under a million rows per month; one Postgres is fine for a long time |
| Outbound calls | ~5,000/day | ~60 concurrent average, ~200 peak; the voice runtime is the scaling problem, not the database |
| Recordings | ~30,000 min/day × ~0.5–1 MB/min ≈ 15–30 GB/day | Object storage with lifecycle rules and retention policy |
| Model calls | ~2 per conversational turn + extraction | Cost per case is a tracked metric; the LLM gateway enforces budgets |
The point to make: this is a correctness-and-reliability problem far more than a throughput problem. The hard parts are durable state, idempotency, verification and safe autonomy, not QPS.
Failure walk
| Failure | What protects you |
|---|---|
| LLM provider down or rate-limited | Gateway fallback to a second provider; infrastructure errors are retried and never counted as a "no answer"; a circuit breaker; cases wait rather than fail |
| Telephony provider down | Calls queue in the outbox; time-sensitive steps escalate after a deadline; a second carrier route if volume justifies it |
| The agent extracts a wrong fact | Per-field evidence plus an entailment check; cross-source verification before high-risk actions; re-verification of stale facts; humans see the evidence in the packet |
| A vendor agrees, then goes silent | Commitment with verify-at; two broken holds → disqualified (a named knob, not engine logic) |
| A case stalls with nothing due | The scheduler never returns silent idle: "stuck" escalation; plus a watchdog query over cases without timers |
| Worker crashes mid-decision | Decide + outbox in one transaction; the lease expires and another worker resumes from the log |
| Duplicate execution (retry after timeout) | Idempotency key per action; providers' idempotency where available; the executor checks the action's status first |
| A bad prompt or definition release | Simulation gate before release; canary by tenant; per-version metrics; instant rollback; cases pinned to their version |
| PHI disclosed to the wrong party | Identity verification in the converse primitive; minimum-necessary disclosure per step; verified fax numbers from the knowledge plane; any PHI-sending step starts at L1 |
| 10× volume spike | The voice runtime autoscales on concurrent calls; per-tenant limits; low-priority work (vendor enrichment) is shed first |
How it evolves: a plan for a 6–7 person team
| Phase | What | Proof it worked |
|---|---|---|
| 0 · Weeks 1–3 | Extract primitives from the DME workflow; DME becomes a definition; Postgres event store, outbox, timers, leases; the watchdog | Golden replays: same seeded worlds give identical decisions |
| 1 · Weeks 4–8 | Second workflow on the same runtime: the companion's provider question (already live as a product, so real traffic); facts written back to the vendor DB; advocate inbox for approvals and exceptions | No new runtime code needed for workflow two; advocate touches per case measured |
| 2 · Months 3–4 | Inbound: fax intake and correlation, callbacks; autonomy policies per step and tenant; eval layers 2–3 per workflow; shadow and canary | First autonomy promotion done on evidence |
| 3 · Months 4–6 | Tenant config layer for B2B; bounded planner for unmatched companion requests; workmate on top of the inbox | A new enterprise variant configured without new code |
| Later | Definition authoring tools for ops (LLM drafts from an SOP, simulation-gated); enterprise self-serve console; learned IVR trees and vendor behaviour | Ops ships a workflow change safely without an engineer ("non-engineers can ship changes safely", their own words) |
- Over-generalising too early: designing the definition language before the third workflow exists.
- Primitives absorbing domain detail: "K0001" creeping into qualify.
- The LLM creeping into decisions through hooks or the planner.
- Autonomy outrunning verification: acting on facts the system can't check.
- Platform work starving product work: sequence it so each phase ships something users feel.
Likely questions, with strong answers
"How would you make this agent more autonomous?"
First define it: the share of a case's steps completed correctly without a human, at acceptable risk. Then three levers. (1) Grant autonomy per step on a ladder (suggest → draft → act and report → act and escalate on exceptions → audited), based on risk, reversibility and whether we can verify the outcome. (2) Shrink the escalation distribution: every escalation has a typed reason, so each month the top reason becomes a handled branch. (3) Give it the inputs it lacks today: inbound faxes and callbacks, memory that outlives the case (vendor facts, office behaviour), and verification so it can check its own work. Promotions are eval-gated: approval rates at the lower level, simulation passes, canary.
"Why not give an LLM agent all the tools and let it figure it out?"
For the long tail, a bounded version of that is exactly what I'd do: the planner composes allowed primitives into a proposed plan an advocate approves. But for the core workflows, the decisions that matter (eligibility, cost, consent, when to give up) need to be the same twice, explainable to an advocate or a patient, testable without a model, and cheap. A tool-calling loop makes every decision a model output you can only evaluate statistically. Keeping decisions in code with the LLM at the edges is what let the take-home run 87 tests with no API key. As models improve, the planner's scope grows and approved plans get promoted into workflows: workflows where you can, agents where you must.
"An ops lead wants a CPAP resupply workflow next week. What do they do?"
CPAP resupply reuses the primitives: converse with the patient (still using it? supplies needed?), obtain an updated order or usage data if the plan requires it, consent on cost, book the shipment, notify. They write (or the LLM drafts from the SOP) a definition with those tracks, the gates, the question bank and the autonomy levels, all starting at L1. It must pass a simulation suite with CPAP personas before release; then canary on a few patients with advocate approval on every step; autonomy rises with evidence. If the workflow needs a genuinely new verb, that's an engineer adding a primitive, and it's the signal that the abstraction is being tested properly.
"How do you decide what needs human approval?"
Three questions per action: how bad is it if wrong, can it be undone, and can we verify the outcome independently. Asking a vendor what they stock is low-risk, reversible and verifiable, so it runs alone. Sending a document with PHI is irreversible, so it starts at "draft and approve" until the recipient is verified. Anything resembling medical or plan-selection advice is never autonomous. These are stored as autonomy policies per step and tenant, enforced at one choke point, the autonomy gate, so changing them is config with an audit trail.
"How do you know the facts it extracts are right?"
Layered: the extractor must quote evidence from the other party's words; an entailment check confirms the quote supports the value (the take-home's word-overlap check could be fooled by a negation, which I'd fix this way); high-risk facts are cross-checked against a second source (the vendor DB, a document, a second call) before acting; facts carry freshness and get re-verified when stale. Offline, per-field precision and recall against labelled calls and simulator truth; online, the advocate's edits are labels.
"A supplier said 'yes, we accept assignment' but they don't. What happens?"
Containment first: the booking flow re-confirms critical gates at booking time ("just to confirm, you'll bill Medicare directly and accept the approved amount?"), so a wrong early answer is caught before the patient is committed. If it still slips through, the patient's cost turns out wrong: escalate to the advocate, correct the fact in the vendor DB with the new evidence and lower that vendor's reliability score, and the case shows who said what and when. And it becomes a test case: a persona that lies about assignment.
"An enterprise customer wants different rules. How?"
Ask who they are first: a plan, a provider group, an employer. Their differences go in the tenant config layer: enabled workflows, preferred or contracted suppliers as a ranking rule or extra gate, escalation contacts and SLAs, branding and channels, reporting. Validated against a schema, previewed by running the simulation suite with their config, canaried. Tenant isolation with row-level security and per-tenant eval sets. The B2B engineer configures instead of forking code.
"A patient messages the companion at 2am: 'my chest hurts'. What does the system do?"
Safety triage runs before any workflow matching: rules plus a classifier, biased toward false positives, detect urgent symptoms. The response is fixed, not generated: advise calling 911 or emergency services, and alert the on-call clinical contact per the tenant's protocol. No autonomous medical advice. This is a hard boundary in the intake service, tested with a red-team set, and it's exactly where determinism matters most.
"How do you test a new workflow or prompt before it goes live?"
Four layers: deterministic tests on the definition (given these events, this decision); component evals on extraction and conversation behaviour; workflow simulations with personas that know the truth, across many seeds with variance; then production shadow mode (run the new version silently and compare decisions), canary by tenant, sampled human QA. Every event carries workflow, prompt and model versions, so regressions trace to a change.
"You change a workflow definition. What happens to cases already running?"
They stay pinned to the version they started on, so the meaning of their history never changes. For an urgent fix, an explicit migration: replay each case's events through the new definition in a dry run, compare decisions, then move the ones that are safe. Old events are converted to the new format when read (upcasting), never rewritten.
"How does the workmate fit into this architecture?"
The workmate is the voice and attention layer over the human plane. The platform produces approvals, exceptions and human steps, prioritised by SLA and patient risk; the workmate walks the advocate through them ("three approvals waiting; first…") and can take actions by voice. The more autonomy the platform has, the more the workmate shifts from "do this task" to "review these decisions".
"What breaks first at 10×?"
Not the database: case and event volumes are small. It's the voice runtime (concurrent calls, provider concurrency limits, hold time inflating concurrency), the advocate queue (exceptions grow with volume unless autonomy grows faster), and model cost. Mitigations: autoscale voice workers on concurrent calls; shed low-priority work like vendor enrichment first; the escalation-to-branch loop to keep human load flat; budgets in the LLM gateway.
"How do you keep PHI safe with third-party models and voice vendors?"
Business associate agreements with every vendor that touches PHI; minimum-necessary payloads per step (the qualification call in the take-home gives the agent no identifiers at all, so it can't leak any); PHI redaction in logs and traces; encrypted PHI columns and row-level security; access audit on recordings; retention policies. Identity verification before discussing a patient with anyone. I'd confirm the specifics with their compliance lead rather than assert them.
"Two events arrive for the same case at once. What happens?"
One writer per case: a lease (row lock with expiry). Both events are appended to the log (appends are cheap and ordered by sequence); the worker holding the lease folds both before deciding. Executors never touch case state directly; they only append result events. So there's no lost update, and decisions always see a consistent state.
"How does the vendor database stay trustworthy?"
Every fact is an observation with evidence, source and date, never an overwrite. Each field type has a freshness window (stock changes weekly, accepted insurance rarely), after which it's re-verified before use. Facts verified by humans or documents outrank facts from a single call. Conflicting observations lower confidence and trigger a re-check. Vendor behaviour (answer rates, broken promises) is tracked too, and ranks who to call first.
"How would you measure call quality?"
Per call: did we get the facts we needed (task success), were they right (against later verification or labels), did we disclose nothing extra, how many turns, how long. Per turn: latency from end of speech to first audio, interruptions, misunderstandings ("sorry, can you repeat"). Store per-turn traces linked to audio so any bad outcome can be traced to STT, the model or the conversation design. Recorded calls with known outcomes become regression suites for prompt and model changes. I'd be honest that in my current work I have per-stage latency metrics and traces, but audio-linked replay is something I've designed, not shipped.
"How would you handle phone menus (IVRs) when calling offices?"
I haven't shipped IVR navigation, so I'd say that and design it: detect a menu (speech classification of prompts), choose an option by matching the menu text to the goal, send DTMF, and learn the path per entity ("press 2, then 4") in the knowledge plane so the next call skips the exploration. Hold: a cheap listener detects hold music and the return of a human, so the LLM isn't running for 30 minutes. Voicemail: detect it and follow the workflow's policy, never leaving PHI.
"Build or buy: Temporal, voice platforms, fax?"
Workflow runtime: build a small one on Postgres first because the decide/event model already exists and it keeps one stack; Temporal is the escape hatch. Voice: buy telephony (a CPaaS or SIP trunk) and use a framework for the real-time pipeline, but own the call spec, evals and disclosure logic, because that's the product. Fax: buy an API. Models: multiple providers behind our own gateway. The rule: buy commodity plumbing, own anything that encodes care-advocacy judgement or quality measurement.
"What would you do in your first 30 days?"
Listen first: sit with advocates and the call-review team, and read a week of escalations to see where human time actually goes. Then pick one workflow with real traffic, instrument it end to end (advocate touches per case, escalation reasons, call outcomes), and ship one escalation-to-branch improvement with a measured before/after. That builds trust and the measurement backbone the platform needs, before any big refactor.
Bridges from your own experience
Use these as one-sentence proofs, not detours. Keep each claim to what you actually built.
| When they ask about | What you can honestly say |
|---|---|
| Voice in production | You built and run a SIP ingress (proxy → media server → real-time agent) and a voice agent with streaming STT/TTS, where a deterministic state machine sits in the model's slot in the pipeline. It runs on WhatsApp calling SIP, not a PSTN carrier; say so. |
| Deterministic core, LLM at the edges | The same principle in the take-home, the voice agent's orchestrator, and a context store where reference resolution goes structural → lexical → constrained LLM, each tier's output validated. |
| Event-sourced state | A reducer producing one transactional set of writes per turn, replayable from fixtures. |
| Evals | Two tiers: deterministic replay of fixtures as the CI gate, and invariant-only checks on the live stack as a drift detector, never a gate. That's the same split as layers 1 and 4 above. |
| Primitives and orchestration | Your current work is composing reusable primitives into workflows with an orchestration layer and a separate knowledge store, which is this platform's shape. Speak about it in general terms. |
| Gaps (say them plainly if asked) | No PSTN carrier work, no IVR navigation, no shipped voice replay harness (designed only), no formal HIPAA programme experience. |
Questions to ask at the end
- "Where does most advocate time go today, and which workflow would you most want the agent to take end to end next?"
- "Are vendor calling, the companion's calls and the activation agent built on a shared runtime today, or separately?" (Tests the platform thesis directly.)
- "How does the call-review team work today, and how do their judgements feed back into the agents?"
- "What does customising for an enterprise customer look like in practice right now?"
- "What does documentation need to look like for the way you're paid, and does that shape what the agents must record?" (Ask; don't assume the billing model.)
- "For the voice role: what would I own in the first three months alongside the person leading voice?"
Checklist for today
- Say the 90-second take-home summary out loud once.
- Draw the target architecture from memory in under 5 minutes, then walk the wheelchair case through it.
- Write the generic
decide()and one workflow definition from memory. - Practise the autonomy ladder and the risk × reversibility × verifiability table as two sentences.
- Open with the user journey. Tie every box to a step of it.
- Have the five known weak spots ready, each with its platform fix.
- Have a drawing tool open and screen sharing tested.
- When they add a constraint: "OK, that changes X; here's the new version", not a restart.