How shahzain-ali/whatsapp-ai-receptionist works
WhatsApp Digital FTE is a clinic receptionist that answers patient questions from a business profile and handles appointment booking against Google Sheets. The main workflow is patient message → webhook routing → per-phone ADK session → agent reply → WhatsApp delivery. Booking checks live availability, prevents duplicate bookings, and either confirms directly or routes the request through owner approval. The graph also includes the prompt and knowledge layers. Relationships follow the README and shown source; unshown internals are omitted rather than inferred.
Main entry points: main.py FastAPI webhook · webhook_agent.py Customer agent · whatsapp_client.py Message delivery · sheets_client.py Sheets client
Components 17
WhatsApp channel
- WhatsApp Cloud API
- FastAPI webhook
whatsapp_webhook/main.py - Message delivery
whatsapp_fte/whatsapp_client.py
Agent conversation
- Session bridge
whatsapp_webhook/agent_bridge.py - Customer agent
whatsapp_fte/webhook_agent.py - OpenAI model
- Prompt loader
whatsapp_fte/prompt_loader.py - Customer prompt
whatsapp_fte/prompts/customer_agent.txt - Knowledge context
whatsapp_fte/knowledge_base.py - Clinic profile
whatsapp_fte/business_profile.json
Booking backend
- Booking tools
whatsapp_fte/webhook_agent.py - Slot logic
whatsapp_fte/availability.py - Sheets client
whatsapp_fte/sheets_client.py - Google Sheets
Owner approval
- Pending bookings
whatsapp_fte/booking_store.py
Other components
- Patient
- Clinic owner
Connections 23
- Patient → WhatsApp Cloud API: sends messages
README.md - WhatsApp Cloud API → FastAPI webhook: posts messages
README.md - FastAPI webhook → Session bridge: routes customer
whatsapp_webhook/main.py - Session bridge → Customer agent: runs agent
whatsapp_webhook/agent_bridge.py - Customer agent → OpenAI model: reasons with
README.md - Customer agent → Prompt loader: loads instruction
whatsapp_fte/webhook_agent.py - Prompt loader → Customer prompt: reads prompt
whatsapp_fte/prompt_loader.py - Customer agent → Knowledge context: builds context
whatsapp_fte/webhook_agent.py - Knowledge context → Clinic profile: reads profile
whatsapp_fte/knowledge_base.py - Customer agent → Booking tools: registers tools
whatsapp_fte/webhook_agent.py - Booking tools → Slot logic: checks slots
whatsapp_fte/webhook_agent.py - Booking tools → Sheets client: reads and writes
whatsapp_fte/webhook_agent.py - Booking tools → Pending bookings: records pending
whatsapp_fte/webhook_agent.py - Slot logic → Sheets client: uses sheet data
- Sheets client → Google Sheets: reads and appends
whatsapp_fte/sheets_client.py - Booking tools → Message delivery: notifies owner
whatsapp_fte/webhook_agent.py - FastAPI webhook → Pending bookings: resolves request
whatsapp_webhook/main.py - FastAPI webhook → Sheets client: persists approval
whatsapp_webhook/main.py - FastAPI webhook → Message delivery: sends reply
whatsapp_webhook/main.py - Message delivery → WhatsApp Cloud API: sends text
README.md - WhatsApp Cloud API → Patient: delivers reply
README.md - Message delivery → Clinic owner: sends approval request
- Clinic owner → WhatsApp Cloud API: replies YES or NO
README.md