WhatsApp Sales Agent with Product Brochure Knowledgebase
detail.loadingPreview
Automate WhatsApp customer inquiries using an AI Sales Agent with a dynamically generated product brochure knowledgebase.
About This Workflow
This workflow creates a sophisticated WhatsApp chatbot that acts as a Sales Agent. It leverages an AI model to understand and respond to customer inquiries by referencing a product brochure. The process involves downloading a PDF brochure, extracting its text, creating a vector store for efficient knowledge retrieval, and then integrating this with a WhatsApp trigger to handle incoming messages. The AI agent can recall conversations and query the vector store for factual information, directing users to relevant resources.
This template is divided into two main parts:
- Product Catalog Vector Store Creation: Downloads a product brochure, extracts text, and builds an in-memory vector store. This part only needs to be run once or when the brochure is updated.
- WhatsApp AI Chatbot: Listens for incoming WhatsApp messages, filters out non-text messages, and uses an AI agent to respond to text-based inquiries by querying the vector store.
The workflow utilizes n8n's Langchain nodes for AI capabilities and built-in nodes for PDF processing and WhatsApp integration.
Key Features
- WhatsApp Integration: Real-time message handling via the WhatsApp Trigger and reply via the WhatsApp node.
- AI-Powered Sales Agent: Utilizes OpenAI's GPT-4o for intelligent conversation and response generation.
- Dynamic Knowledgebase: Creates an in-memory vector store from a product brochure PDF for context-aware responses.
- Document Processing: Extracts text content from PDF files using the 'Extract from File' node.
- Text Splitting: Prepares document text for embedding using the 'Recursive Character Text Splitter'.
- Vector Store Management: Uses 'VectorStoreInMemory' for creating and querying the knowledgebase.
- Conversation Memory: 'WindowBufferMemory' ensures the AI agent can recall past interactions within a session.
- Message Type Handling: Differentiates between text and non-text messages, responding accordingly.
- Tool Usage: Integrates a 'VectorStoreTool' to allow the AI agent to query the product brochure.
How To Use
Part 1: Setting Up the Product Knowledgebase (Run Once)
- Download Product Brochure: The
get Product Brochurenode fetches the 'Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf' from the provided URL. - Extract Text: The
Extract from Filenode reads the downloaded PDF and extracts its text content. - Embeddings: The
Embeddings OpenAI1node generates embeddings for the extracted text. - Create Vector Store: The
Create Product Cataloguenode uses the embeddings and text to build an in-memory vector store. This node is configured to clear the store and insert new data, effectively creating or updating the knowledgebase. - Data Loading and Splitting: The
Default Data LoaderandRecursive Character Text Splitternodes prepare the document data for the vector store.
Note: For production, consider using persistent vector stores like Qdrant or Pinecone instead of 'VectorStoreInMemory'.
Part 2: WhatsApp AI Chatbot (Activated Workflow)
- WhatsApp Trigger: The
WhatsApp Triggernode listens for incoming messages on your WhatsApp account. - Message Type Handling: The
Handle Message Typesswitch node checks if the incoming message is of type 'text'.- If 'text', it proceeds to the AI Sales Agent.
- If not 'text', it sends a predefined message via
Reply To User1informing the user that only text messages are supported.
- AI Sales Agent: The
AI Sales Agentnode takes the incoming text message and uses the configured OpenAI model (OpenAI Chat Model) and system message. It also receives memory fromWindow Buffer Memoryand can access tools, specifically theVector Store Tool(69f1b78b-7c93-4713-863a-27e04809996f) which is linked to theProduct Cataloguevector store. - Response Generation: The AI agent processes the query against the product brochure data.
- Reply to User: The
Reply To Usernode sends the AI agent's generated response back to the customer via WhatsApp.
Activation: Ensure your workflow is activated to start receiving and responding to WhatsApp messages. For self-hosted n8n instances, make sure your server is accessible from WhatsApp.
Language: The AI model gpt-4o-2024-08-06 is capable of understanding and responding in multiple languages, including Chinese. When a Chinese query is received, the AI model will process it and generate a response in Chinese, utilizing the English product brochure content as its knowledge base. The workflow itself does not explicitly translate the brochure content but relies on the AI's multi-lingual capabilities.
Apps Used
Workflow JSON
{
"id": "052642a3-6982-4cee-80e2-e1a668c2a22e",
"name": "WhatsApp Sales Agent with Product Brochure Knowledgebase",
"nodes": 23,
"category": "Marketing",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 052642a3-6982...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
WhatsApp AI Assistant: LLaMA 4 & Google Search for Real-Time Insights
Instantly deploy a smart AI assistant on WhatsApp, powered by Groq's lightning-fast LLaMA 4 model. This workflow enables real-time conversations, remembers context, and provides up-to-date answers by integrating live Google Search results.
AI-Powered On-Page SEO Audit & Report Automation
Instantly generate comprehensive on-page SEO technical and content audits for any website URL. This AI-powered workflow automates the entire process, from scraping the page to delivering a detailed report directly to your inbox, empowering you to optimize for better search rankings and user engagement.
Automate LinkedIn Content Promotion for Your Ghost Blog with AI
Effortlessly promote your latest Ghost blog posts on LinkedIn. This workflow leverages AI to generate engaging, professional LinkedIn messages based on your article content and saves them, along with article metadata, directly to a Google Sheet.