Repo
https://github.com/yurishevtsov/klarity-companion
TL;DR (short summary)
Klarity Companion is an AI care layer for the Klarity Health mental health practice platform that fills the gap between visits with three connected surfaces: Retell-powered voice agents that call patients post-prescription for structured check-ins, an ADHD/psychiatry-aware text coach for daily support, and a unified clinician dashboard with auto-generated SOAP notes and pre-visit briefs. The backend runs on InsForge for Postgres, auth, edge functions, and realtime subscriptions that push updates to clinicians the moment a call ends. The whole stack is deployed on Zeabur with public webhook endpoints wired to Retell, and the pitch opens with a patient-narrative clip generated by Pixverse. Five sponsors, one product, all aimed at one outcome: turn the 23 hours and 50 minutes between visits into measurable clinical value.
Inspiration
Klarity's own State of Independent Private Practice report says it plainly: 41% of mental health practices lose 11+ hours a week to admin, 41% cite DEA telemedicine rules as their top regulatory risk, and 36% use no AI tools. The visit is 50 minutes. The 23 hours and 50 minutes between visits is where ADHD patients forget meds, side effects go unreported, and providers fly blind into the next appointment. We wanted to build the layer that lives in that gap.
What it does
Klarity Companion is an AI care layer for psychiatry and therapy practices, with three connected surfaces:
- Sentinel — A Retell-powered voice agent that calls patients on day 7, 14, and 30 after a prescription. Runs a structured check-in (side effects, sleep, mood, PHQ-2, diversion screen for stimulants), auto-generates a SOAP note, and flags risk for clinician review.
- Coach — An ADHD/psychiatry-aware text companion patients can talk to anytime. CBT-style techniques, task breakdown, body doubling, medication-aware nudges. Escalates anything clinical.
- Clinician dashboard — Unifies both streams per patient, with a one-paragraph pre-visit brief that turns two weeks of context into a five-second read before the next appointment.
It's compliance-as-a-byproduct (DEA monitoring evidence is generated automatically), retention by design (more touchpoints, less drop-off), and provider efficiency without replacing the clinician.
How we built it
- Frontend: Next.js (App Router) + TypeScript + Tailwind + shadcn/ui
- Backend: InsForge for Postgres, auth, edge functions, and realtime subscriptions that update the clinician dashboard live
- Voice: Retell AI for HIPAA-grade voice agents with sub-second latency and post-call webhooks
- AI: Claude API for the coach reasoning, real-time risk classification, SOAP note generation, and pre-visit brief synthesis
- Hosting: Zeabur for one-click deployment with public URLs (critical — we needed a public webhook endpoint for Retell)
- Polish: ~Pixverse for the patient narrative clip in our pitch deck~ didn't have time to implement
The flow: patient talks to Coach or Sentinel → conversation streams to InsForge → Claude generates a clinician-ready note with risk flags → realtime subscription pushes to provider dashboard → pre-visit brief synthesizes everything when the next appointment opens.
Challenges we ran into
- Wiring Retell's post-call webhook to a public endpoint inside a 3-hour build meant deploying to Zeabur in the first 30 minutes, before any real code existed
- Designing the risk classification layer to be conservative without being noisy — false negatives are dangerous, false positives erode clinician trust
- Keeping the coach's tone authentically helpful for ADHD users instead of generic chatbot fluff
- Scope discipline. We cut inbound voice intake and SMS to keep the demo tight.
What we learned
- Most mental health AI demos focus on documenting the visit. The bigger opportunity is everything around it.
- Voice + text + clinician synthesis is more useful as one loop than three separate products.
- DEA telemedicine compliance is a feature you can deliver as a byproduct of good monitoring, not as its own product.
What's next
- Clinical advisory board review of all coach prompts and Sentinel call scripts
- BAA agreements with Retell and InsForge for production HIPAA posture
- Integration with Klarity's existing EHR/scheduling data
- Outcome studies on retention and PHQ-9/GAD-7 trajectories vs. control
- Multi-language support (Spanish first, given practice demographics)
Built With
- anthropic
- claude-api
- insforge
- nextjs
- pixverse
- postgresql
- retell-ai
- shadcn-ui
- tailwindcss
- typescript
- vercel-ai-sdk
- zeabur