{
  "name": "Multi-Source RAG Ingestion Pipeline",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "rag-ingest",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "msr00001-0001-4000-8000-000000000001",
      "name": "Ingest Request Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [240, 300]
    },
    {
      "parameters": {
        "url": "={{ $json.body.sourceUrl }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "text"
            }
          }
        }
      },
      "id": "msr00001-0002-4000-8000-000000000002",
      "name": "Fetch Source Content",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [460, 300]
    },
    {
      "parameters": {
        "chunkSize": 800,
        "chunkOverlap": 100,
        "options": {}
      },
      "id": "msr00001-0003-4000-8000-000000000003",
      "name": "Split into Chunks",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "typeVersion": 1,
      "position": [680, 300]
    },
    {
      "parameters": {
        "model": "text-embedding-ada-002",
        "options": {}
      },
      "id": "msr00001-0004-4000-8000-000000000004",
      "name": "Embed Chunks",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1,
      "position": [900, 300]
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "msr00001-0005-4000-8000-000000000005",
      "name": "Store in Vector DB",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "typeVersion": 1,
      "position": [1120, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "r1",
              "name": "status",
              "value": "ingested",
              "type": "string"
            },
            {
              "id": "r2",
              "name": "sourceUrl",
              "value": "={{ $('Ingest Request Webhook').item.json.body.sourceUrl }}",
              "type": "string"
            },
            {
              "id": "r3",
              "name": "ingestedAt",
              "value": "={{ new Date().toISOString() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "msr00001-0006-4000-8000-000000000006",
      "name": "Confirm Ingestion",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [1340, 300]
    }
  ],
  "connections": {
    "Ingest Request Webhook": {
      "main": [[{ "node": "Fetch Source Content", "type": "main", "index": 0 }]]
    },
    "Fetch Source Content": {
      "main": [[{ "node": "Split into Chunks", "type": "main", "index": 0 }]]
    },
    "Split into Chunks": {
      "main": [[{ "node": "Embed Chunks", "type": "main", "index": 0 }]]
    },
    "Embed Chunks": {
      "main": [[{ "node": "Store in Vector DB", "type": "main", "index": 0 }]]
    },
    "Store in Vector DB": {
      "main": [[{ "node": "Confirm Ingestion", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "meta": {},
  "pinData": {}
}
