{
  "name": "RAG \u2014 Ingestion",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "3afa1770-c292-4e67-8ccf-0d6522af6fef",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "url": "=https://r.jina.ai/{{ $json.target_url }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        416,
        0
      ],
      "id": "835d0a9b-a42d-4a7f-b30f-68349f7b7c72",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "mode": "insert",
        "pineconeIndex": {
          "__rl": true,
          "value": "saas-docs",
          "mode": "list",
          "cachedResultName": "saas-docs"
        },
        "options": {
          "pineconeNamespace": "={{ $('Define Source').item.json.namespace }}"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "typeVersion": 1.3,
      "position": [
        720,
        0
      ],
      "id": "d234c2ab-9197-4c85-90b6-05e974bba49b",
      "name": "Pinecone Vector Store",
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        576,
        240
      ],
      "id": "b7dc4906-3daa-4d66-bdf4-8802559532a3",
      "name": "Embeddings OpenAI",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsonMode": "expressionData",
        "jsonData": "={{ $json.data }}",
        "textSplittingMode": "custom",
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "=source_title",
                "value": "={{ $('Define Source').item.json.source_title }}"
              },
              {
                "name": "=source_url",
                "value": "={{ $('Define Source').item.json.target_url }}"
              },
              {
                "name": "doc_type",
                "value": "={{ $('Define Source').item.json.doc_type }}"
              },
              {
                "name": "ingested_at",
                "value": "={{ $now.toISO() }}"
              }
            ]
          }
        }
      },
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1.1,
      "position": [
        896,
        240
      ],
      "id": "1f97f18f-d1e0-49f0-8734-afe12af52bfb",
      "name": "Default Data Loader"
    },
    {
      "parameters": {
        "chunkSize": 800,
        "chunkOverlap": 100,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        992,
        448
      ],
      "id": "a1e054fd-22c3-4b83-ae42-2d24a2ad1c26",
      "name": "Recursive Character Text Splitter"
    },
    {
      "parameters": {
        "jsCode": "const sources = [\n  {\n    target_url: \"https://docs.stripe.com/webhooks\",\n    source_title: \"Stripe \u2014 Webhooks Overview\",\n    doc_type: \"overview\"\n  },\n  {\n    target_url: \"https://docs.stripe.com/webhooks/quickstart\",\n    source_title: \"Stripe \u2014 Webhook Builder (Quickstart)\",\n    doc_type: \"tutorial\"\n  },\n  {\n    target_url: \"https://docs.stripe.com/webhooks/handling-payment-events\",\n    source_title: \"Stripe \u2014 Handling Payment Events\",\n    doc_type: \"tutorial\"\n  },\n  {\n    target_url: \"https://docs.stripe.com/webhooks/versioning\",\n    source_title: \"Stripe \u2014 Webhook Versioning\",\n    doc_type: \"tutorial\"\n  },\n  {\n    target_url: \"https://docs.stripe.com/webhooks/signature\",\n    source_title: \"Stripe \u2014 Resolve Signature Verification Errors\",\n    doc_type: \"troubleshooting\"\n  },\n  {\n    target_url: \"https://docs.stripe.com/webhooks/process-undelivered-events\",\n    source_title: \"Stripe \u2014 Process Undelivered Events\",\n    doc_type: \"tutorial\"\n  },\n  {\n    target_url: \"https://docs.stripe.com/event-destinations\",\n    source_title: \"Stripe \u2014 Event Destinations Overview\",\n    doc_type: \"overview\"\n  },\n];\n\nreturn sources.map(s => ({\n  json: { ...s, namespace: \"stripe-webhooks-v1\" }\n}));"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        208,
        0
      ],
      "id": "608d5957-286e-48f8-b943-55f00da34f5f",
      "name": "Define Source"
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Define Source",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "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
          }
        ]
      ]
    },
    "Define Source": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "versionId": "92f972af-dca1-4a60-a308-d33a74fae533",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "SDoEwUY4UyPln7G9",
  "tags": []
}