{
  "id": "fAeO17YtvOnAcqp5",
  "name": "RAG Workflow For Company Website Using Apify and Gemini",
  "tags": [],
  "nodes": [
    {
      "id": "09ac58e3-6087-4e79-a2bb-a0ae2ca5d5a2",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        240,
        240
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "company-website",
          "cachedResultName": "company-website"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bb8a134c-d2ac-4ebd-bd62-4bc5de691e9f",
      "name": "Embeddings Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        208,
        528
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "fdc7c33c-2d4e-4b71-8051-ae1b2c0f27a2",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        400,
        464
      ],
      "parameters": {
        "options": {},
        "dataType": "binary",
        "binaryMode": "specificField"
      },
      "typeVersion": 1
    },
    {
      "id": "481a5d38-f18e-4aff-add0-b06183892ed6",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        560,
        688
      ],
      "parameters": {
        "options": {},
        "chunkOverlap": 100
      },
      "typeVersion": 1
    },
    {
      "id": "cd132fcf-10fd-439e-be41-2421934188e9",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -16,
        1088
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are a chatbot designed to answer questions based on company website.\n\nRetrieve relevant information from the provided website pages and provide a concise, accurate, and informative answer to the question.\n\nUse the tool called \"company_documents_tool\" to retrieve any information from the company's website.\n\nIf the answer cannot be found in the provided documents, respond with \"I cannot find the answer in the available resources.\""
        }
      },
      "typeVersion": 1.7
    },
    {
      "id": "a4b400dd-0547-4ae5-9067-2cc618e30fc2",
      "name": "Vector Store Tool",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        496,
        1200
      ],
      "parameters": {
        "name": "company_documents_tool",
        "description": "Retrieve information from any company webpage"
      },
      "typeVersion": 1
    },
    {
      "id": "1bbf4fdf-c8c0-4f4b-9c48-675b2de00fd4",
      "name": "Pinecone Vector Store (Retrieval)",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        320,
        1440
      ],
      "parameters": {
        "options": {},
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "company-website",
          "cachedResultName": "company-website"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "862bac5f-4af9-4b79-898f-3c65f377695c",
      "name": "Embeddings Google Gemini (retrieval)",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        272,
        1648
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2a54bc3d-d09e-43a7-9fe8-8c9856ed7acc",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        992
      ],
      "parameters": {
        "color": 4,
        "width": 1392,
        "height": 912,
        "content": "## Chat bot logic"
      },
      "typeVersion": 1
    },
    {
      "id": "144c7d7e-8b52-4b19-bb75-9548568700a3",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        112,
        1376
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "e1caf870-a499-4082-a005-59b38516f5b8",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -368,
        1088
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "8446347a-3466-42dc-a09c-73ee7176eb15",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -128,
        1392
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash-exp"
      },
      "typeVersion": 1
    },
    {
      "id": "a169290d-cd1b-4913-8347-908de915e360",
      "name": "Google Gemini Chat Model (retrieval)",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        768,
        1424
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash-exp"
      },
      "typeVersion": 1
    },
    {
      "id": "34ac062b-1c3f-41f2-8d05-6c4f080e11e5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        464
      ],
      "parameters": {
        "width": 420,
        "height": 720,
        "content": "## Set up guide\n\nAll Nodes with an orange sticky note require setup.\n\n**Get your tools set up:**\n1 Google Cloud Project and Vertex AI API:\n* Create a Google Cloud project.\n* Enable the Vertex AI API for your project.\n* Obtain a Google AI API key from Google AI Studio\n\n2 Get an Apify account\n* Create an [Apify account](https://apify.com/)\n\n3 Pinecone Account:\n* Create a free account on the Pinecone website.\n* Obtain your API key from your Pinecone dashboard.\n* Create an index named company-website in your Pinecone project.\n\n\n**Configure credentials in your n8n environment for:**\n* Google Gemini(PaLM) Api (using your Google AI API key)\n* Pinecone API (using your Pinecone API key)\n\n**Setup trigger frequency**\n* Edit the Schedule  Trigger to match the frequency at which you wish to update your RAG\n* If you want to train your chatbot only once, you can replace it with a click trigger.\n\n**Set up the Apify node**\n* Authenticate (via Oath or APi)\n* Set up your website URL in the JSON input\n\n** You should be all set**\n"
      },
      "typeVersion": 1
    },
    {
      "id": "a44e688b-7d6e-4e92-af8e-541714a52c86",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -384,
        240
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks"
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "eaf6d91a-54e5-4c58-bdca-a996051c1ac1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        112
      ],
      "parameters": {
        "color": 2,
        "width": 224,
        "height": 288,
        "content": "\nChoose the update frequency"
      },
      "typeVersion": 1
    },
    {
      "id": "d21591be-d555-430e-aad1-20160d055ea9",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        112
      ],
      "parameters": {
        "color": 2,
        "width": 224,
        "height": 288,
        "content": "Connect your Apify Actor\nSetup target website in JSON input, instead of tetriz.io"
      },
      "typeVersion": 1
    },
    {
      "id": "066a4d09-5329-4f5a-8b37-f950b8d51d77",
      "name": "Scrape website data",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        -128,
        240
      ],
      "parameters": {
        "memory": 4096,
        "actorId": {
          "__rl": true,
          "mode": "list",
          "value": "aYG0l9s7dbB7j3gbS",
          "cachedResultUrl": "https://console.apify.com/actors/aYG0l9s7dbB7j3gbS/input",
          "cachedResultName": "Website Content Crawler (apify/website-content-crawler)"
        },
        "operation": "Run actor and get dataset",
        "customBody": "{\n    \"aggressivePrune\": false,\n    \"blockMedia\": true,\n    \"clickElementsCssSelector\": \"[aria-expanded=\\\"false\\\"]\",\n    \"clientSideMinChangePercentage\": 15,\n    \"crawlerType\": \"playwright:adaptive\",\n    \"debugLog\": false,\n    \"debugMode\": true,\n    \"expandIframes\": true,\n    \"ignoreCanonicalUrl\": true,\n    \"ignoreHttpsErrors\": false,\n    \"keepUrlFragments\": false,\n    \"maxCrawlDepth\": 0,\n    \"proxyConfiguration\": {\n        \"useApifyProxy\": true,\n        \"apifyProxyGroups\": []\n    },\n    \"readableTextCharThreshold\": 100,\n    \"removeCookieWarnings\": true,\n    \"removeElementsCssSelector\": \"nav, footer, script, style, noscript, svg, img[src^='data:'],\\n[role=\\\"alert\\\"],\\n[role=\\\"banner\\\"],\\n[role=\\\"dialog\\\"],\\n[role=\\\"alertdialog\\\"],\\n[role=\\\"region\\\"][aria-label*=\\\"skip\\\" i],\\n[aria-modal=\\\"true\\\"]\",\n    \"renderingTypeDetectionPercentage\": 10,\n    \"respectRobotsTxtFile\": false,\n    \"reuseStoredDetectionResults\": false,\n    \"saveFiles\": false,\n    \"saveHtml\": false,\n    \"saveHtmlAsFile\": false,\n    \"saveMarkdown\": true,\n    \"saveScreenshots\": false,\n    \"signHttpRequests\": false,\n    \"startUrls\": [\n        {\n            \"url\": \"https://www.tetriz.io/\"\n        }\n    ],\n    \"storeSkippedUrls\": false,\n    \"useLlmsTxt\": false,\n    \"useSitemaps\": true\n}",
        "actorSource": "store",
        "authentication": "apifyOAuth2Api"
      },
      "credentials": {},
      "typeVersion": 1
    },
    {
      "id": "80d93e16-6b55-4934-afc4-9ccd0321a97a",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        176
      ],
      "parameters": {
        "color": 2,
        "width": 368,
        "height": 208,
        "content": "**Environment setting:**\nConnect Pinecone (using Pinecone API key)"
      },
      "typeVersion": 1
    },
    {
      "id": "a59f473c-7da8-46e7-bef8-5b5a1a0e5b2a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        464
      ],
      "parameters": {
        "color": 2,
        "width": 208,
        "height": 304,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n**Environment setting:**\nConnect Google Gemini (using your Google AI API key)"
      },
      "typeVersion": 1
    },
    {
      "id": "030a5bb7-953b-4d00-84fd-88b68ca326e3",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        1344
      ],
      "parameters": {
        "color": 2,
        "width": 208,
        "height": 320,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n**Environment setting:**\nConnect Google Gemini (using your Google AI API key)"
      },
      "typeVersion": 1
    },
    {
      "id": "3ff672ce-6e3a-420e-8a47-73b25bc10de9",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        1328
      ],
      "parameters": {
        "color": 2,
        "width": 208,
        "height": 336,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n**Environment setting:**\nConnect Google Gemini (using your Google AI API key)"
      },
      "typeVersion": 1
    },
    {
      "id": "3ff43827-49e3-4da3-ba60-1a2835f26e0c",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        1584
      ],
      "parameters": {
        "color": 2,
        "width": 208,
        "height": 304,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n**Environment setting:**\nConnect Google Gemini (using your Google AI API key)"
      },
      "typeVersion": 1
    },
    {
      "id": "f28432e3-74e9-46e6-bcc7-140e91e30c89",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        1344
      ],
      "parameters": {
        "color": 2,
        "width": 368,
        "height": 208,
        "content": "**Environment setting:**\nConnect Pinecone (using Pinecone API key)"
      },
      "typeVersion": 1
    },
    {
      "id": "ffdb313d-fc36-4ad0-8faa-ae70aa50e0f0",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        32
      ],
      "parameters": {
        "color": 4,
        "width": 1392,
        "height": 912,
        "content": "## Training logic"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "56948486-89c5-4503-b3ef-a166e018ca8c",
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Scrape website data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Vector Store Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Scrape website data": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store (Retrieval)": {
      "ai_vectorStore": [
        [
          {
            "node": "Vector Store Tool",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini (retrieval)": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store (Retrieval)",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model (retrieval)": {
      "ai_languageModel": [
        [
          {
            "node": "Vector Store Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}