Case study
Clinic AI Receptionist
A Thai-speaking receptionist for clinics that answers calls and LINE messages, with a safety layer, staff handoff and every conversation on record.
The challenge
A clinic front desk cannot answer every call. Calls arrive after hours, during procedures and at the busiest moments of the day, and each one that goes unanswered is a patient who may not call back. Messages on LINE pile up the same way.
The hard part is not getting an AI to talk. It is getting one to speak natural Thai on a phone line, stay inside what a receptionist should say, and know when to step aside for a person.
Our approach
We treated it as a reception system, not a chatbot. One knowledge base per clinic, editable by the clinic, feeds both channels, so a caller and a LINE user get the same answers in the same voice.
Rules that must never break live in code, not in the prompt. Every reply goes through deterministic checks before a patient sees or hears it. Releases are gated, and each one can be rolled back in a single step.
What we built
- Thai voice on the phone. Our own real-time loop from speech, to a language model, back to speech, tuned for Thai, with barge-in so a caller can interrupt naturally.
- LINE in the same voice. The clinic’s LINE Official Account answers from the same knowledge, and merges a burst of short messages into one turn before replying.
- A safety layer. It is built not to answer clinical questions such as diagnosis or dosing; it points the patient to a doctor or clinic staff instead. Filters check every reply, and abuse and cost gates stand in front of every conversation.
- Staff handoff. Staff can pause the AI, take over a conversation, or receive a flagged case in their LINE group when a caller needs a person.
- Observability. Conversations are traced end to end, a live view shows what is happening right now, and cost is tracked per conversation against a cap set for each clinic.
- Durable records, real erasure. Records are written to a database we operate on the clinic’s behalf and replicated off the machine continuously. Recovery is rehearsed, and an erasure request stays erased even after a restore.
Stack
- TypeScript
- Node.js
- Fastify
- Twilio Media Streams
- LINE Messaging API
- Streaming speech-to-text
- Claude and Gemini
- Google Cloud text-to-speech
- SQLite with Litestream
- Fly.io
- Playwright
Outcome
- Thai phone conversations that hold up on real carrier audio, including the silent gaps phone networks introduce.
- Replies that stay inside a receptionist’s lane, enforced by code rather than hoped for in a prompt.
- A front desk that stays in control: the AI steps aside the moment a person is needed.
- A foundation that grows with the clinic. The next step is connecting to the systems a clinic already uses.