{
  "name": "RAG Document Ingestion & Q&A",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "ingest-document",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "rag00001-0001-4000-8000-000000000001",
      "name": "Ingest Document Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [240, 300]
    },
    {
      "parameters": {
        "url": "={{ $json.body.documentUrl }}",
        "responseFormat": "text",
        "options": {
          "timeout": 30000
        }
      },
      "id": "rag00001-0002-4000-8000-000000000002",
      "name": "Fetch Document",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [460, 300]
    },
    {
      "parameters": {
        "chunkSize": 1000,
        "chunkOverlap": 200,
        "options": {}
      },
      "id": "rag00001-0003-4000-8000-000000000003",
      "name": "Split into Chunks",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "typeVersion": 1,
      "position": [680, 300]
    },
    {
      "parameters": {
        "model": "text-embedding-3-small",
        "options": {}
      },
      "id": "rag00001-0004-4000-8000-000000000004",
      "name": "Embed Chunks",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1,
      "position": [900, 300]
    },
    {
      "parameters": {
        "mode": "insert",
        "memoryKey": "rag-document-store",
        "options": {}
      },
      "id": "rag00001-0005-4000-8000-000000000005",
      "name": "Store in Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "typeVersion": 1,
      "position": [1120, 300]
    },
    {
      "parameters": {},
      "id": "rag00001-0006-4000-8000-000000000006",
      "name": "Ingestion Complete",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [1340, 300]
    }
  ],
  "connections": {
    "Ingest Document Webhook": {
      "main": [[{ "node": "Fetch Document", "type": "main", "index": 0 }]]
    },
    "Fetch Document": {
      "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 Store", "type": "main", "index": 0 }]]
    },
    "Store in Vector Store": {
      "main": [[{ "node": "Ingestion Complete", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "meta": {},
  "pinData": {}
}
