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
Receives the message
The webhook checks the signature, drops duplicates, applies the per-phone limit and transcribes voice notes.
Webhook- Assinatura conferida
- Mensagem sem duplicata
- Limite por telefone
- Áudio transcrito
Reads documents and the calendar
The agent searches that clinic's documents and calls the calendar tools to find a free slot.
Agente da clínicaOnlineHoje, 19:42Oi, quero marcar retorno com a dermatologista. Tem horário na quinta?Tem sim. Quinta às 14:30 ou às 16:00. Confirmo às 14:30?Agenda da clínicaConvênios aceitosPode confirmar.Escreva uma mensagemBooks and replies
The appointment goes into the database, the reply returns through WhatsApp and the dashboard shows the conversation.
- Consulta confirmadaQuinta, 14:30 · dermatologia
- Resposta enviadaPelo WhatsApp do paciente
- Painel atualizadoAgendamentos de hoje: 6
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