AutomationFlowsAI & RAG › AI RAG Chat with URL Content

AI RAG Chat with URL Content

Original n8n title: Rag+url

RAG+URL. Uses embeddingsOpenAi, documentDefaultDataLoader, textSplitterRecursiveCharacterTextSplitter, lmOpenAi. Chat trigger; 19 nodes.

Chat trigger trigger★★★★☆ complexityAI-powered19 nodesOpenAI EmbeddingsDocument Default Data LoaderText Splitter Recursive Character Text SplitterLm Open AiHTTP RequestChat TriggerChain Retrieval QaRetriever Vector Store
AI & RAG Trigger: Chat trigger Nodes: 19 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Chainretrievalqa → Retrievervectorstore recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "active": false,
  "connections": {
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Extract main content",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get pages listed in the sitemap",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Turn the URL array into multiple items": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 5 seconds": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get pages listed in the sitemap": {
      "main": [
        [
          {
            "node": "Wait 5 seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat Trigger": {
      "main": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model": {
      "ai_languageModel": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Vector Store Retriever": {
      "ai_retriever": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "ai_retriever",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI2": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store2",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store2": {
      "ai_vectorStore": [
        [
          {
            "node": "Vector Store Retriever",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Start the workflow by clicking \"Test workflow\"": {
      "main": [
        [
          {
            "node": "Get sitemap",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract main content": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown": {
      "main": [
        [
          {
            "node": "Turn the URL array into multiple items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get sitemap": {
      "main": [
        [
          {
            "node": "Markdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "createdAt": "2024-12-18T19:34:04.720Z",
  "id": "h2caRepzzfzRp2GA",
  "meta": null,
  "name": "RAG+URL",
  "nodes": [
    {
      "parameters": {
        "model": "text-embedding-3-large",
        "options": {}
      },
      "id": "810c4681-3ca0-4328-a646-6047fe8f167a",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1,
      "position": [
        2380,
        560
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "94d14ae2-b041-4194-a0d0-bc759c5ee501",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1,
      "position": [
        2560,
        480
      ]
    },
    {
      "parameters": {
        "chunkOverlap": 40,
        "options": {
          "splitCode": "markdown"
        }
      },
      "id": "02a970dc-06d5-4d88-8dc9-48772fcd5224",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        2600,
        680
      ]
    },
    {
      "parameters": {
        "batchSize": 10,
        "options": {
          "reset": false
        }
      },
      "id": "db34e8f1-e29e-439e-9df4-44832694e1e6",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        1460,
        560
      ]
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "id": "c625beba-de2f-4efc-b9fc-0634ab4cb1e6",
      "name": "OpenAI Model",
      "type": "@n8n/n8n-nodes-langchain.lmOpenAi",
      "typeVersion": 1,
      "position": [
        380,
        820
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "data",
        "include": "allOtherFields",
        "options": {
          "destinationFieldName": "split"
        }
      },
      "id": "cbed6346-9fad-4704-b479-e8e5643a8878",
      "name": "Turn the URL array into multiple items",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1060,
        260
      ],
      "alwaysOutputData": true,
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {},
      "id": "9d43fd2c-3373-459d-9be9-f3b20ef3844e",
      "name": "Wait 5 seconds",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1980,
        580
      ]
    },
    {
      "parameters": {
        "url": "={{ $('Markdown').item.json.markdown }}",
        "options": {}
      },
      "id": "73d00dc1-0798-4597-8e24-fcfcf34bfb06",
      "name": "Get pages listed in the sitemap",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1720,
        580
      ]
    },
    {
      "parameters": {},
      "id": "6637c527-a4b0-4727-97a1-9fd2012d4596",
      "name": "Chat Trigger",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1,
      "position": [
        80,
        600
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $('Chat Trigger').item.json.chatInput }}",
        "options": {}
      },
      "id": "7f13e377-75c7-4ab8-af6b-1fe1af716d36",
      "name": "Question and Answer Chain",
      "type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
      "typeVersion": 1.3,
      "position": [
        420,
        600
      ]
    },
    {
      "parameters": {
        "topK": 10
      },
      "id": "6e5d8de3-c18e-4296-990e-b591952941af",
      "name": "Vector Store Retriever",
      "type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
      "typeVersion": 1,
      "position": [
        620,
        800
      ]
    },
    {
      "parameters": {
        "model": "text-embedding-3-large",
        "options": {}
      },
      "id": "5d19c787-3340-4af4-ac6f-881997bded7c",
      "name": "Embeddings OpenAI2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1,
      "position": [
        920,
        1220
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "content"
            }
          ]
        },
        "options": {}
      },
      "id": "fcd393fd-8398-4274-9571-5de641271a09",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        2200,
        260
      ]
    },
    {
      "parameters": {
        "mode": "insert",
        "pineconeIndex": {
          "__rl": true,
          "value": "uspto",
          "mode": "list",
          "cachedResultName": "uspto"
        },
        "options": {
          "clearNamespace": true,
          "pineconeNamespace": "biolaw-web-scraper"
        }
      },
      "id": "965eb017-bc26-4a30-b97c-f60fd8831dcf",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "typeVersion": 1,
      "position": [
        2460,
        260
      ],
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "pineconeIndex": {
          "__rl": true,
          "value": "uspto",
          "mode": "list",
          "cachedResultName": "uspto"
        },
        "options": {
          "pineconeNamespace": "test-web-scraper"
        }
      },
      "id": "a83ff201-128b-4eef-9193-1e661fb700a2",
      "name": "Pinecone Vector Store2",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "typeVersion": 1,
      "position": [
        720,
        1020
      ],
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "id": "2f534bff-8ab9-4081-ac30-f5f13b0ba78e",
      "name": "Start the workflow by clicking \"Test workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        100,
        260
      ]
    },
    {
      "parameters": {
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "content",
              "cssSelector": ".md-content",
              "returnValue": "html"
            }
          ]
        },
        "options": {
          "trimValues": true,
          "cleanUpText": true
        }
      },
      "id": "06f89741-d2a8-4453-8e07-e485b9b04c67",
      "name": "Extract main content",
      "type": "n8n-nodes-base.html",
      "typeVersion": 1.2,
      "position": [
        1920,
        260
      ]
    },
    {
      "parameters": {
        "html": "={{ $json.data }}",
        "destinationKey": "markdown",
        "options": {
          "ignore": "",
          "useLinkReferenceDefinitions": false
        }
      },
      "type": "n8n-nodes-base.markdown",
      "typeVersion": 1,
      "position": [
        760,
        260
      ],
      "id": "96687f86-28ad-4f82-822e-f8786141ecab",
      "name": "Markdown"
    },
    {
      "parameters": {
        "url": "https://www.aa.org",
        "options": {}
      },
      "id": "822da359-842c-4dee-b587-f91e6358dde0",
      "name": "Get sitemap",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        260
      ]
    }
  ],
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "updatedAt": "2025-04-20T08:12:45.000Z",
  "versionId": "6bd0bb36-134e-4792-acc5-ff06ab556b67"
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

How this works

This workflow enables you to chat with content from any website by transforming its pages into searchable knowledge, delivering precise, context-aware responses without manual data entry. It's ideal for content creators, researchers, or customer support teams needing quick insights from online sources like documentation or news sites. The key step involves loading and splitting the site's pages—starting from its sitemap via HTTP Request—into chunks, then using OpenAI embeddings and language models to match your query with relevant sections for an informed reply.

Use this when you want real-time Q&A on dynamic web content, such as querying a blog's latest articles or a product's help centre, saving hours of browsing. Avoid it for static files or non-text-heavy sites, where simpler loaders suffice, or if privacy concerns limit URL access. Common variations include swapping OpenAI for other embedding providers or adding filters to focus on specific site sections like FAQs.

About this workflow

RAG+URL. Uses embeddingsOpenAi, documentDefaultDataLoader, textSplitterRecursiveCharacterTextSplitter, lmOpenAi. Chat trigger; 19 nodes.

Source: https://github.com/faustormz/n8n-backups/blob/288d38fb5ba4e1903490c5c43dbc90aa35d5aea6/workflows/RAG%2BURL.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Advanced Ai Demo Presented At Ai Developers 14 Meetup. Uses slack, stickyNote, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi. Chat trigger; 39 nodes.

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14
AI & RAG

Advanced Ai Demo (Presented At Ai Developers #14 Meetup). Uses slack, stickyNote, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi. Chat trigger; 39 nodes.

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14
AI & RAG

Workflow 2358. Uses slack, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi, documentDefaultDataLoader. Chat trigger; 39 nodes.

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14
AI & RAG

2358. Uses slack, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi, documentDefaultDataLoader. Chat trigger; 39 nodes.

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14
AI & RAG

This workflow was presented at the AI Developers meet up in San Fransico on 24 July, 2024. Categorize incoming Gmail emails and assign custom Gmail labels. This example uses the Text Classifier node,

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14