AI patient service for clinics

An AI agent that answers patients on WhatsApp, checks the calendar and books the appointment.

Case 01 · SaaS

The problem

A clinic’s front desk answers the same questions all day: opening hours, insurance, exam preparation. Some arrive as voice notes and some after hours, when nobody is there to answer.

What the system does

  • Answers patients on WhatsApp, in text or transcribed voice notes

  • Checks the calendar and proposes, confirms or cancels appointments

  • Answers from each clinic's own documents

  • Keeps context with conversation summaries

  • Serves several clinics from one instance

  • Shows metrics on a dashboard refreshed every 30 seconds

Architecture in three steps

  1. Receives the message

    The webhook checks the signature, drops duplicates, applies the per-phone limit and transcribes voice notes.

  2. Reads documents and the calendar

    The agent searches that clinic's documents and calls the calendar tools to find a free slot.

  3. Books and replies

    The appointment goes into the database, the reply returns through WhatsApp and the dashboard shows the conversation.

Security controls

  • HMAC-SHA256 signature checked on every webhook call

  • Data and document search separated by clinic

  • Message limit per phone number

  • Input filtered and truncated before it reaches the model

  • Database backups sent to encrypted storage

Stack. Backend: FastAPI · Agent: LangGraph, LangChain, OpenAI · Data: PostgreSQL, Pinecone · Dashboard: React, TypeScript · Infrastructure: AWS, Terraform, nginx

See the next case