May 29, 2026

WhatsApp AI Agent: RAG, operational context, and human handoff

AI AgentsRAGFastAPIWhatsApp

A WhatsApp AI agent is not useful if it only sounds conversational. It needs operational context, product constraints, and a reliable fallback path.

The version I built for bus ticketing focused on three layers:

  • Backend connection for availability, routes, schedules, fares, and reservations.
  • RAG over internal knowledge such as policies, FAQs, terminals, and baggage rules.
  • Guardrails with logging, error handling, and human handoff.

What makes this different from a generic chatbot

The agent has to know when not to answer. If the retrieved context is weak, if the user needs an operation that requires human confirmation, or if the backend fails, the correct behavior is fallback.

Stack

The project combines Next.js and React for the product surface, Python and FastAPI for backend orchestration, PostgreSQL for operational data, Qdrant for retrieval, and LangGraph-style flow control where state matters.

The real value

The value is not only lower support load. The real value is a consistent support flow that can be logged, audited, and improved without forcing every operator to answer the same question manually.