RAG-powered WhatsApp AI agent that answers patient questions from a medical knowledge base, with escalation to a human agent.
A medical centre needed a WhatsApp agent that could answer patient questions accurately — not just generic responses. They also needed a clear handoff mechanism so complex cases reached a human immediately, and a log of every conversation for compliance.
I built an n8n workflow that embeds the clinic's knowledge documents into a Pinecone vector store using Gemini embeddings (3072 dimensions). Incoming WhatsApp messages trigger a RAG retrieval, Gemini synthesises a response from the retrieved context, and a confidence-based escalation logic routes low-confidence queries to a human agent. All interactions log to Airtable.
n8n workflow showing RAG retrieval, Gemini response, and escalation logic
Airtable log of all conversations with escalation flags