Home / Projects / AI Automation

ClinicDesk AI

A bilingual (Bangla and English) AI front desk for physiotherapy clinics. It answers patients on WhatsApp and the web, books appointments and hands over to staff when it should.

PythonFastAPIn8nGroqWhatsApp APIPostgres
Patient chat answering in Bangla with a cited source
Patient chat answering in Bangla with a cited source
Staff dashboard with bookings, escalations and AI cost
Staff dashboard with bookings, escalations and AI cost

The problem

Most small clinics in Dhaka get patient questions on WhatsApp, and the same ones repeat all day. Night messages wait until morning, and nobody tracks who asked but never booked. A careless chatbot is risky in healthcare: it can invent medical advice, miss an emergency, or be talked out of its rules. I built ClinicDesk AI to handle those three risks first, and to be cheap to run.

What it does

  • Answers health questions only from clinician-approved pages, and names the page it used.
  • Shows free slots and books appointments, in Bangla or English.
  • Spots warning signs (for example back pain with loss of bladder control), gives emergency advice and alerts staff, with no AI model involved.
  • Stops and waits for staff when a patient asks for a person.
  • A dashboard shows conversations, bookings, leads, escalations and AI cost per conversation in taka.
  • n8n workflows sync bookings to Google Sheets and Calendar, send WhatsApp reminders and email a daily report.

How a message is handled

Every message goes through the cheapest checks first. Safety checks are plain code rules, not prompt instructions, so they cannot be argued with and cost nothing.

Safety and privacy

  • Prompt-injection attempts are caught before the model and logged as security events.
  • The model can only call tools from a fixed list; every booking detail is checked in code.
  • Phone numbers, emails and national ID numbers are removed from stored chat logs.
  • Signed WhatsApp webhooks, per-sender and per-IP rate limits, and a token-protected admin API.

Model choice and cost

Works with Gemini, OpenAI, Claude or Groq. A small model sorts messages and a main model only runs when tools are needed. Every call is logged with tokens and cost, and the demo switches to an offline model if it hits its daily limit, so a busy day can never run up a bill.

Testing

54 automated tests and 25 conversation checks in both languages run on GitHub Actions on every push. Testing against real Groq models found four real bugs, including a wrong weekday in a booking confirmation, all now fixed and covered by tests.