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.
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).
| 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 |
The set is deliberately sized so each file fits comfortably in a context window. Recipe per task:
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).task_instance table from data-model.md, not the whole file).MED-006) in commits/PRs, reference/traceability.md is the checklist that CI mirrors.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.
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.
| 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. |
These are enforced in code and state machines, not just policy. Breaking any of them is a release-blocking bug.

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.
| 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.
| 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/.
| 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 |
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.
reference/platform.md → your module's brief in modules/.reference/security.md → adr/ → reference/testing.md.modules/compiler.md (the gates) → modules/notification.md → reference/testing.md (golden scenarios).README.md.