The follow-up agent.
The recommendation engine decides what should happen in the exam room. The follow-up agent decides what should happen after. It reads the doctor's SOAP note, plans outbound communications to recover declined items and close the loop on follow-ups, drafts each SMS / email / phone script, and queues everything for human approval. Nothing sends without a click.
How it works
A four-stage linear pipeline, each stage a single call to Claude with a structured JSON output contract:
Parse
Reads the SOAP note. Extracts services performed, services declined (with reasons), follow-up items with source lines, and recall timing.
Plan
Decides outbound actions. Cost declines → phone with payment options. "Pet seems fine" declines → email explaining clinical rationale. Recalls → SMS reminder.
Draft
Writes each message. SMS ≤160 chars, email with subject + body, phone script with opener + pushback responses. Cites source lines from the note.
Queue
Drafts go to the review queue below. Doctor approves or rejects each one. Approved items record to the sent log. Nothing actually transmits.
1. Load a SOAP note
2. Pipeline execution
3. Review queue
4. Sent log
Last 15 actions that were approved or rejected. Persists across page reloads via browser storage. Refresh the page to confirm.
Safety & guardrails
Source-line provenance
Every drafted message shows the source line(s) from the SOAP note that justify it. If the agent makes a clinical claim, you can expand the "Source from note" section to see exactly which phrase it's drawing from.
Confidence flagging
Each action carries a confidence score. Anything below 55% is highlighted; anything the agent itself flags as "needs doctor review" shows a warning banner on the card. Low-confidence drafts default to rejection unless you explicitly approve.
No diagnosis in drafts
The draft prompt explicitly forbids the agent from stating or implying a diagnosis. "Recommend follow-up to discuss test results" is allowed; "Your pet has kidney disease" is not. The agent is a coordinator, not a clinician.
Linear pipeline, not autonomous agent
The pipeline is fixed: parse → plan → draft → queue. The agent does not choose its own tools or take actions in an unexpected order. This is deliberately less sophisticated than a true tool-calling agent. Predictability matters more than cleverness for clinical workflows.
From recommendation to recovery, in one architecture.
The recommendation engine captures visit revenue. The cohort dashboard proves the engine learns. The follow-up agent recovers what was declined. Together, they turn a static visit into a compounding clinical relationship.