00-overview.mdEngineering, start here~6 min read

Travi AI Agent: System Overview

This is the modular form of the MVP Software Architecture Specification. Same decisions, same numbers, reorganized so nobody has to read 47 pages to do one task.

Layout

00-overview.md ← start here (10-minute plain-English read)
adr/ ← 18 one-page Architecture Decision Records
 README.md ← register/index of all ADRs
 ADR-001 … ADR-018.md
modules/ ← one brief per backend module (the unit of work)
 identity-consent.md ingestion.md compiler.md episode.md
 medication.md scheduling.md notification.md brief.md
 agents.md admin.md analytics.md audit.md
reference/ ← cross-cutting contracts
 platform.md (stack, repo layout, CI/CD, cloud, environments, actors)
 data-model.md (entities, fields, invariants, indexing, outbox)
 api.md (conventions + full endpoint catalog + payloads)
 security.md (threat model → controls, crypto, compliance)
 operations.md (alerts, dashboards, config keys, scheduled jobs)
 testing.md (test layers, extraction thresholds, 12 golden scenarios)
 nfr.md (the consolidated non-functional requirements table)
 delivery-plan.md (team, 12 sprints, phase gates, DoD, partner ratification)
 traceability.md (every PRD requirement → owning module → verifying test)
 glossary.md
assets/architecture.png
spec/ ← the original 47-page master spec (PDF), retained in the private repo for §-references

Cross-references: any §N.N you see points to the master spec (retained in the private repo), the modular files were generated from it and stay faithful to it. If the two ever disagree, the ADR files win (they are the decision log).

Where does the work happen? This overview and the module/reference/ADR pages it describes are the encyclopedia. The to-do list is the 14 development phases, sequential, DoD-gated, and status-tracked. Build from the phases; consult these pages when a phase's deep-reference line points here.

Reading paths

You are… Read
New engineer, day 1 00-overview.md → reference/platform.md → your module brief
Implementing a feature Module brief → reference/data-model.md + reference/api.md sections it names → the ADRs it lists
Security / compliance reviewer reference/security.md → adr/ADR-017, ADR-018 → reference/testing.md
Design-partner (hospital) reviewer 00-overview.md → adr/README.md (the 7 GATED rows) → reference/delivery-plan.md

Using this with AI coding agents (Claude Code, etc.)

The set is deliberately sized so each file fits comfortably in a context window. Recipe per task:

  1. Always include: 00-overview.md (or pin it as project memory / CLAUDE.md, section 3 "five hard rules" is the part that must never fall out of context).
  2. Include the one module brief you're working in, it states the module's invariants, its data, its API surface, and which ADRs constrain it.
  3. Include only the named reference sections the brief points to (e.g., the task_instance table from data-model.md, not the whole file).
  4. Cite requirement IDs (e.g., MED-006) in commits/PRs, reference/traceability.md is the checklist that CI mirrors.
  5. Never let an agent edit an ADR to make a task easier. Amending an ADR is a human governance decision.

Provenance

Generated July 2026 from Travi AI Agent_MVP_Software_Architecture_Specification_v1_0 (retained in the private repo). Contents: Engineering Review + the Product Requirements Document + Investor Feasibility Plan, consolidated with all open decisions resolved to build defaults (see adr/README.md for which seven remain partner-gated).

The 10-minute read. Everything else in this doc set is detail behind this page. Master spec: spec/ (PDF). Cross-references like §14.4 point there.


1. What this is

Travi AI Agent is a hospital- or payer-sponsored platform that manages the 30 days after a patient leaves the hospital, the window where heart-failure patients miss medications, skip follow-ups, and bounce back as readmissions.

The system reads the patient's final discharge paperwork, turns it into a simple day-by-day action plan, nudges the patient (or their caregiver) to complete each step, quietly fixes routine problems itself (calling the pharmacy, helping schedule a visit), and hands the outpatient doctor a one-screen summary right before the follow-up appointment.

One sentence: it converts discharge instructions into completed actions, with almost zero new work for hospital staff or doctors.

2. Who touches it

Person What they see What they never see
Patient A "Today" screen with at most 3 actions, opened from a text message. No password, no app store. Medical jargon, red alarms, the machinery underneath.
Caregiver The same plan, if the patient invites them. Their own login, revocable anytime. Anything the patient didn't grant.
Doctor (PCP) A secure link → one screen: what changed, what the patient actually did, what needs a decision. Readable in 60 seconds. A new portal, a dashboard to monitor, another inbox.
Hospital admin Cohort setup, reports, kill switches. A daily work queue. The system must not create routine labor.

3. The five hard rules

These are enforced in code and state machines, not just policy. Breaking any of them is a release-blocking bug.

  1. AI never makes clinical decisions. No AI output can create, change, or stop a medication instruction. Only two things can: a fully validated extraction from a signed clinical document, or a doctor confirming with strong authentication.
  2. Every instruction traces to a source. Anything the patient or doctor sees links back to the exact sentence in the exact document it came from.
  3. Agents gather evidence; the engine decides. Automation (calling pharmacies, booking help) returns structured evidence. A deterministic workflow engine, never the agent, moves state.
  4. No PHI in notifications. Texts, pushes, and emails say "you have a new task" plus a link. Nothing medical on a lock screen.
  5. Never imply a doctor is watching. No message may suggest continuous clinician monitoring. Emergencies get approved 911/ED language, immediately.

4. How an episode flows (day 0 → 30)

  1. Day 0, Discharge. Epic sends a discharge event. Within 15 minutes an episode exists; the patient gets an SMS link, proves who they are (date of birth + having the phone), consents, and lands on their Today screen. Under 2 minutes, no password.
  2. Day 0, Plan compilation. The pipeline parses the signed discharge documents, extracts medications/appointments/labs with an LLM, and runs every extracted fact through seven validation gates (schema, terminology, clinical sanity, verbatim source-span proof, similarity check…). Only facts that pass all seven become patient-visible tasks. Anything uncertain becomes a question for a human, never an instruction.
  3. Days 1–29, Execution. The patient answers simple prompts ("Were you able to pick up spironolactone?", done / not yet / can't do it / not sure). "Can't do it" triggers automation: the medication-access agent calls the pharmacy; the appointment agent helps schedule. Reminders escalate gently (push → SMS → voice → caregiver) and stop within 60 seconds of completion. A patient who goes silent 48 hours on a critical task triggers a caregiver alert; 72 hours escalates further.
  4. Before the follow-up visit. 24 hours before the PCP appointment, the system builds a snapshot brief and sends the doctor a secure link (email code, no account). If anything material changed since, the brief regenerates on open.
  5. After the visit. The doctor's new instructions (uploaded note/AVS) reprocess through the same pipeline and update the remaining plan. Old tasks are superseded, never deleted.
  6. Day 30, Close. A final handoff summary is generated; unresolved items are reported honestly; analytics freeze with fixed denominators (offered / activated / engaged / completed) so outcome numbers can't be gamed.

5. The system in one picture

Architecture

Stack in one paragraph: a single Python 3.12 / FastAPI backend (a modular monolith, 13 internal modules with enforced boundaries, one deployable) plus Celery background workers on Redis; PostgreSQL 16 as the only source of truth; S3 for documents; a React PWA for patients/caregivers/clinician briefs; AWS (ECS Fargate, three accounts, Terraform); LLM calls go through AWS Bedrock (Claude, version-pinned, temperature 0, zero data retention under BAA); Twilio for SMS/voice and SES for email.

6. The 13 modules

Module One-liner
identity + consent Who you are, what you agreed to, every token and grant.
ingestion Everything in/out of Epic: discharge triggers, documents, the (later) summary export.
compiler Documents → validated facts → tasks. Owns the seven gates.
episode The state machines. The only thing allowed to change task/episode state.
medication The four separate truths about a med: ordered, sent, obtained, taken.
scheduling Follow-up needs vs actual appointments; assisted booking.
notification Channel ladders, quiet hours, the 60-second stop rule, silent-patient detector.
brief The doctor's one-screen snapshot and its staleness logic.
agents The six bounded agents and their policy envelopes + kill switches.
admin Tenant/cohort config, versioned publishes, kill-switch API.
analytics Honest denominators, execution reports, outcome coverage flags.
audit Append-only ledger of everything; 6-year WORM archive.

Each has a brief in modules/ written to be handed to a developer, or an AI coding agent, as the context for a task.

7. Ten decisions that matter most

ADR Decision (plain English) Status
001 One deployable app with strict internal walls, not microservices. Decided
002/003 Python/FastAPI backend; React PWA frontend (launches from a text, works for elderly patients). Decided
006 LLM = Bedrock Claude, version-pinned, temp 0, no data retention. Swappable behind one gateway. Decided
007 Epic integration = real-time discharge feed (ADT) plus FHIR polling as backstop. Default, partner ratifies
008 Patient identity = date of birth + possession of the invited phone. Default, partner ratifies
009 Nine-level source hierarchy; signed documents always beat machine extraction. Default, partner ratifies
011 Unresolvable routine issues → weekly report (not a hospital queue), unless the contract buys Tier 2. Default, partner ratifies
012 Offline = encrypted "emergency card" cached on the phone (contact, 911 text, med list). Decided
013 Silent patient: 48 h → caregiver, 72 h → operations. Default, partner ratifies
018 Audit log is append-only in the database and write-once in S3 for 6 years. Decided

Full register with context and consequences: adr/.

8. Key numbers (the SLAs everything is built around)

Thing Number
Discharge → episode exists ≤ 15 min
Activation, end-to-end ≤ 2 min
Discharge → published plan ≤ 10 min p95
Reminder stops after task completes ≤ 60 s
Screens load ≤ 2 s p95
Brief regenerates when stale ≤ 5 s p95
Silent-patient triggers 48 h / 72 h
Availability / RPO / RTO 99.9% / 15 min / 4 h
Pilot scale 300–500 episodes, ~5,000 ceiling
Human ops budget ≤ 10 min per episode

9. Explicitly NOT in the MVP

No open patient–doctor chat. No remote vital-sign monitoring. No autonomous triage or medication advice. No writing orders/medications into the EHR (only a static summary document, and even that ships later behind a flag). No booking at outside health systems. One condition (heart failure), one health system.

10. Where to go next

  • New engineer: read this → reference/platform.md → your module's brief in modules/.
  • Reviewer / security: reference/security.md → adr/ → reference/testing.md.
  • Clinical: modules/compiler.md (the gates) → modules/notification.md → reference/testing.md (golden scenarios).
  • AI coding agent: see the recipe in README.md.