Customer Support Chatbot with RAG using OpenAI and Pinecone

Go to Workflow
0 views
Built by Ilyass Kanissi Ilyass Kanissi
Created on June 05, 2026

Description

🤖 Simple RAG Customer Support Chatbot

📋 Overview

This intelligent customer support chatbot leverages Retrieval-Augmented Generation (RAG) to provide accurate, contextual responses by combining your knowledge base with AI capabilities. The system automatically retrieves relevant documents from your Pinecone vector store and uses them to generate informed responses through OpenAI's language models.

âš¡ Quick Setup

Import Workflow
Import this workflow template into your n8n instance
Configure Credentials
Add the following API credentials:

OpenAI API Key: For chat completions and embeddings
Pinecone API Key: For vector database operations
Google Drive: For document auto ingestion

Initialize Vector Store
Use the "Insert documents into Pinecone" workflow to populate your knowledge base
Activate Workflow
Enable the main chat workflow to start receiving requests

🔧 How it Works

Main Chat Flow (Agent Workflow)

User Message → Memory Retrieval → Vector Search → Context Assembly → AI Response → Memory Update → Response

Process Flow:

Message Reception: Webhook receives user chat messages with session management
Memory Retrieval: Loads conversation history for context continuity
Semantic Search: Queries Pinecone vector store for relevant documents
Context Assembly: Combines retrieved documents with conversation history
AI Generation: OpenAI generates contextual response using assembled context
Memory Storage: Updates conversation memory for future interactions
Response Delivery: Returns formatted response to user interface

Document Ingestion Flow

Document Source → Text Extraction → Chunking → Embedding → Vector Storage

Process Flow:

Document Trigger: Google Drive or manual file upload detection
Content Extraction: Extracts text from various file formats (PDF, DOC, TXT)
Text Chunking: Splits documents into optimal chunks for embedding
Embedding Generation: Creates vector embeddings using OpenAI
Vector Storage: Stores embeddings in Pinecone with metadata
Index Update: Updates search index for immediate availability

Nodes Used (9)

AI Agent
@n8n/n8n-nodes-langchain.agent
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi
Google Drive
n8n-nodes-base.googleDrive
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone
Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter
Reranker Cohere
@n8n/n8n-nodes-langchain.rerankerCohere
Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow