Curaway Intake Module — Technical Deep-Dive Narrative¶
Voice-over script for engineering / technical-due-diligence audiences. Covers internal architecture: 5-layer intake model, document pipeline, EHR construction, Patient Fitness Score, intake gates, agent response pipeline, multi-tenancy. For the investor-facing product walkthrough (4 min, end-to-end patient journey including provider matching + MSO), see
intake-module-narrative.md.
Opening (30s)¶
"What you're about to see is Curaway's agentic intake system. Unlike traditional medical forms that take 45 minutes and feel like paperwork, Curaway conducts a warm, conversational intake — like talking to a knowledgeable coordinator who adapts to what you share."
1. Five-Layer Architecture (45s)¶
"The intake is organized into five layers, each capturing a different dimension of the patient's readiness:
- Intent Capture — What procedure do they need? How urgent? What are their fears and hopes? This is the emotional intelligence layer.
- Medical Status — Diagnosis, medications, allergies, demographics. Clinical data without clinical jargon.
- Travel Readiness — Can the patient physically travel? Mobility, oxygen needs, recent hospitalization. Determines the transport tier (T1-T4).
- Financial Readiness — Budget range, funding source, insurance status. Deliberately asked last — we build trust before discussing money.
- Logistics — Country, passport, timeline, visa requirements, companion travel.
Each layer has its own AI extractor running in parallel. The agent focuses on one layer at a time but captures signals from any layer if the patient volunteers them."
2. Emotional Intelligence (30s)¶
"Notice how the agent adapts its tone. When Syeda mentions her son's leukemia diagnosis, the agent acknowledges the emotional weight before asking clinical questions. This isn't scripted empathy — the agent reads emotional signals (fear intensity, hope, readiness) and adjusts in real-time.
The emotional state feeds into the Patient Fitness Score, which determines how aggressively we can advance the intake. A desperate parent gets a faster, more directive flow. An exploring patient gets a gentler, information-rich approach."
3. Document Processing Pipeline (45s)¶
"When Syeda uploads six medical reports, three things happen simultaneously:
First, each PDF goes through a three-tier OCR pipeline — text extraction, then PyMuPDF for scanned pages, then a fallback OCR engine. This handles everything from clean digital PDFs to phone photos of lab reports.
Second, the Clinical Context Agent analyzes each document — extracting conditions, lab values, medications, and mapping them to ICD-10 codes. In this case, it extracted 17 conditions and 57 lab parameters from six documents.
Third, all findings flow into the Electronic Health Record — a FHIR R4-compliant snapshot that updates in real-time. The EHR builder merges document findings with conversation data, deduplicates conditions, and auto-detects comorbidities.
The processing happens via durable async queues. If a document fails, it retries automatically. The patient never sees infrastructure — they see a simple progress panel."
4. EHR Construction (30s)¶
"The EHR isn't a static form — it's a living document that builds from every data source:
- Conversation data: demographics, medications, allergies captured in natural dialogue
- Document analysis: conditions, lab values, coded entities from uploaded reports
- Auto-detection: comorbidities inferred from conditions (e.g., leukemia triggers a moderate risk flag)
- Risk assessment: rule-based, deterministic — 30 rules that flag blocking conditions (severe anemia, thrombocytopenia) before provider matching
The completeness score tells us how ready this case is for matching. It weights demographics, clinical baseline, lab coverage, imaging, and preferences — each weighted differently based on the procedure's requirements."
5. Patient Fitness Score (PFS) (30s)¶
"Behind every turn, the Patient Fitness Score evaluates four dimensions:
- Medical fitness (45%) — risk items, comorbidity severity, medication conflicts
- Travel fitness (25%) — transport tier, mobility, oxygen needs
- Logistics fitness (15%) — passport, visa, timeline feasibility
- Intent clarity (15%) — urgency, decision stage, emotional readiness
The PFS produces a band: Ready, Conditionally Ready, Needs Attention, or Not Ready. This determines whether the case can proceed to matching or needs more information. It's computed on every turn — a continuously updating signal, not a one-time gate."
6. Intake Gates (20s)¶
"Intake completion requires five conditions:
- Procedure identified (with valid procedure code from our seed database)
- Evidence captured (documents analyzed OR enough conversation turns)
- Demographics confirmed (age + country)
- Medications confirmed (even 'no medications' counts as confirmation)
- Allergies confirmed (critical for pre-operative safety)
Once all five gates pass, the case automatically advances to provider matching. No manual intervention needed."
7. Agent Response Construction (45s)¶
"Every agent response passes through four layers before reaching the patient:
Layer 1 — Voice Rules. A YAML-driven voice policy defines how Curaway speaks. No medical jargon. No second-person clinical directives ('you should take...'). Frame everything as what providers do ('Providers typically request HbA1c below 8%'). The voice rules are loaded into the system prompt dynamically — not hardcoded.
Layer 2 — Emotional Intelligence. The agent reads emotional signals from the conversation: fear intensity, hope, readiness, urgency. A desperate parent gets direct, action-oriented responses. An exploring patient gets informational, low-pressure guidance. This isn't sentiment analysis — it's structured emotional state tracking across turns.
Layer 3 — Guardrails. An input classifier screens every message against five categories: on-topic, medical advice, off-topic, general health, and emotional. Medical advice requests get redirected ('Your doctor is best positioned to answer that'). Emotional messages pass through to the LLM — we never block or template emotional content. During active intake, the classifier is bypassed entirely because everything the patient says is answering agent questions.
Layer 4 — Output Validation. After the LLM generates a response, a response policy checks it against forbidden patterns: no diagnoses, no treatment recommendations, no specific cost figures, no patronizing filler phrases. If the response fails validation, it's regenerated — up to three times. The patient never sees a failed response.
The result: every message feels natural, warm, and clinically appropriate — without any single message being manually scripted."
8. Response Formatting (15s)¶
"Agent responses follow a structured format designed for mobile scanning:
- Opening acknowledgment (1 sentence — validates what the patient shared)
- Context or insight (1-2 sentences — what the agent understands so far)
- Questions as a numbered list (max 3-4 per turn, key ask bolded)
- Soft close (encouragement, not pressure)
This isn't cosmetic — patients on phones at 2am need scannable responses. A wall of text gets skipped. A numbered list gets answered."
9. Caregiver Support (15s)¶
"Notice that Syeda is speaking on behalf of her son Abdul. The system detected this automatically — the medical extractor captured the relationship (mother/child), and every subsequent agent response addresses Syeda by name while referring to Abdul in third person.
This matters because in cross-border medical travel, the person managing the journey is rarely the patient themselves — it's a parent, spouse, or child. Curaway adapts to this reality."
10. Multi-Tenancy & Security (15s)¶
"Everything you see is tenant-isolated. Every database query includes tenant_id. PostgreSQL Row-Level Security enforces data boundaries. Background processing uses a service role that bypasses RLS for system tasks while preserving audit trails. Patient data is field-level encrypted, consent-gated, and GDPR Article 17 compliant."
Closing (15s)¶
"This entire intake — from first message to matched providers — takes 5-10 minutes of natural conversation. No forms, no portals, no waiting rooms. Just a patient talking to an intelligent coordinator that builds their complete clinical picture in real-time."
Total script length: ~7 minutes narrated