Skip to content
mentoor

A voice receptionist for a clinic

For engineers

Scenario lesson and practice set combining Realtime voice agents, AI in clinical work, Health and sensitive data and Human in the loop. Completing it counts as evidence for every listed skill.

A phone receptionist that talks to patients is four problems at once: a live voice product, a health-care service, a pile of sensitive data and an agent that can change a schedule. Each one is manageable. The mistakes come from solving only one of them.

The case

Lakeside Family Clinic gets about the same calls every day: book, move or cancel a visit, ask about opening hours, request a refill, and now and then say something worrying. Front-desk staff are tied up and callers wait. The clinic wants a voice agent, built on a realtime model, to answer first. Staff stay in charge of anything clinical.

Why it matters

A voice agent is judged in real time by a person who may be unwell, in a hurry or hard of hearing. A cut-off sentence, a wrong appointment or a cheerful "it sounds like reflux" is not a UX bug. It can delay care or expose a patient's data. The clinic is also liable for what its vendor does with call audio.

How the pieces fit

Voice. Decide first whether to use a speech-to-speech model or a chain of speech-to-text, a language model and text-to-speech. The native model is often faster and more natural. The chain gives you exact scripted text, a clean transcript and the freedom to swap one stage. A clinic that must read a fixed greeting and keep transcripts usually values control over speed. The browser call button connects through a short-lived token minted by your server, never through a long-lived API key in page code.

Callers read out dates of birth and phone numbers with pauses. Tune turn detection so slow speakers are not cut off, and use end-of-turn detection that judges whether a sentence is complete. When a caller interrupts, stop playback and trim the stored reply to what they actually heard. Before any tool with a side effect, such as cancelling, read the details back and wait for a clear yes. Cover tool delays with a short filler phrase.

Clinical line. Booking and hours are administrative. Symptom assessment, diagnosis hints and dosing advice are clinical, and software that does them can be a regulated medical device. Keep the agent on the administrative side and write that boundary into its instructions and its tests. Validate it on the callers the clinic really serves, split by language, accent and line quality, and keep watching after go-live. A good overall rate can hide a group that fails.

Sensitive data. A patient's name with a clinic and a time is health information. In the US, a vendor that handles it for the clinic is a business associate and needs a signed agreement before audio is sent. In the EU, health data is special-category data under GDPR Article 9 and needs a legal basis. Voiceprints used to identify callers are biometric data with extra consent rules, so verify with details plus a call-back instead. Store only what you need: no audio unless you can say why, masked identifiers in logs, and a retention limit.

Human in the loop. Sort every tool by risk. Reading hours runs freely. Cancelling needs the caller's confirmation. Releasing a refill needs a nurse. Deleting a record is blocked. Escalation rules are policy, not mood: words suggesting a possible emergency stop the booking and send the caller to emergency services, whatever the model's confidence. When the agent hands over to staff, the summary says what was verified, what was promised and what is open. When a nurse must approve, the prompt shows who, which drug and which dose. A button that says "Approve all 14" is a rubber stamp. Every action logs the state before and after so a mistake can be undone.

Before and after

Before: one realtime session, the provider key in the page, a log with names and audio kept for a year, and a refill sent straight to the pharmacy queue. The agent tells a worried caller their symptoms are probably minor.

After: a scripted greeting, a server-minted token, masked 90-day transcripts, a nurse approval that shows the drug and dose, and a hard rule that chest pain ends the booking flow with an emergency instruction.

What goes wrong

  • Teams tune the voice and forget the compliance paperwork, so audio flows to a vendor with no agreement.
  • A strong demo with staff voices hides failures on accents and phone noise.
  • Approval prompts without details are clicked through, so the gate protects nobody.
  • A handoff summary that says "verified" when it was not lets staff reveal private details.

Work through the steps below in order. Each one is the point where a different skill decides what happens next.

Steps

  1. Choose the voice architecture

    Skill: voice-realtime

    Pick a chained pipeline when the clinic needs a fixed greeting, word-for-word transcripts and the freedom to change one stage. Pick a speech-to-speech model when natural, fast conversation matters more than step-level control. Connect the browser with a short-lived token from your server, never with a long-lived API key in page code.

    Architecture comparison for the clinic
    NeedChained pipelineSpeech-to-speech
    Fixed legal greetingExact text played verbatimNeeds a scripted first turn
    Transcript for disputesFirst-class outputSide product
    Swap the language modelReplace one stageReplace the whole model
    Response speedThree hops, slowerOften faster
  2. Make the call feel natural and safe

    Skill: voice-realtime

    Raise the silence window and use end-of-turn detection so callers reading digits are not cut off. On barge-in, stop playback and trim stored history to what the caller heard. Read back booking details and wait for a clear yes before cancelling or moving a slot. Speak a short filler while a tool runs.

  3. Draw the clinical line

    Skill: reg-health

    List what the agent may do (book, move, cancel, give opening hours) and what it may not (assess symptoms, suggest a diagnosis, advise on doses). Test the boundary with worried-caller scripts. Validate the tool on the clinic's own callers, split by language, accent and line quality, and monitor the same splits after go-live.

  4. Protect the data

    Skill: privacy-sensitive

    Before any audio leaves the clinic, sign a business associate agreement with the vendor (US) or establish the Article 9 condition (EU). Drop audio storage unless it has a stated purpose, mask identifiers in logs, and set a retention limit. Verify callers with details and a call-back, not a voiceprint, unless there is explicit consent and an alternative.

    Minimal logging configuration

    recording.yaml

    store_audio: falsestore_transcript: truetranscript_retention_days: 90mask_fields: [caller_name, date_of_birth, phone]vendor_training_opt_in: false
  5. Gate the actions

    Skill: agent-hitl

    Classify each tool: free, confirm with caller, nurse approval or blocked. A refill is released by a clinician, never by the agent. Write the emergency-symptom rule as a policy trigger that ends the booking flow and tells the caller to contact emergency services.

    Escalation and approval policy
    1. Read-only tools about public information run freely.
    2. Cancelling or moving a slot requires a read-back and a clear yes from the verified caller.
    3. Refill requests are queued as pending and released only by a nurse.
    4. Any mention of chest pain, trouble breathing, stroke signs or thoughts of self-harm stops the booking flow and directs the caller to emergency services.
    5. Record deletion is never available to the agent.
  6. Hand over, approve and audit

    Skill: agent-hitl

    The handoff summary states what was verified (including failed checks), what was offered and what is open. The nurse's approval prompt shows patient, drug, dose and what the agent checked, with no approve-all button. Every action records the state before and after so staff can undo it, and a paused refill resumes from saved state without sending twice.

Skills this scenario uses

Where to study