workflows.fit
Back to n8n workflows
n8n templateFreeBy Akshay

WhatsApp virtual agent with Gemini AI - handles text & voice with knowledge base

Overview This project is an AI-powered WhatsApp virtual agent built using n8n, designed to handle both text and voice-based customer messages automatically. The workflow integrates Google Gemini, Pinecone, and the Wha...

DevelopmentCore NodesCommunicationHITLAILangchainAgentLm Chat Google Gemini
Loading interactive preview...

Template notes

Overview This project is an AI-powered WhatsApp virtual agent built using n8n, designed to handle both text and voice-based customer messages automatically. The workflow integrates Google Gemini, Pinecone, and the WhatsApp Business API to provide intelligent, context-aware responses that feel natural and professional.

---

How It Works

Message Detection The workflow begins when a message arrives on WhatsApp. It identifies whether the message is text or voice and routes it accordingly.

Voice Message Handling 1. Audio messages are securely downloaded from WhatsApp. 2. The files are converted to Base64 format and sent to the Gemini API for transcription. 3. The transcribed text is then passed to the AI Agent for further processing.

AI Agent Processing The LangChain AI Agent acts as the brain of the system. It uses: - Google Gemini Chat Model for natural language understanding and response generation. - Pinecone Vector Store to retrieve company-specific information and product data. - Memory Buffer to remember the last 20 user messages, ensuring context-aware responses.

The agent also follows a set of custom communication rules — replying only in approved languages, skipping greetings, and focusing on direct, helpful, and professional responses (e.g., product recommendations, support, or guidance).

Knowledge Retrieval The AI Agent connects to a Pinecone database containing detailed company data, such as product catalogs or service FAQs. Using Gemini-generated embeddings, it retrieves the most relevant information for each user query.