Development Advanced

Build a Website RAG Chatbot with Gemini

Two n8n sub-workflows keep a Gemini chatbot grounded in your website: one scrapes and embeds pages into Pinecone, the other answers visitor questions from that vector store.

At a glance

Build a Website RAG Chatbot with Gemini is an advanced-level development automation built with n8n. Train a Gemini chatbot on your website using Apify and Pinecone RAG.

Tools required
n8n
Tags
#rag #chatbot #pinecone #gemini #apify
Difficulty
Advanced
Published
· 2 min read

How It Works

Large language models only know what they were trained on, so a chatbot that answers questions about your business needs an outside source of truth. This n8n template wires that source of truth to Gemini using a retrieval-augmented generation pattern: a scheduled job scrapes your website with the Apify Website Content Crawler, pushes the text into a Pinecone vector index, and a separate chat agent retrieves the most relevant chunks before each response. The workflow is split into two sub-logics, flagged in the canvas with green sticky notes, so the ingestion pipeline and the live agent can be edited independently.

Setup Steps

  1. Create a Google Cloud project: Enable the Vertex AI API and generate a Google AI API key from Google AI Studio.
  2. Create an Apify account: Sign up at apify.com; the Apify node uses the Website Content Crawler actor to pull every page from your site.
  3. Create a Pinecone index: On the Pinecone free tier, create an index named company-website and copy the API key from the dashboard.
  4. Add credentials in n8n: Configure the Google Gemini (PaLM) API and Pinecone API credentials so both the embedding and vector store nodes can authenticate.
  5. Set the schedule frequency: Edit the Schedule Trigger to match how often your site content changes; swap it for a click trigger if the chatbot only needs to be trained once.
  6. Configure the Apify node: Authenticate the Apify node (OAuth or API token) and set the target website URL inside the JSON input before the first run.

Automation Workflow

Schedule Trigger → Apify Website Content Crawler → Embeddings Gemini → Pinecone Vector Store (insert)
                                                                            ↓
Chat Trigger → AI Agent → Vector Store Tool → Pinecone Vector Store (query)
                   ↓
          Google Gemini Chat Model (gemini-pro) → Chat response

Benefits

Advanced Features

Use Cases

Related Automations