Structuring clinical notes in production with an AI copilot
The problem
A dentist I work with spends half the consultation typing notes into a patient record. The other half, they're wrestling with the UI. The gap between speaking and structured data is huge. They wanted to say "patient reports sensitivity to cold on tooth 14, recommend desensitizing paste" and have the record update itself.
That's the vision behind Melow, a multi-tenant AI agent platform that turns open-ended conversation into structured medical data. The first production client is a dental clinic, and the system is live today, updating patient records mid-consultation.
The approach
We built a voice-first pipeline: the dentist talks, Vapi handles speech-to-text, and an LLM service converts that transcript into a SOAP note, treatment plan, phased budget, and odontogram entries. The whole thing runs on Fastify, with Qdrant as the vector store for grounding the model on each clinic's own documents and protocols.
The hard part was never getting the LLM to produce readable text. It's getting it to produce *valid, structured, field-compliant output* every time, even when the dentist mumbles or uses obscure clinical shorthand.
What broke
Early on, the model occasionally invented fields or merged treatment steps incorrectly. A patient might get two appointments on the same date, or a budget line item would end up in the wrong category. That's not a demo problem—it's a production problem. A patient record is legal documentation.
So we made validation a first-class step. Every output goes through a schema check and a set of business rules before it touches the database. We also wrote 33 unit tests covering the LLM service and the conversation engine. Not tests that mock the model—tests that assert the system behaves correctly given known inputs.
The tradeoff
Security and cost drove a key decision. We bound Qdrant to localhost rather than exposing it as a network service, even though that makes horizontal scaling harder later. For a clinic, the data is sensitive and the deployment is single-tenant-ish per clinic. PM2 handles process management, Nginx terminates TLS, and Let's Encrypt keeps the certs fresh. It's boring, known infrastructure.
That's the point. The AI is the flashy part, but the system runs because the plumbing around it is boring and reliable.
If you're building AI products that need to produce structured data in a regulated space, the model is 20% of the work. The other 80% is validation, grounding, and deployment discipline.
Check the case study for more details on the stack and the actual results.

Building something like this? Tell me what you need and I'll scope it.
Start a project