{
  "name": "Ingest Vector Store",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        100,
        0
      ],
      "id": "b593a046-192a-4d45-9bdf-e94c5237921b",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "fileSelector": "/home/node/data/**/qna*.csv",
        "options": {}
      },
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1,
      "position": [
        300,
        0
      ],
      "id": "cec46635-d88c-4720-9735-8c6493e4afdd",
      "name": "Read/Write Files from Disk",
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "mode": "insert",
        "qdrantCollection": {
          "__rl": true,
          "value": "qna",
          "mode": "id"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.3,
      "position": [
        960,
        0
      ],
      "id": "92125fe0-778d-42d7-9ba5-92a9bb99e788",
      "name": "Qdrant Vector Store",
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "dimensions": 1536
        }
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        960,
        180
      ],
      "id": "01b37c5c-972f-48fe-a482-8f1a807e2f0d",
      "name": "Embeddings OpenAI",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsonMode": "expressionData",
        "jsonData": "={{ $json.pageContent }}",
        "textSplittingMode": "custom",
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "question",
                "value": "={{ $json.metadata.question }}"
              },
              {
                "name": "answer",
                "value": "={{ $json.metadata.answer }}"
              },
              {
                "name": "intent",
                "value": "={{ $json.metadata.intent }}"
              },
              {
                "name": "category",
                "value": "={{ $json.metadata.category }}"
              },
              {
                "name": "source",
                "value": "={{ $json.metadata.source }}"
              },
              {
                "name": "created_at",
                "value": "={{ $json.metadata.created_at }}"
              }
            ]
          }
        }
      },
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1.1,
      "position": [
        1120,
        200
      ],
      "id": "0dba76fa-856f-406a-93c8-b48d413ff901",
      "name": "Default Data Loader"
    },
    {
      "parameters": {
        "chunkOverlap": 200,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        1120,
        340
      ],
      "id": "98e35081-2ff3-4665-b6f4-762777e8f68a",
      "name": "Recursive Character Text Splitter"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        520,
        0
      ],
      "id": "e520422a-ad28-4657-9192-f0562f4c0f77",
      "name": "Extract from File"
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "={\n  \"pageContent\": \"Q:{{ $json.question }}\\nA:{{ $json.answer }}\",\n  \"metadata\": {\n    \"question\": \"{{ $json.question }}\",\n    \"answer\": \"{{ $json.answer }}\",\n    \"intent\": \"{{ $json.intent }}\",\n    \"category\": \"{{ $json.category }}\",\n    \"source\": \"{{ $json.source }}\",\n    \"created_at\": \"{{ $json.created_at }}\"\n  }\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        740,
        0
      ],
      "id": "f8651d02-1718-4516-9488-2e7d5973b219",
      "name": "Edit Fields"
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Read/Write Files from Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read/Write Files from Disk": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6e7c87a5-e43d-48e2-983d-3cd599d731c3",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "Pufsf5qi3GEvXLD8",
  "tags": []
}