Animated data flow diagram

AI WhatsApp Product Expert Agent (PDF Catalog Powered)

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

OpenAI WhatsApp Langchain

Overview

Unlock 24/7 Automated Product Expertise on WhatsApp with this AI Agent

This n8n workflow deploys an AI-driven Sales & Support Agent on WhatsApp. It ingests your existing product brochure (PDF), transforms it into a searchable knowledge base, and uses OpenAI's GPT-4o model to provide instant, accurate, and conversational answers to customer inquiries. Empower your business to handle product questions efficiently, improve customer engagement, and free up your team for more complex tasks.

This AI Agent demonstrates a powerful Retrieval Augmented Generation (RAG) pattern. It first loads and processes your product document, then uses this information to ground the LLM's responses, ensuring factual and relevant answers.

Key Features & Benefits

  • AI-Powered Q&A: Leverages OpenAI's GPT-4o and text-embedding-3-small models for natural language understanding and precise information retrieval from your product catalog.
  • Automated WhatsApp Interaction: Connects directly to your WhatsApp Business account, listens for incoming messages, and replies intelligently.
  • PDF Catalog Integration: Extracts text from your PDF product brochure, chunks it, creates embeddings, and stores them in an n8n in-memory vector store.
  • Conversational Memory: Maintains conversation history for each WhatsApp user (via Window Buffer Memory and a unique sessionKey per user), allowing for contextual follow-up questions and a more human-like interaction.
  • Selective Message Handling: Designed to process text-based queries, with a fallback message for non-text inputs (e.g., images, audio).
  • Customizable Agent Persona: The AI Agent's system prompt can be easily modified to match your brand's voice, specific product focus (e.g., Yamaha Powered Loudspeakers 2024 brochure as in the example), and interaction style.
  • Scalable Knowledge Base: While it uses a simple in-memory vector store for quick setup, this can be replaced with production-grade vector databases (e.g., Qdrant, Pinecone) for larger catalogs and more robust deployments.

Use Cases

  • B2C E-commerce: Provide instant, detailed answers on WhatsApp about product features, specs, and comparisons from your catalog.
  • B2B SaaS: Equip prospects with immediate brochure-based information on WhatsApp regarding software capabilities, pricing, and use cases.
  • Automated First-Level Support: Handle common product inquiries via WhatsApp 24/7, reducing support tickets and wait times.
  • Lead Qualification: Engage potential customers on WhatsApp, answer their initial product questions, and direct qualified leads to sales.
  • On-Demand Product Information: Allow field sales teams or partners to quickly query product details via WhatsApp.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • OpenAI API Key with access to GPT-4o (or similar powerful chat model) and an embedding model (e.g., text-embedding-3-small).
  • WhatsApp Business API account and credentials configured in n8n (for both Trigger and Send nodes).
  • A product brochure in PDF format. The template uses an HTTP Request node to fetch it from a URL, but you can adapt it to load a local file or use binary data.

Setup Instructions

This workflow has two main parts: creating the product catalog vector store (run once or on updates) and running the WhatsApp AI agent.

Part 1: Create/Update Product Catalog Vector Store

  1. Download the n8n workflow JSON file and import it into your n8n instance.
  2. Locate the 'get Product Brochure' (HTTP Request) node. Update its URL parameter to point to your product brochure PDF. Alternatively, modify this section to load your PDF by other means (e.g., Read Binary File node if uploading directly to n8n).
  3. Ensure the 'Extract from File' node is set to 'pdf' operation if you changed the input method.
  4. Configure the 'Embeddings OpenAI1' node (connected to 'Create Product Catalogue') with your OpenAI API credentials.
  5. The 'Create Product Catalogue' (Vector Store In Memory) node uses whatsapp-75 as memoryKey and has clearStore: true. This key must match the memoryKey in the 'Product Catalogue' node used by the agent. Adjust if necessary.
  6. Manually execute the workflow starting from the 'When clicking ‘Test workflow’' trigger. This will fetch, process, and store your brochure content in the vector store. Run this part again whenever your product brochure is updated.

Part 2: Configure and Activate the WhatsApp AI Agent 7. Configure the 'WhatsApp Trigger' node: select your WhatsApp credential and ensure it's set to trigger on 'messages'. 8. Configure the 'OpenAI Chat Model' (connected to 'AI Sales Agent') with your OpenAI API Key and select a model (e.g., gpt-4o-2024-08-06). 9. Configure the 'Embeddings OpenAI' (connected to 'Product Catalogue') with your OpenAI API Key and select an embedding model (e.g., text-embedding-3-small). 10. In the 'AI Sales Agent' node: * Review and customize the systemMessage to define your agent's role, knowledge domain (e.g., your specific product line and year), and how it should interact with users. 11. In the 'Window Buffer Memory' node: * The sessionKey is set to whatsapp-75-{{ $json.messages[0].from }}. This creates a unique memory for each user. The whatsapp-75 prefix should match the memoryKey used in the vector store nodes if you decide to change it. 12. Configure the 'Product Catalogue' (Vector Store In Memory) node to use the same memoryKey (e.g., whatsapp-75) as the 'Create Product Catalogue' node. 13. Configure both 'Reply To User' and 'Reply To User1' (WhatsApp send) nodes with your WhatsApp credentials and Phone Number ID. 14. Activate the workflow. It will now listen for incoming WhatsApp messages and respond using the AI agent and your product catalog.

Tags:

AI AgentWhatsApp AutomationOpenAIRAGCustomer SupportSales AutomationLangchainPDF ProcessingVector Store

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Schedule a Consultation