πŸ’¬ WhatsApp virtual agent with Gemini AI - handles text & voice with knowledge base

⚑ 1,751 views Β· πŸ’¬ Support Chatbots

Description

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:

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.

Response Delivery

Once the AI Agent prepares the response, it is instantly sent back to the user via WhatsApp, completing the conversational loop.


Who It’s For

This system is ideal for businesses seeking to automate their customer communication through WhatsApp. It’s especially valuable for:


Tech Stack & Requirements


Key Features


Setup Instructions

1. Prerequisites

Before importing the workflow, ensure you have:

2. Environment Setup

3. Pinecone Configuration

4. WhatsApp API Configuration

5. AI Agent Customization

You can personalize how the AI behaves by editing the system prompt inside the AI Agent node:

6. Handling Voice Messages

7. Testing


Customization Options

🧩 AI Behavior

🌍 Multi-language Support

πŸ“¦ Industry Adaptation

πŸ”— Nodes Used

HTTP Request, WhatsApp Business Cloud, AI Agent, Simple Memory, Pinecone Vector Store, WhatsApp Trigger

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup