All Case Studies

How Twilight Care Replaced Its Entire App With an Autonomous AI Caregiver

We rebuilt a caregiver platform as an agentic AI that reads real Medicare data, reasons about each family's situation, and takes action on their behalf — HIPAA-compliant and live in production. No dashboard required.

100%

Legacy App Retired

The traditional dashboard was fully replaced by the conversational AI and cut over in production — not run as a side experiment.

37

AI Tools in Production

Real read/write access to Medicare claims, prescriptions, providers, and documents — every write action caregiver-approved.

15-min

Proactive Care Loop

An always-on engine scans for missed meds, drug interactions, and care gaps every 15 minutes — no one has to think to ask.

HIPAA

Compliant by Architecture

PHI masked before it ever reaches the model, AES-256 encryption at rest, and BAA-signed infrastructure.

Healthcare Technology4 peopleFull-stack product team across two major platform generations
The Challenge

53 million Americans are family caregivers — most of them Gen X adults juggling jobs, kids, and the health of aging parents. Their daily reality is chaos:

  • Fragmented medical information scattered across Medicare portals, insurance EOBs, paper records from multiple specialists, and pharmacy printouts
  • Healthcare jargon that makes critical information incomprehensible to non-clinicians
  • No single source of truth — when Mom goes to the ER, the caregiver fumbles through folders and phone photos trying to recall medications and dosages
  • Decision fatigue — knowing when to escalate, what questions to ask the doctor, and how to coordinate across providers

The first version of the platform (codenamed "Illuminator") tackled this with a traditional dashboard approach: a Next.js frontend, Laravel backend, and PostgreSQL database pulling Medicare Blue Button data into organized screens for medications, conditions, providers, and documents.

It worked — but the founder had a bigger vision. Dashboards still require the caregiver to know what to look for. The real need was an intelligent companion that could reason about the complete care picture and proactively surface what matters. The question became: what if the entire product experience was a conversation with an AI that truly understood your family's care situation?

twilight-case-study-thumbnail.png
Our Solution

We built Twila OS — an agentic AI operating system that replaced the traditional dashboard entirely with a conversational interface. Twila isn't a chatbot wrapper around an LLM. It's a purpose-built AI runtime with deep healthcare domain knowledge, real data access, and the ability to take actions on behalf of caregivers.

The Architecture

The system consists of three layers:

  • Gateway — A Node.js/TypeScript runtime that handles authentication, context assembly, skill loading, LLM orchestration, and tool execution. Every conversation turn assembles a care profile within an 8K token budget, selects relevant behavioral skills, sanitizes PHI, calls the LLM, and executes any resulting tool actions.
  • Canvas — A minimal React 19 + Vite frontend that renders the conversational UI and dynamic workspace cards. It's intentionally thin because the AI drives the experience.
  • Skills & Knowledge — 21 behavioral skill definitions and 15+ domain knowledge bases (Medicare, clinical topics, legal matters, caregiving stages, ADLs, assisted living, and more) loaded as structured prompts per conversation turn.

37 Purpose-Built Tools

Twila can read real Medicare claims data, search prescription histories, list insurance benefits, browse uploaded documents, and check care contact information. It can also write — adding medications, creating notes, generating CareMinder action items, updating care context, and even sending SMS messages to family members. Write operations use a proposal-confirm pattern so the AI never makes changes without caregiver approval.

PHI Protection as Architecture

Every message is sanitized before reaching the LLM — patient names, dates of birth, SSNs, and Medicare IDs are masked while preserving clinical content. Messages are encrypted at rest with AES-256-GCM. The entire system operates under a signed Business Associate Agreement.

Our Approach

The migration from traditional app to agentic AI operating system was executed in structured phases with a controlled cutover:

Foundation

We built the core personality engine, LLM provider abstraction (supporting both OpenAI and Anthropic Claude), the tool execution framework, an evaluation engine for response quality, and the workspace card system for dynamic UI rendering.

Intelligence

Conversation memory, SMS delivery via AWS Pinpoint, document extraction using GPT-4o vision (replacing an earlier OCR pipeline), write-back pipelines for extracted data, and persistent learning — Twila remembers preferences like "Carol prefers morning appointments" across sessions.

Proactive Care

The proactive engine runs on a 15-minute scheduler with 7 detection rules, quiet hours, daily alert limits, and cooldown periods. Predictive reasoning cross-correlates medications with diagnoses, detects care gaps, and identifies potential drug interactions. Multi-channel routing ensures alerts reach caregivers through the right channel at the right time.

Hardening & Cutover

Six hardening phases covered token budget enforcement, JWT authentication, card security, database-backed encrypted sessions, structured logging, and PHI sanitization validation. The cutover from the legacy app followed a controlled path: shadow mode (AI runs alongside the old app), canary routing (percentage-based traffic split), then full cutover.

The shared PostgreSQL database made this possible — both systems read from the same Medicare claims data and user records, so there was no data migration needed. Just a clean handoff of the experience layer.

Testing

296 tests across 64 test files cover the gateway's tool execution, context assembly, PHI sanitization, skill loading, and proactive engine. Smoke test runners validate end-to-end flows in staging before every deployment.

Results & Outcomes

The bet paid off. Twilight Care didn't run the new AI as an experiment beside the old product — they replaced the dashboard with it. Twila OS is live in production at os.twila.ai at 100% cutover, and the legacy application has been retired.

Because the old app and the new runtime shared one PostgreSQL database, the cutover required zero data migration. We moved through shadow mode and canary routing into full production — a clean handoff of the experience layer, with no risky data lift and no downtime for the families who depend on it.

What changed for caregivers

The old dashboard was passive — it organized information and waited for the caregiver to know what to look for. Twila is active. It reads the whole care picture, explains it in plain language, and surfaces what matters before anyone has to ask. That shift — from a filing cabinet to a companion that reasons — is the real result, and for the families in the beta it's already changing how they handle the moments that used to mean panic.

What Twila does today

  • Reads and reasons about real Medicare data — claims, prescriptions, provider encounters, and diagnoses — explained in plain language tailored to each family's situation
  • Extracts structured data from documents — upload an EOB, a lab result, or a photo of a prescription bottle and Twila pulls medications, conditions, providers, and diagnoses into the care record
  • Proactively flags care gaps — missed medications, overdue appointments, and potential drug interactions, caught by an always-on engine instead of a worried caregiver
  • Takes action with permission — adds medications, creates notes and action items, and updates the care context through a propose-confirm pattern, so the AI never acts on its own
  • Delivers across channels — a web workspace with dynamic cards, plus SMS for time-sensitive alerts
  • Remembers and improves — persistent memory means Twila gets better at serving each family the longer it works with them

The engineering behind it

That capability rests on real depth, not a thin wrapper around a language model: 37 purpose-built tools with read/write access to the care data layer, 21 behavioral skills loaded per conversation turn, 15+ domain knowledge bases spanning Medicare, clinical topics, legal matters, and caregiving stages, and 296 automated tests guarding reliability. It runs on multiple models interchangeably — currently GPT-5-mini for chat and GPT-5.1 for tool calls, with Anthropic Claude as a drop-in alternative.

By building domain knowledge, proactive detection, and HIPAA-grade protection into the runtime itself, Twila OS delivers something the dashboard it replaced never could: a companion that actually understands a family's care situation — and does something about it.

My mom has 14 medications and sees 6 specialists. Before this platform, I kept a paper list that was always out of date. Now I open the app and everything is there — current, accurate, and in language I actually understand. Last month in the ER, it probably saved her life.

A Twilight Care beta caregiver

Family caregiver, Twilight Care

Technologies
TypeScriptNode.jsReact 19Next.js 15LaravelPostgreSQLOpenAI GPT-4o / GPT-5ViteTailwind CSSAWS (RDS, S3, Pinpoint, Lambda)WebSocketsPrismaVitest
Services Provided
Agentic AI ArchitectureHealthcare System IntegrationMedicare Blue Button API IntegrationHIPAA-Compliant DevelopmentPHI Anonymization EngineeringConversational UX DesignMulti-Channel Delivery (Web + SMS)Real-Time Data PipelineFull-Stack Web Development
Engagement

Team

4 people

Full-stack product team across two major platform generations

Ready for results like these?

See how we achieved 100% legacy app retired — and what we can do for you.

Start a Conversation