Animated data flow diagram

AI Personal Shopper Agent with RAG & WooCommerce

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

Integrates with:

OpenAI WooCommerce Qdrant Google Drive

Overview

Unlock Advanced E-commerce Assistance with this AI Personal Shopper Agent

This AI Agent transforms your customer interactions by providing intelligent personal shopping and information retrieval capabilities directly within a chat interface. It's designed for e-commerce businesses using WooCommerce and looking to leverage the power of Large Language Models (LLMs) for enhanced customer experience and sales.

How it Works: This agent operates in two key stages:

  1. Knowledge Base Preparation (RAG Setup): Information about your store (FAQs, policies, etc.) is loaded from Google Drive documents, processed, and stored in a Qdrant vector database using OpenAI embeddings. This creates a searchable knowledge base for the RAG (Retrieval Augmented Generation) system. You run this part initially and whenever your store information documents change.
  2. Conversational AI Agent: When a customer interacts via chat:
    • The agent first uses an OpenAI-powered Information Extractor to understand the user's intent. If the user is looking for a product, it extracts details like keywords, price range, SKU, and category.
    • Based on the intent:
      • For product searches, it utilizes the 'personal_shopper' tool, which queries your WooCommerce store for relevant products.
      • For general store inquiries (e.g., opening hours, address), it uses the 'RAG' tool to fetch answers from the Qdrant knowledge base, providing context-aware responses generated by an OpenAI model.
    • The agent maintains conversation history using Window Buffer Memory for more natural interactions.

Key Features & Benefits

  • AI-Powered Product Discovery: Intelligently understands customer requests for products (including keywords, price, SKU) and searches your WooCommerce catalog.
  • RAG for Instant FAQ Answers: Provides accurate answers to store-specific questions by retrieving information from your custom knowledge base (e.g., store hours, return policies).
  • Seamless WooCommerce Integration: Directly connects to your WooCommerce store for real-time product lookups and availability.
  • Contextual Conversations: Remembers previous parts of the conversation for a smoother, more human-like user experience.
  • Automated Information Extraction: Leverages OpenAI to parse customer messages for key purchasing signals and parameters.
  • Scalable Customer Assistance: Handles multiple customer queries simultaneously, 24/7, improving response times and customer satisfaction.

Use Cases

  • Provide 24/7 AI-powered personal shopping assistance on your WooCommerce store, guiding customers to products and answering FAQs.
  • Automate responses to common store inquiries (opening hours, shipping policies, location) via chat, freeing up human support agents.
  • Increase conversion rates by helping customers find the right products quickly and efficiently.
  • Enhance customer engagement with a conversational AI that understands natural language product searches.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • OpenAI API Key with access to suitable models (e.g., gpt-3.5-turbo, text-embedding models).
  • WooCommerce store with REST API enabled and API credentials (Consumer Key, Consumer Secret).
  • A Qdrant vector database instance (self-hosted or cloud) and API Key (if required).
  • Google Drive account and credentials for storing and accessing RAG documents.

Setup Instructions

Part 1: RAG Knowledge Base Setup (Initial Data Ingestion) This part populates your Qdrant vector database with information about your store. Run this part when you need to update the knowledge base.

  1. Download the n8n workflow JSON file and import it into your n8n instance.
  2. The RAG data ingestion flow is triggered by the 'When clicking ‘Test workflow’' node.
  3. In the 'HTTP Request' node (connected to 'When clicking ‘Test workflow’', potentially for clearing Qdrant points):
    • Replace QDRANTURL/collections/NAME/points/delete with your specific Qdrant endpoint for deleting points if you wish to clear the collection before ingestion.
    • Configure the 'httpHeaderAuth' credential with your Qdrant API key if your Qdrant instance requires authentication for this operation. This step is optional; disable or modify if you don't need to clear the collection.
  4. Configure the 'Google Drive2' node:
    • Authenticate with your Google Drive account.
    • Set the 'Folder ID' to the ID of the Google Drive folder containing your store information documents (e.g., .txt files with FAQs, policies).
  5. Ensure the 'Google Drive1' node is correctly configured to download files fetched by 'Google Drive2'.
  6. In the 'Embeddings OpenAI3' node, configure your OpenAI API Key credential.
  7. Configure the 'Qdrant Vector Store1' node:
    • Set 'Operation Mode' to 'Insert Documents'.
    • Select or create your Qdrant API credential (URL and API key if needed).
    • Specify your Qdrant 'Collection Name'. This name must be consistent across the workflow.
  8. Run this part of the workflow by clicking 'Test workflow' on the 'When clicking ‘Test workflow’' node. This will load documents from Google Drive, embed them using OpenAI, and store them in Qdrant.

Part 2: AI Personal Shopper Agent Configuration This part configures the chat-triggered AI agent. 9. Configure the 'When chat message received' trigger node. This node will receive sessionId and chatInput. 10. In the 'OpenAI Chat Model2' node (connected to 'Information Extractor'), select your OpenAI API Key credential. 11. In the 'personal_shopper' (n8n-nodes-base.wooCommerceTool) node: * Select or create your WooCommerce API credentials. * Review the 'Options' parameters to ensure they correctly map values from the 'Information Extractor' node's output (e.g., SKU, search keyword, prices). 12. In the 'OpenAI Chat Model' node (connected to the main 'AI Agent'), select your OpenAI API Key credential. 13. Configure the 'RAG' tool (type: @n8n/n8n-nodes-langchain.toolVectorStore) which is connected to the 'AI Agent': * 'Qdrant Vector Store' node (linked as ai_vectorStore to RAG tool): * Select your Qdrant API credential. * Ensure the 'Collection Name' matches the one used in Part 1. * 'Embeddings OpenAI' node (linked as ai_embedding to Qdrant Vector Store): Select your OpenAI API Key credential. * 'OpenAI Chat Model1' node (linked as ai_languageModel to RAG tool): Select your OpenAI API Key credential. 14. Review and customize the system prompts within the 'Information Extractor' and 'AI Agent' nodes. The prompts are in Italian in the provided template; translate or adapt them to your needs. The 'AI Agent' prompt is crucial as it instructs the LLM on how to use the 'personal_shopper' and 'RAG' tools based on user input. 15. Ensure the 'Edit Fields' node correctly captures sessionId and chatInput from the trigger for use in 'Window Buffer Memory' and the 'Information Extractor'. 16. Activate the workflow. Test by sending various chat messages, including product searches (e.g., "looking for red shoes under $50") and general store questions (e.g., "what are your opening hours?").

Tags:

AI AgentAutomationOpenAIWooCommerceRAGE-commerceChatbotLangchainCustomer Assistant

Want your own unique AI agent?

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

Schedule a Consultation