SanaMente
SanaMente is an all-in-one practice platform for private-pay mental-health clinics in Mexico, built Spanish-first. A therapist prepares for the session, records it or uploads it, gets an AI-drafted note, and signs it into a record that can't be changed afterward. The project started as a market thesis that I tested in more than two dozen interviews with clinicians. In seven months it became a production app on Vercel and Neon Postgres, with an invite-only pilot launching in December 2026. I founded it and lead it as technical product lead.
At a glance
- Role
- Founder & Technical Product Lead
- Timeline
- Feb 2026 – present (discovery Feb – Jun, build from Aug)
- Team
- Me + 1 engineer
- Status
- Invite-only pilot launching December 2026 with 3 private practitioners
- What I owned
- Product definition, compliance design, AI vendor selection, pricing and unit economics, architecture, and most of the production build since August 2026 (AI-assisted with Claude Code): about 2,500 commits and roughly 280,000 lines of code added, across components, pages, the API, and the clinic-accounts and help content. Our engineer contributed early backend and API work.
- Results
-
- 24 clinician interviews shaped the core flow
- 50-psychologist clinic signed on as design partner
- Production app on Vercel and Neon Postgres
- Unit-economics model targeting 60% gross margin
/ The Challenge
Mexican clinicians work with generic, English-first tools and lose hours every week to documentation. NOM-004 and NOM-024 make clinical notes mandatory and require keeping them for at least five years, and Mexico's data-protection law, LFPDPPP, treats health data as sensitive personal data. No Spanish-first platform built around these rules used AI to take the writing off the clinician. And AI on every session has a real cost per note, so the price has to cover it.
/ Approach
- 01
Found the opportunity in the data, then validated it with clinicians. I mined therapist communities and cross-checked the size of the Mexican market. More than two dozen interviews then set the core flow: prepare → capture → note → sign → schedule.
- 02
Designed for the regulation from day one. NOM-004, NOM-024 and LFPDPPP became product rules, enforced in the database as well as the interface.
- 03
Chose the AI stack on cost and quality, and kept measuring. I compared six speech-to-text and LLM providers and built a unit-economics model that recalculates margins whenever a vendor rate, model or prompt changes.
- 04
Moved from solo practitioners to clinics. Onboarding effort stays flat per account, while revenue grows with every clinician. That made clinics the real customer.
- 05
Shipped in reviewable layers, across real environments. I built in dependency order: identity and access first, then data and policies, then features. Production launched on 3 October 2026 on its own Neon project and stays invite-only, ahead of the pilot launching in December 2026.
The full rule lists and build details are in the Technical deep dive below.
/ In the App
/ Unit economics & go-to-market
Prices include IVA (Mexican VAT). Net revenue is after IVA and Stripe fees.
| Plan | Price / seat / month | AI sessions included | Net revenue / seat |
|---|---|---|---|
| Basic | MXN 399 | 20 | ≈ MXN 321 |
| Pro | MXN 749 | 100 | ≈ MXN 605 |
An in-office session costs about US$0.27 in AI; an online session about US$0.46, because both channels are transcribed. Gross margin on AI cost:
| 0% online | 50% online | 100% online | |
|---|---|---|---|
| Basic, all 20 sessions used | 70% | 59% | 49% |
| Pro, 91 sessions (design-partner pace) | 28% | 2% | −24% |
| Pro, 91 sessions, joined track | 28% | 32% | 37% |
At the 50-psychologist design partner's volume, online sessions would make Pro unprofitable, which drove the joined-track work. A second speech vendor could lift Pro to about 60% at any mix, pending the attorney's review.
-
Invite-only pilot. Launches in December 2026 with 3 private practitioners: a 30, 45 or 60-day pilot with an AI quota, then read-only.
-
Ambassador program. 100% of a new therapist's first month, then 10% of their monthly revenue for months 2–13.
-
Referral credit. Each side gets a free month (30 days).
/ Outcomes
-
In production since October 2026 on Vercel and Neon, with demo, staging and production environments and Stripe billing for Basic and Pro.
-
A 50-psychologist clinic as design partner and an invite-only pilot launching in December 2026 with 3 private practitioners.
-
The full clinical loop — prepare, record or upload, transcribe, AI note, sign, lock, plus treatment plans and print/PDF export.
-
Practice operations — busy-time-protected calendar, WhatsApp reminders, a patient inbox, and director, clinician and assistant roles.
-
Compliance in the code — consent before recording, uneditable signed records, gapless folios, five-plus-year retention, private files, two-factor sign-in, and consent-based read-only support access.
-
AI held to a measured standard — a written evaluation method, dated case studies, and pricing tied to every model choice.
-
Scale, as of 26 November 2026 — 194 database migrations, 112 API endpoints, about 3,300 commits since April 2026, about 3,900 automated tests, and 66 live-database checks.
/ Artifacts
Technical deep dive Architecture, implementation details, and the problems along the way ~6 min read
~6 min read
/ Approach, in detail
Found the opportunity in the data, then validated it with clinicians. A 50-psychologist clinic became the design partner. Its real volume of about 91 sessions per therapist each month replaced my founder estimate in the pricing model.
Designed for the regulation from day one. NOM-004, NOM-024 and LFPDPPP became product rules, enforced in the database as well as the interface:
- Recording is blocked until the patient's consent is on file.
- A note can be signed only when every section is complete or marked «No aplica». Signing requires the clinician's professional licence number (cédula), and each clinician can have several.
- Signed notes and treatment plans get gapless folio numbers and can't be edited. A correction is an addendum, never an edit.
- Records are kept for at least five years, and accounts can only be archived. In production, an account can be deleted only if it holds no clinical data.
- Patient files are never public. The app stores an object key, and every time a file is opened the server checks access and signs a short-lived URL.
Open legal questions went to a healthcare attorney as a tracked list. Features that depend on the answers ship behind flags. Live in-session recording, for example, stays off in production until the attorney approves the consent text.
Chose the AI stack on cost and quality, and kept measuring.
- Transcription: AssemblyAI Universal-3.5 Pro, in Spanish, with speaker labels so the note knows who said what.
- Notes: OpenAI GPT-4o, with a "source-only" prompt that writes nothing the transcript doesn't support and leaves a section blank rather than guess. A smaller model, GPT-4o-mini, handles narrow classification jobs.
- Evaluation: every prompt or model change is scored against a fixed set of transcripts using a written methodology. Each evaluation that informs a decision gets a dated internal case study, including revenue and margin impact, published in the admin portal.
The case studies include the results that didn't favour the change. A cheaper "lean" prompt invented nothing and ran faster (3.4 s instead of about 5 s), but it missed more important details: 19 serious omissions against 15 for the production prompt. It stayed a staging-only candidate rather than shipping.
Moved from solo practitioners to clinics. I added:
- clinic accounts and invitations, where a clinician who joins a clinic has their own subscription cancelled and refunded;
- a director role that runs the clinic without reading clinical content;
- an assistant role that schedules, creates assigned patients and works the reminder queue, but never sees notes;
- patient reassignment and record sharing based on consent;
- two plans, Basic and Pro, with per-plan AI quotas and Pro-only features.
Shipped in reviewable layers, across real environments. Every change goes from pull request to staging to main, and is checked on live staging before release. The work runs as several parallel engineering sessions on separate branches, one for backend and migrations and one for screens. Production migrations go through a single guarded runner.
/ In the App, in detail
Dashboard. A clinic-wide view of today's sessions, notes waiting for a signature, and the next appointment, which the clinician can prepare in one click.
Patient record. CIE-10 diagnosis, consent status, session history with signing state, and tabs for the treatment plan, communications and private documents. On Pro, it also holds an extended clinical history.
Session preparation. A summary of the last signed note, which the AI can regenerate, alongside the diagnosis, treatment plan and session count.
Session capture. The transcript comes back labelled by speaker. Record in person in the browser, or upload a remote session from Zoom or WhatsApp. Recording starts only when consent is on file. Audio is deleted within 24 hours of transcription.
AI-drafted note. SOAP, DAP, progress or custom format. The note can't be finalized until every section is filled or marked «No aplica». It flags a question the patient avoided answering, in a sentence written by code rather than by the model.
Signed note and treatment plan. Gapless folio, licence number and time of signing. Locked against database edits, with print or PDF export.
Clinic calendar. iCal busy-time feeds guard against double booking, and Google events can become SanaMente sessions. WhatsApp reminders let patients confirm or ask to reschedule from the chat.
Clinic team. Workload per therapist, plus the assistant role that schedules and works the reminder queue without seeing clinical notes.
Help centre. Five guides, one per account type, written from a single set of topics. Each screenshot is captured automatically from the running app, so the guides keep up with the interface.
Administration. One internal portal with three areas: Clientes (accounts, trials, pilots, support access), Crecimiento (ambassadors, referral links, sales materials, blog) and Producto (model evaluation, case studies). Only admins appoint other admins, and only the owner appoints the first ones.
/ Selected Technical Challenges
Row-level security with a third-party identity provider. The browser reads the database directly through Neon's Data API (PostgREST). Every table is protected by Postgres row-level security keyed to the Clerk user. The clinician's ID has to be the Clerk user ID, and the login token has to carry the right role claim. An audit of every write policy closed eight gaps, including one that let a user assign themselves to another clinic. Sixty-six check scripts run against the live database (policies, triggers, retention, plans, roles) and catch drift before it ships.
Support access without a back door. SanaMente staff can enter an account only with that clinician's consent, given for 24 or 48 hours. They enter read-only, with an act claim in the token, and every read is written to an activity log the clinician can see. A write lock in SQL stops any change during that session. The Clerk dashboard's own impersonation feature isn't used.
Transcribing a 50-minute session on serverless. Audio goes to private object storage, a transcription job starts, and a webhook writes the transcript back. An hourly job deletes the audio within 24 hours. Online sessions cost twice as much to transcribe, because each stereo channel is billed. The fix is a joined speech track: the server detects speech on each channel, cuts out silence and echo, joins what's left into one mono track with a map of where each piece came from, transcribes it once, and maps every word back to the right speaker. Speaker roles stay exact, and only about 82% of the session is billed. The joined track is built and on staging, waiting on role-play recordings before production.
WhatsApp and Google Calendar as two-way systems. One shared WhatsApp number routes every message to the right patient record. It respects Meta's 24-hour window, rejects messages whose signature it can't verify, and never drops or duplicates a message. Each clinician chooses between their own WhatsApp and the SanaMente number; sending stays manual until Meta approves the message templates. Direct two-way Google Calendar sync is built (push notifications, an outbox, drag to reschedule, and a busy-time guard) and ships when Google finishes its OAuth verification.
Proving a compliance-heavy system stays correct. About 3,900 automated tests in 366 files, plus Playwright end-to-end specs and the live-database checks, run on every change. CI typechecks, lints, tests and builds in a few minutes. Staging and demo each have their own Neon branch. The demo data refreshes from staging, and demo trials extend themselves so a sales demo never lands on an expired account.
/ Unit economics & go-to-market, in detail
The model exposed something that only showed up at the design partner's volume: online sessions would make Pro unprofitable. That finding drove the joined-track work. Testing a second speech vendor, which charges less and includes speaker labels, could lift Pro to about 60% at any mix of online sessions. That vendor is on hold until the attorney reviews it as a new processor of clinical audio.
Invite-only pilot.. The pilot launches in December 2026 with 3 private practitioners. Clinics apply at sanamente.ai/piloto and get a 30, 45 or 60-day pilot with an AI quota. When the pilot ends, the account turns read-only instead of starting a trial.
Ambassador program.. Each ambassador gets referral links and earns 100% of a new therapist's first month, then 10% of that therapist's monthly revenue for months 2–13. Internal training covers prospecting, scripts for DM, email and WhatsApp, and a certified demo guide.
Referral credit.. When a colleague signs up through a therapist's link, each gets a free month, worth 30 days.