Case study
Anaya Care
A home care operations platform for U.S. agencies, built under Geriatric Care Solution. I lead the project and have written most of its code: a NestJS API, a Next.js dashboard, an Expo app for caregivers and families, and an AI layer of durable agents that draft care plans, task lists, and reports, ask the human when they are unsure, and never publish anything without sign-off.

What it is
Anaya Care is the system a home care agency runs on. A client arrives through intake, gets an assessment and a care proposal the family signs off on, then a care plan, a task list for their caregivers, and a schedule of shifts that caregivers clock into from their phone with a location check. Agency staff work from the web dashboard, caregivers and family members use the mobile app, and the whole product is written up in a public handbook that the software is built to match.
What I did
I have led the project since it began and written the large majority of its code across the backend, the web dashboard, the mobile app, and the docs.
- The platform. Every record belongs to one agency, and that boundary is enforced once at the data layer instead of in every query. Permissions are a catalog of capabilities that each agency composes into its own roles. Every view of protected health information is audited through a queue that retries and does not lose entries. Care proposals, plans, task lists, shifts, and client status move through state machines that live in a shared package, so the API, the dashboard, and the app agree on what is allowed. Migrations dry-run by default and refuse to touch production without an explicit flag.
- Realtime and money. Chat and notifications over Socket.IO, voice and video calls over LiveKit, a family-funded care wallet on Stripe Connect, built ledger-first so a retried webhook can never credit twice, and finance and timesheets that keep their history even when the shift they came from is deleted.
- The mobile app. Expo and Tamagui, with GPS-verified clock-in that each agency can run in soft or enforced mode, background location breadcrumbs during a shift, incident and change-of-condition reporting, pre-shift readiness quizzes, shift handovers, family updates, and home-screen widgets with Live Activities.
- Tests that need no API key. An end-to-end suite brings up the whole stack in Docker, including the workflow engine and the vector store, against a fake Anthropic and OpenAI server, so the intake-to-review journey runs on pull requests without spending tokens. One seed command takes a client from a name to five worked shifts and an open review, for demos and QA.
- The handbook. A Fumadocs site where every rule the product follows has an ID, a dated changelog, and screenshots captured from staging. The ask-the-docs assistant I built for it later became the pattern for RunOlga.
The AI layer: agents that ask, humans who decide
This is the part of Anaya I am proudest of. A family of agents drafts the documents an agency would otherwise write by hand: care plans, family-facing proposals, caregiver task lists, initial assessments and reassessments, meal plans, job postings, incident reports, training content, activity worksheets, and wound photo analysis. They share one design.
- Durable by construction. Each agent is a Vercel AI SDK tool loop wrapped in a Restate workflow. Every model call is journaled, so a deploy, a crash, or a long model response that Node would normally abort does not throw away paid work; the run resumes where it stopped. Calls carry bounded retries, replay is kept deterministic by tests that fail on any stray randomness or clock read, and a reconciler sweeps up runs the engine has lost track of.
- Human in the loop, literally. When an agent is missing something, it calls one shared ask-the-user tool. The workflow suspends, the question appears in a dock on the dashboard or an intake screen on the phone, and the run resumes with the answer. Questions are checked at execution time so they stay short, in plain language, and offer real choices. If the answer corrects the client's record, it is written back through a registry that doubles as the permission boundary. Some agents are told to ask freely and others only when they must, and that policy is tested as a prompt invariant.
- Drafts stay drafts. Nothing an agent produces becomes a live record on its own. Reassessments land in review, task lists are published deliberately and regenerated only when a person agrees, care plans are versioned and published explicitly, and proposals go through internal review rounds before a family ever sees them. Refinements edit the saved draft and show the reviewer a real diff.
- Grounded in the agency. Uploaded policies are chunked, embedded, and searched per agency in Qdrant, so retrieval cannot cross tenants. Each workflow opens by reading the relevant policy, standing agency rules are injected directly, and a chat assistant with permission-aware retrieval and a crisis-phrase safety gate sits alongside.
- Observable. Every step of every run is transcribed, reasoning included, and can be read live from the dashboard. Prompts live in markdown with integrity tests, skills load on demand inside the journal, and a planning harness lets agents write their own checklist with tool gates enforced at execution rather than merely hidden from the model.
Models are set per agency: Claude Sonnet 5 by default, with adaptive thinking on thorough runs and Haiku for interview turns, OpenAI as the alternate, and Gemini or OpenAI for images.