Inspiration
Most of care happens after the visit. The doctor writes a plan, a prescription goes to a pharmacy, and the patient goes home. Then nobody sees the whole picture. The pharmacy delays an order and nobody tells the patient. A pharmacy question sits unanswered. A patient has a question at 9 pm and no one to ask. As an international student managing care in a country where I didn't know how the system worked, I felt that gap myself.
Care ON is built for that gap: the time between "the visit ended" and "the patient actually has what they need".
It wasn't the first idea. A big part of the early hours went into brainstorming and several pivots. I looked at developer-tooling ideas, then job-search and housing ideas, and kept rejecting them: either they were too far from a problem I could relate to, or too close to what already exists. I researched what past hackathon winners had built, and I kept asking what would genuinely matter to a real person. After-visit care was the idea that stayed.
I also wanted to answer a question I kept asking about AI in healthcare: how do you let agents do real work without letting them make the decisions that only a clinician should make?
What it does
Care ON gives the patient, the doctor and the pharmacy one shared, auditable timeline, and puts a small team of agents on top of it. The agents investigate, draft and check each other's work. A human always decides.
For the patient: one status bar for their last visit (plan, prescription, pharmacy, pickup), with what is happening now, what is next, and what the assistants did, in plain words. An assistant answers from the approved plan only. A Visit Explainer turns the plan into everyday language with a glossary. Home readings (heart rate, blood pressure, pain, temperature) show a plain-word trend.
For the doctor: a single Case board that always shows one "Your next action": record the visit, approve the plan, send a prescription, review the agents' proposal, or answer a question. No hunting through tabs.
The agents
- Care Coordinator: wakes by itself when the pharmacy reports a delay, a question or a rejection. It investigates with read-only tools (prescription history, care plan, a dose timeline computed in code, open care gaps), states a reason for every tool call, and decides how urgent the situation is.
- Writer: drafts the patient message and the clinician summary from the verified facts.
- Safety Reviewer: an independent agent that checks the draft against the facts, backed by code checks that run whatever the model says. It rejects invented times, advice, reassurance and internal ids.
- Patient assistant, Visit Explainer, Doctor agent: tool-using agents for the patient chat, the plain-language visit, plan drafts from visit notes, and status summaries.
Rules enforced in code, not just in prompts
- The Coordinator cannot propose anything that has not passed the safety review.
- It cannot call a case "time-sensitive" unless the dose timeline shows the same medicine due within 24 hours.
- Agents have a role that no clinical transition accepts. Nothing reaches the patient until a clinician approves it, and the clinician can edit the wording first.
- Urgent symptoms bypass the model. Questions about stopping, skipping or changing a medicine are forwarded to the care team by code, without calling the model.
- Drafts and explanations are checked against their source; any line with an invented number or advice is removed and logged.
- An unanswered dose is "unconfirmed", never "missed". Home readings are flagged only against a range the clinician set; the app never calls a value normal or serious.
A live activity timeline shows everything that happens: what the doctor, patient and pharmacy did, what the system did, and every agent model call, tool call, hand-off, rejection and human decision, with timings. A filter switches between All, Agents, and People and system. A Demo stage shows the doctor, patient and pharmacy side by side, so a presenter never switches tabs.
How we built it
- App: Next.js 16 (App Router), React 19, TypeScript, Tailwind v4 and Zod.
- Event-sourced core: every change is an event with an actor, a verification category and a simulation flag. A deterministic orchestrator (not an LLM) checks identity, per-patient authorization and idempotency, and applies state machines for prescriptions, care plans, tasks and care gaps. Every screen is derived from the same events, so the patient and doctor views cannot disagree.
- Gemini for the agents: function calling with per-agent tool allowlists, structured output, an internal rate limiter, and honest errors instead of invented answers.
- Amazon Bedrock (Amazon Nova) as a fallback: if Gemini is rate limited or failing, the same request, including a half-finished tool conversation, is answered by Bedrock. The model name shows in the log.
- Tiger Data (TimescaleDB) for the event stream, with hypertables, continuous aggregates and compression. Migrations were tested on a zero-copy fork first.
- Vultr for hosting: a Cloud Compute server under systemd, with automatic HTTPS, a firewall, key-only SSH and a repeatable update script.
- Quality: 142 unit and API tests, 9 database integration tests, and real-browser tests in Chrome with real models, including an accessibility scan.
How I used AI
I took AI assistance at several points, and I'd rather be specific than vague about where. In order:
- Brainstorming: I used an AI assistant as a sounding board while deciding what to build. I explored many ideas, rejected most of them, and pivoted several times. The direction, and the decision to build an after-visit care product, were mine.
- Learning the sponsor tools: before building the product, I tried each sponsor technology on its own to understand what it is really for.
- A first attempt that got complicated: I then manually built a simple app with a separate front end for each integration. It grew complicated quickly: a lot of pieces, and none of them formed a product.
- The core, built piece by piece: I stepped back and defined the product and its principles (agents draft, humans decide, safety lives in code, nothing is invented). Then, with a detailed specification and focused prompts, I used an AI coding assistant, Claude Code, to build the individual pages one at a time (the patient portal, the doctor portal and the pharmacy simulator), together with the event model, the orchestrator, the agents and the sponsor integrations (Tiger Data, Gemini and Vultr).
- Additional features and the combined interface: after the core worked, the additional features were added in later sessions with AI: the visit status bar, the doctor's "next action" board, home readings, the Visit Explainer, the live activity timeline, the Bedrock fallback and the code-enforced safety gates. The single combined page that embeds the doctor, patient and pharmacy views side by side (the Demo stage) was built the same way.
- Bugs and issues: many of the problems we ran into near the end were found by using the product and then fixed with AI help. Each got a test.
- My part: choosing the problem and the direction, setting the rules, using the product myself to find what was wrong (too many tabs, a confusing demo, empty fields, unclear naming), deciding the name, the domain and what to claim, and setting up the sponsor accounts, keys and deployment.
- AI inside the product: Gemini and Amazon Nova power the agents at runtime. They only draft, and code checks their output before a human sees it.
Sponsor technologies
- Tiger Data: the event stream lives in 4 hypertables with 5 real-time continuous aggregates and compression. On 548,461 synthetic events we measured compression from 179.2 MB to 19.3 MB (9.3x) and a continuous aggregate answering the same 30-day question in 5.5 ms against 67.8 ms from raw rows (12.3x), with identical results. Migrations and a 548k-event load were tested on a zero-copy fork before touching the real service, which found a real slow read (21.7 ms down to 3.8 ms with a partial index).
- Vultr: deployed on Cloud Compute (Ubuntu 24.04) with Caddy and automatic HTTPS, systemd, a firewall, key-only SSH, and an update script. Live at https://straightto.health.
- Google Gemini: the agents' brain: tool-using agents, structured output and honest failures, with every call visible in the live timeline.
- Amazon Bedrock (Amazon Nova Lite): the automatic fallback when Gemini is rate limited or failing.
- Entire: the build session is attached as an Entire checkpoint and its token usage measured (506 API calls, 199.8M tokens, 98.8% context replay). We also used its code graph for search, with mixed results that we report as they were. The session was attached after the build rather than captured live.
- GoDaddy Registry: the live demo runs on straightto.health, a
.healthdomain.
Challenges we ran into
- Deciding what to build. Many ideas and several pivots before this one stuck.
- Pieces that didn't add up to a product. The first attempt produced separate demos of each integration; it took a clear plan to turn them into one thing.
- Agents that look smart are not the same as agents that are safe. Early drafts invented details ("within 24 hours") the records never said. The reviewer agent and code checks now catch that, and it is visible in the log.
- Model differences. The fallback model filled optional fields with empty strings and did not always forward a clinical question. We now clean model output and handle the highest-risk question types in code.
- Gemini's structured output rejects parts of JSON Schema, so we sanitise schemas and re-validate afterwards.
- The free-tier rate limit is easy to hit with several agents in one run. We added pacing, a queue for background work and the fallback.
- Too many tabs. The first version made a doctor hunt across pages to understand one visit. We rebuilt it around one visit status bar, one "next action", and a one-screen demo.
Accomplishments that we're proud of
- A real multi-agent chain with real hand-offs. In one run the reviewer rejected a draft that claimed a delay time the records never gave, and the Coordinator revised it.
- Safety enforced in code, and a live timeline that shows both the agents' work and every human decision.
- A one-screen demo of three roles at once.
- Measured Tiger Data results on 548,461 synthetic events: 9.3x compression and 12.3x faster aggregates.
- A live, deployed product with a custom domain, tests, and an accessibility scan with zero violations at the last run.
What we learned
- Agents earn trust through visibility and limits: a log you can read, tools they cannot exceed, and a human who decides.
- Put the rules a model must not break in code, and use the model for the parts that need language.
- AI is fast at building, but it needs a clear plan and a person who checks the result. Our first, plan-less attempt got complicated; the second, with a specification and principles, worked.
- Test the real thing. Almost every important bug here was found by driving a real browser against a real model.
- A clear "what do I do next" matters as much as the model.
What's next for Care ON
- Real pharmacy and EHR integrations in place of the simulator.
- Real authentication and rate limiting (the demo uses signed demo sessions).
- Visit transcripts turned into plain-language guidance.
- Appointment booking, caregiver sharing, and notification delivery by text or email.
- A dedicated Tiger Data aggregate for home readings.
- Testing in Safari, Firefox and on real phones.
All people, medicines and pharmacy events in the demo are fictional or simulated, and are labelled that way in the app. Care ON is not medical advice and not a medical device.
Testing instructions (for judges)
- Open https://straightto.health/demo/stage. It shows the doctor, the patient and the pharmacy side by side, with the live activity timeline. Press Start afresh.
- Doctor window: the board says "Record this visit". The notes are pre-filled: press Create draft for review, then tick the box and Approve care plan.
- Doctor window: "Send a prescription". It is pre-filled from the plan: press Authorize prescription.
- Pharmacy window: press Receive, Acknowledge, then Report a delay.
- Activity column: every human and system step appears, then the Coordinator wakes by itself, investigates, hands off to the Writer, gets reviewed, and proposes. Use the filter to follow one side.
- Doctor window: "Review what the agents prepared". Approve it. The patient's status bar shows the message.
Built With
- ai-agents
- amazon-bedrock
- amazon-nova
- caddy
- claude-code
- entire
- event-sourcing
- function-calling
- gemini
- godaddy
- healthcare
- multi-agent-systems
- nextjs
- node.js
- playwright
- postgresql
- react
- tailwindcss
- tiger-data
- timescaledb
- typescript
- vitest
- vultr
- zod
