{
  "name": "Scrape and ingest web pages into a Pinecone RAG stack with Firecrawl and OpenAI",
  "nodes": [
    {
      "id": "979bb858-9afc-4fbf-a2ed-c158f3b0a440",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1136,
        -384
      ],
      "parameters": {
        "width": 432,
        "height": 496,
        "content": "> ## How it works\n> 1. A webhook receives a URL via POST request\n> 2. The URL is validated and normalized, returning a 422 error if invalid\n> 3. Firecrawl scrapes the page and converts it to clean mar"
      }
    },
    {
      "id": "c1cbef33-52b3-44dd-aa62-58f3fdecfc30",
      "name": "Receive URL",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1056,
        144
      ]
    },
    {
      "id": "79cfc235-c533-4595-999f-09f3b7fb48a2",
      "name": "Validate and normalize URL",
      "type": "n8n-nodes-base.code",
      "position": [
        -832,
        144
      ]
    },
    {
      "id": "fe4f2f6c-d6e6-4d68-9133-8cd90fed5a39",
      "name": "Scrape page with Firecrawl",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawl",
      "position": [
        -464,
        -32
      ]
    },
    {
      "id": "4f1cbecc-a01a-4c22-abcd-8263cc633c97",
      "name": "Return URL validation error",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -608,
        240
      ]
    },
    {
      "id": "1e0853a9-651e-4fa0-a60d-65d22cf8df9d",
      "name": "Store embeddings in Pinecone",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -256,
        -32
      ]
    },
    {
      "id": "d9e2f16a-ef0d-4879-adce-2ef72b758f7d",
      "name": "Return ingestion result",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        112,
        -32
      ]
    },
    {
      "id": "0bc6e04f-062a-4fde-9787-5d98ee68a67c",
      "name": "Generate OpenAI embeddings",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -288,
        160
      ]
    },
    {
      "id": "f5ba03be-4e36-4868-a119-5f15a8180ede",
      "name": "Load scraped content",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -112,
        160
      ]
    },
    {
      "id": "4beb288d-8c95-4fe2-8462-40d138c1771e",
      "name": "Receive chat message",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1056,
        512
      ]
    },
    {
      "id": "af6c4d23-10ff-4911-98fb-6f1c3d4defe3",
      "name": "Answer query from knowledge base",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -832,
        512
      ]
    },
    {
      "id": "b29b726a-c5f6-4b4b-b9b3-800915ab0a86",
      "name": "OpenRouter LLM",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -928,
        704
      ]
    },
    {
      "id": "aeb8b2cf-d054-45f6-8416-c7ce3cd13564",
      "name": "Chat memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -768,
        704
      ]
    },
    {
      "id": "23ca0f36-bf16-44d6-b7a3-b1d0ec5b984c",
      "name": "Retrieve documents from Pinecone",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -576,
        688
      ]
    },
    {
      "id": "f8a8894d-0c58-4702-b57b-633e9803974c",
      "name": "Generate OpenAI embeddings1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -608,
        864
      ]
    },
    {
      "id": "5c098782-83ad-4fd4-bbbb-d1d85b3df6e7",
      "name": "Rerank results with Cohere",
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "position": [
        -448,
        880
      ]
    },
    {
      "id": "8acd099c-3f48-454b-bcf3-e75a239178a9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        -384
      ],
      "parameters": {
        "width": 272,
        "height": 336,
        "content": "> ## Pinecone setup\n> Your Pinecone index must use 1536 dimensions to match the `text-embedding-3-small` OpenAI model.\n>\n> 1. Go to your Pinecone console and open your index settings\n> 2. Select text-"
      }
    }
  ],
  "connections": {
    "Chat memory": {
      "ai_memory": [
        [
          {
            "node": "Answer query from knowledge base",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Receive URL": {
      "main": [
        [
          {
            "node": "Validate and normalize URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter LLM": {
      "ai_languageModel": [
        [
          {
            "node": "Answer query from knowledge base",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Load scraped content": {
      "ai_document": [
        [
          {
            "node": "Store embeddings in Pinecone",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Receive chat message": {
      "main": [
        [
          {
            "node": "Answer query from knowledge base",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate OpenAI embeddings": {
      "ai_embedding": [
        [
          {
            "node": "Store embeddings in Pinecone",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Rerank results with Cohere": {
      "ai_reranker": [
        [
          {
            "node": "Retrieve documents from Pinecone",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "Scrape page with Firecrawl": {
      "main": [
        [
          {
            "node": "Store embeddings in Pinecone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate and normalize URL": {
      "main": [
        [
          {
            "node": "Scrape page with Firecrawl",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Return URL validation error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate OpenAI embeddings1": {
      "ai_embedding": [
        [
          {
            "node": "Retrieve documents from Pinecone",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Store embeddings in Pinecone": {
      "main": [
        [
          {
            "node": "Return ingestion result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve documents from Pinecone": {
      "ai_tool": [
        [
          {
            "node": "Answer query from knowledge base",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}