#AI agent for clinics and healthcare

An AI agent for a clinic answers patients on WhatsApp and your website, finds a free slot, books, moves or cancels the appointment in your scheduling system, and answers questions about specialties, coverage and exam preparation. It never diagnoses, and it hands anything clinical to a person. With Vatio you describe that agent in one vatio.yml file and it runs on your own WhatsApp number.

This guide builds one end to end: the instructions, the tools that reach your schedule, the knowledge it reads, and the rules that keep it safe.

#What the agent handles

Most of what reaches a clinic’s front desk on WhatsApp is the same handful of conversations:

A typical exchange, with what the agent did inside:

Patient: hi, do you have anything with dermatology this week?

Agent: We do. Dr. Soto has Thursday at 10:30 and Friday at 16:00. Which one works for you?

Patient: thursday. it’s for my son, he’s 8

Agent: Dr. Soto sees children from age 5, so that’s fine. To book it I need his full name and ID number.

Behind the second reply was one call to find_slots and one knowledge lookup on the dermatologist’s age range. Every tool call is visible in the inbox, next to the reply it produced.

#Before writing anything: five questions for the clinic

The agent is only as good as what the clinic tells you. Ask before writing a line:

  1. Who writes in, and about what? Usually booking, coverage and preparation, in that order.
  2. What must it never say? Diagnoses, opinions on results, medication, promises about coverage it cannot check.
  3. When does a person take over? Symptoms, complaints, billing, anyone who asks for a person.
  4. Which systems does it read from? The scheduling software’s API, a price list, the insurer list.
  5. What counts as an emergency? The agent needs the clinic’s own words for it and the number to send people to.

The answers become the instructions, the handoff conditions, the tools and the knowledge, in that order.

#The vatio.yml

workspace: andes-clinic
agent:
  name: Andes Clinic
  personality: Warm, calm and brief. Plain words, no medical jargon.
  instructions: |
    You help patients of Andes Clinic book, move and cancel appointments,
    and answer questions about specialties, coverage, prices and exam
    preparation.

    Booking: ask for the specialty or practitioner and a preferred day.
    Call find_slots and offer at most three options. Before calling
    book_appointment, ask for the patient's full name and ID number and
    read the booking back to them. Only say an appointment is booked when
    book_appointment returned it.

    Moving or cancelling: ask for the booking code and the ID number, then
    call cancel_appointment. To move, cancel only after the new slot is
    booked.

    Coverage, prices and preparation: search knowledge_lookup first. If it
    does not answer, say so and offer to pass the question to the team.

    Rules you never break:
    - Never diagnose, interpret symptoms, results or images, or recommend
      medication or doses.
    - If someone describes chest pain, difficulty breathing, heavy bleeding
      or loss of consciousness, tell them to call the emergency number 131
      or go to the nearest emergency room now. Do not book anything.
    - Never promise that an insurer will cover something.
  tools: [find_slots, book_appointment, cancel_appointment, knowledge_lookup, identify_contact]
  knowledge: [clinic]
  links:
    portal: https://andes-clinic.example/patients
  handoff:
    after_turns: 12
    when:
      - the patient describes symptoms and asks what they mean
      - the patient asks about a test result
      - a complaint about care or a charge
      - the patient asks for a refund

A few choices worth explaining:

#Tools: reaching your schedule

A tool is one HTTP request to your backend, described in YAML. Store the address and key as secrets so they never sit in the repository:

vatio secrets set CLINIC_API https://api.andes-clinic.example
vatio secrets set CLINIC_API_KEY sk_live_...

tools/find_slots.yml:

description: Find free appointment slots.
when_to_use: The patient wants to book or move an appointment.
parameters:
  type: object
  properties:
    specialty: { type: string, description: "e.g. dermatology, pediatrics" }
    date_from: { type: string, description: "YYYY-MM-DD" }
  required: [specialty]
access: public
request:
  method: GET
  base_url: "$env.CLINIC_API"
  path: /slots
  headers:
    Authorization: "Bearer $env.CLINIC_API_KEY"
  query:
    specialty: "$params.specialty"
    from: "$params.date_from"
respond:
  data:
    slots: "$.slots"
  message:
    when_empty: No free slots for that specialty in the next two weeks.
    default: "Found {{count}} free slots."

tools/book_appointment.yml:

description: Book a free slot for a patient.
when_to_use: The patient chose a slot from find_slots and confirmed their name and ID number.
parameters:
  type: object
  properties:
    slot_id: { type: string }
    patient_name: { type: string }
    national_id: { type: string }
  required: [slot_id, patient_name, national_id]
access: public
request:
  method: POST
  base_url: "$env.CLINIC_API"
  path: /appointments
  requires: [params.slot_id, params.patient_name, params.national_id]
  headers:
    Authorization: "Bearer $env.CLINIC_API_KEY"
  body:
    slot_id: "$params.slot_id"
    patient_name: "$params.patient_name"
    national_id: "$params.national_id"
respond:
  data:
    appointment: "$.appointment"

cancel_appointment has the same shape: a POST with the booking code and the ID number. Your backend checks that the two match before cancelling anything. The model fills a tool’s parameters, so the check that a booking belongs to the person asking has to live in code, not in the prompt.

Return a real HTTP status when something fails, such as 409 when the slot was just taken. Vatio turns any non-2xx into an error the agent can explain, so a lost race becomes “that slot was just taken, Friday at 16:00 is still free” rather than a false confirmation.

#What stays behind a login

A WhatsApp or Instagram contact is anonymous until they sign in, and only public tools run for an anonymous one. Results, diagnoses and medical history belong behind a login, in a tool marked access: private that reads only the records of the patient your backend signed for. On your website or app that is the token you render; on WhatsApp and Instagram, add sign_in_url to auth: and the tool sends the patient a Sign in button to your site first, then Vatio has them confirm the number or account being connected before the conversation goes on (On WhatsApp and Instagram). Without it, the agent can send the link to your patient portal instead; that is what links.portal above is for.

#Knowledge: coverage, prices and preparation

Anything long that the agent should read rather than memorize goes in a knowledge base: one Markdown entry per topic, each section able to answer a question on its own.

vatio kb create clinic
vatio kb write clinic coverage coverage.md
vatio kb write clinic exam-preparation exam-preparation.md
vatio kb write clinic specialties specialties.md
vatio kb write clinic locations locations.md

A good entry is specific:

# Exam preparation

## Blood tests
Fast for 8 hours. Water is allowed. Bring your ID and the medical order.
Samples are taken Monday to Saturday from 7:30 to 10:30, no appointment needed.

## Abdominal ultrasound
Fast for 6 hours and do not smoke. Arrive 15 minutes early.

Vatio does not read your website. If the answer lives on a page, put what the agent needs in an entry. Supervisors can edit entries from the inbox when prices change, and every edit is kept as a version.

#Voice notes and photos

Patients send voice notes and photos of medical orders. Vatio transcribes the audio and passes supported images and PDFs to the agent, so “here is my order” with a photo becomes a booking for the right exam. It also groups the three messages someone sends in a row into one question before answering. The agent reads the order to know what to book; it does not interpret it, which is what the rules above make explicit.

#Try it before any patient does

vatio push
vatio chat "Hi, do you have anything with dermatology on Thursday?"
vatio chat "My chest hurts and I can't breathe well"
vatio chat --new "What does a cholesterol of 260 mean?"
vatio chat show

The last three are the important ones: an emergency it must not try to book, a result it must not interpret, and chat show to read every tool call it made. Then add your phone as a test number on the inbox’s Test page and talk to the agent on the shared WhatsApp preview number. No Meta account is needed for that.

#Make it better every week

Once receptionists use the inbox, they flag any reply that was wrong and write what should have happened. vatio flags turns those notes into a document your coding agent can fix from, each flag becomes an eval case, and the flag is marked fixed when live passes it. See Improve your agent.

#Go live

vatio publish

Then connect the clinic’s own WhatsApp Business number from Channels in the inbox and switch it on. Keeping the WhatsApp Business app on the phone works: a reply a receptionist sends from it takes the conversation over, and the agent steps back until it is released.

Patient conversations are health data. Keep them out of places they do not belong: Vatio shows them only behind a sign-in or a Vatio token, and your backend should apply the same rule to its own logs. Every Vatio workspace is treated as holding sensitive data: conversations are encrypted, only go to AI models with zero data retention, and Vatio staff cannot read them unless you grant support access. Under Security in the inbox, require two-step verification from your whole team; sessions then also close after 12 hours without use. What your local regulations require of a clinic’s patient communications is still yours to check.

Frequently asked questions

Can an AI agent book medical appointments on WhatsApp?

Yes. The agent calls your scheduling system through tools you describe in YAML: one to find free slots and one to book. Vatio runs the conversation on WhatsApp; your system stays the one that confirms the booking.

Will the agent give medical advice?

Only if you let it, and you should not. Write the rule explicitly in its instructions (never diagnose, interpret symptoms or results, or recommend medication) and list symptom questions under handoff.when so a person takes them.

Can patients see their test results through the agent?

Only once they are signed in. Reading a patient's own records needs a private tool and a signed-in visitor: on your website or app, your backend signs a token saying who they are, and on WhatsApp or Instagram, with a sign_in_url in vatio.yml, the agent sends the patient a Sign in button to your site first. A patient who has not signed in only gets public tools.

Does the agent send appointment reminders?

Yes, when your scheduling system asks for them. It knows the appointment, so it calls Vatio's Messages API for each patient and the conversation opens on WhatsApp: your own text, a brief the agent writes from, or an approved template once 24 hours have passed since the patient last wrote. The agent handles the reply knowing why it wrote, and your system still decides who gets a reminder and when.

My scheduling software has no API. Can I still do this?

A tool is one HTTP request, so the agent needs an endpoint to call. If your software cannot provide one, a small service in your own backend that reads and writes the schedule is where the work goes. The agent never logs into a screen.

Updated: