Skip to content
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 acts on their behalf. It is HIPAA-compliant and live in production, and there is no dashboard.

100%

Legacy App Retired

The conversational AI fully replaced the traditional dashboard and was 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 is caregiver-approved.

15-min

Proactive Care Loop

An always-on engine scans for missed meds, drug interactions, and care gaps every 15 minutes, so nobody 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 TechnologyFull-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. The same problems come up again and again:

  • 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 over when to escalate, what questions to ask the doctor, and how to coordinate across providers

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

It worked, but a dashboard still requires the caregiver to know what to look for. The founder wanted an intelligent companion instead: something that could reason about the complete care picture and surface what matters before anyone asks. That meant making the entire product a conversation with an AI that understood the 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 with a conversational interface. It is an AI runtime with healthcare domain knowledge, real access to the family's data, and the ability to take actions on a caregiver's behalf.

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 the relevant behavioral skills, sanitizes PHI, calls the LLM, and executes any tool actions that come back.
  • Canvas: a minimal React 19 + Vite frontend that renders the conversational UI and the dynamic workspace cards. It stays thin on purpose, 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 on each conversation turn.

The 37 Tools

Twila reads real Medicare claims data, searches prescription histories, lists insurance benefits, browses uploaded documents, and checks care contact information. It also writes: adding medications, creating notes, generating CareMinder action items, updating care context, and sending SMS messages to family members. Write operations use a proposal-confirm pattern, so the AI never makes a change without caregiver approval.

PHI Protection

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

Our Approach

We moved from the traditional app to the agentic AI operating system in structured phases, ending in a controlled cutover.

Foundation

We built the core personality engine, the 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

Then conversation memory, SMS delivery via AWS Pinpoint, document extraction using GPT-4o vision (which replaced an earlier OCR pipeline), write-back pipelines for the 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 puts each alert in front of the caregiver 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 is what made that possible. Both systems read the same Medicare claims data and the same user records, so there was no data migration to do; only the experience layer changed hands.

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

Twilight Care replaced the dashboard with the new AI rather than running it as an experiment beside the old product. 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 went from shadow mode through canary routing into full production, handing off only 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 organized information and then waited for the caregiver to know what to look for. Twila reads the whole care picture, explains it in plain language, and surfaces what matters before anyone has to ask for it. The families in the beta are already using it in 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
  • Flags care gaps proactively: missed medications, overdue appointments, and potential drug interactions, caught by an always-on engine instead of by a worried caregiver
  • Takes action with permission: it 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 37 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. The models are interchangeable: currently GPT-5-mini for chat and GPT-5.1 for tool calls, with Anthropic Claude as a drop-in alternative.

Domain knowledge, proactive detection, and HIPAA-grade protection live in the runtime itself rather than in a screen the caregiver has to work. That is why Twila can explain a family's care situation and then do something about it, which the dashboard it replaced could not.

Client Testimonial

AT
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

Project

Engagement

Full-stack product team across two major platform generations

Technologies

TypeScriptNode.jsReact 19Next.js 15LaravelPostgreSQLOpenAI GPT-4o / GPT-5ViteTailwind CSSAWS (RDS, S3, Pinpoint, Lambda)WebSocketsPrismaVitest

Services

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

Ready for results like these?

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

Start a Conversation