{
  "id": "pPtCy6qPfEv1qNRn",
  "name": "[1/3 - anomaly detection] [1/2 - KNN classification] Batch upload dataset to Qdrant (crops dataset)",
  "tags": [
    {
      "id": "n3zAUYFhdqtjhcLf",
      "name": "qdrant",
      "createdAt": "2024-12-10T11:56:59.987Z",
      "updatedAt": "2024-12-10T11:56:59.987Z"
    }
  ],
  "nodes": [
    {
      "id": "53831410-b4f3-4374-8bdd-c2a33cd873cb",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -640,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e303ccea-c0e0-4fe5-bd31-48380a0e438f",
      "name": "Google Cloud Storage",
      "type": "n8n-nodes-base.googleCloudStorage",
      "position": [
        820,
        160
      ],
      "parameters": {
        "resource": "object",
        "returnAll": true,
        "bucketName": "n8n-qdrant-demo",
        "listFilters": {
          "prefix": "agricultural-crops"
        },
        "requestOptions": {}
      },
      "credentials": {
        "googleCloudStorageOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "737bdb15-61cf-48eb-96af-569eb5986ee8",
      "name": "Get fields for Qdrant",
      "type": "n8n-nodes-base.set",
      "position": [
        1080,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "10d9147f-1c0c-4357-8413-3130829c2e24",
              "name": "=publicLink",
              "type": "string",
              "value": "=https://storage.googleapis.com/{{ $json.bucket }}/{{ $json.selfLink.split('/').splice(-1) }}"
            },
            {
              "id": "ff9e6a0b-e47a-4550-a13b-465507c75f8f",
              "name": "cropName",
              "type": "string",
              "value": "={{ $json.id.split('/').slice(-3, -2)[0].toLowerCase()}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2b18ed0c-38d3-49e9-be3d-4f7b35f4d9e5",
      "name": "Qdrant cluster variables",
      "type": "n8n-nodes-base.set",
      "position": [
        -360,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "58b7384d-fd0c-44aa-9f8e-0306a99be431",
              "name": "qdrantCloudURL",
              "type": "string",
              "value": "=https://152bc6e2-832a-415c-a1aa-fb529f8baf8d.eu-central-1-0.aws.cloud.qdrant.io"
            },
            {
              "id": "e34c4d88-b102-43cc-a09e-e0553f2da23a",
              "name": "collectionName",
              "type": "string",
              "value": "=agricultural-crops"
            },
            {
              "id": "33581e0a-307f-4380-9533-615791096de7",
              "name": "VoyageEmbeddingsDim",
              "type": "number",
              "value": 1024
            },
            {
              "id": "6e390343-2cd2-4559-aba9-82b13acb7f52",
              "name": "batchSize",
              "type": "number",
              "value": 4
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f88d290e-3311-4322-b2a5-1350fc1f8768",
      "name": "Embed crop image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2120,
        160
      ],
      "parameters": {
        "url": "https://api.voyageai.com/v1/multimodalembeddings",
        "method": "POST",
        "options": {},
        "jsonBody": "={{\n{\n  \"inputs\": $json.batchVoyage,\n  \"model\": \"voyage-multimodal-3\",\n  \"input_type\": \"document\"\n}\n}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "250c6a8d-f545-4037-8069-c834437bbe15",
      "name": "Create Qdrant Collection",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        320,
        160
      ],
      "parameters": {
        "url": "={{ $('Qdrant cluster variables').first().json.qdrantCloudURL }}/collections/{{ $('Qdrant cluster variables').first().json.collectionName }}",
        "method": "PUT",
        "options": {},
        "jsonBody": "={{\n{\n  \"vectors\": {\n    \"voyage\": { \n      \"size\": $('Qdrant cluster variables').first().json.VoyageEmbeddingsDim, \n      \"distance\": \"Cosine\" \n    } \n  }\n}\n}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "qdrantApi"
      },
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "20b612ff-4794-43ef-bf45-008a16a2f30f",
      "name": "Check Qdrant Collection Existence",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -100,
        0
      ],
      "parameters": {
        "url": "={{ $json.qdrantCloudURL }}/collections/{{ $json.collectionName }}/exists",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "qdrantApi"
      },
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c067740b-5de3-452e-a614-bf14985a73a0",
      "name": "Batches in the API's format",
      "type": "n8n-nodes-base.set",
      "position": [
        1860,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f14db112-6f15-4405-aa47-8cb56bb8ae7a",
              "name": "=batchVoyage",
              "type": "array",
              "value": "={{ $json.batch.map(item => ({ \"content\": ([{\"type\": \"image_url\", \"image_url\": item[\"publicLink\"]}])}))}}"
            },
            {
              "id": "3885fd69-66f5-4435-86a4-b80eaa568ac1",
              "name": "=batchPayloadQdrant",
              "type": "array",
              "value": "={{ $json.batch.map(item => ({\"crop_name\":item[\"cropName\"], \"image_path\":item[\"publicLink\"]})) }}"
            },
            {
              "id": "8ea7a91e-af27-49cb-9a29-41dae15c4e33",
              "name": "uuids",
              "type": "array",
              "value": "={{ $json.uuids }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bf9a9532-db64-4c02-b91d-47e708ded4d3",
      "name": "Batch Upload to Qdrant",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2320,
        160
      ],
      "parameters": {
        "url": "={{ $('Qdrant cluster variables').first().json.qdrantCloudURL }}/collections/{{ $('Qdrant cluster variables').first().json.collectionName }}/points",
        "method": "PUT",
        "options": {},
        "jsonBody": "={{\n{\n  \"batch\": {\n      \"ids\" : $('Batches in the API\\'s format').item.json.uuids,\n      \"vectors\": {\"voyage\": $json.data.map(item => item[\"embedding\"]) },\n      \"payloads\": $('Batches in the API\\'s format').item.json.batchPayloadQdrant\n  }\n}\n}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "qdrantApi"
      },
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3c30373f-c84c-405f-bb84-ec8b4c7419f4",
      "name": "Split in batches, generate uuids for Qdrant points",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        160
      ],
      "parameters": {
        "language": "python",
        "pythonCode": "import uuid\n\ncrops = [item.json for item in _input.all()]\nbatch_size = int(_('Qdrant cluster variables').first()['json']['batchSize'])\n\ndef split_into_batches_add_uuids(array, batch_size):\n    return [\n      {\n        \"batch\": array[i:i + batch_size],\n        \"uuids\": [str(uuid.uuid4()) for j in range(len(array[i:i + batch_size]))]\n      }\n       for i in range(0, len(array), batch_size)\n    ]\n\n# Split crops into batches\nbatched_crops = split_into_batches_add_uuids(crops, batch_size)\n\nreturn batched_crops"
      },
      "typeVersion": 2
    },
    {
      "id": "2b028f8c-0a4c-4a3a-9e2b-14b1c2401c6d",
      "name": "If collection exists",
      "type": "n8n-nodes-base.if",
      "position": [
        120,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "2104b862-667c-4a34-8888-9cb81a2e10f8",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.result.exists }}",
              "rightValue": "true"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "768793f6-391e-4cc9-b637-f32ee2f77156",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        340
      ],
      "parameters": {
        "width": 280,
        "height": 200,
        "content": "\ub2e4\uc74c \uc6cc\ud06c\ud50c\ub85c\uc6b0\uc5d0\uc11c Qdrant\ub97c \uc0ac\uc6a9\ud558\uc5ec `crop_name`\uc73c\ub85c \uc815\uc758\ub41c \uac01 \uc791\ubb3c \uc720\ud615\uc5d0 \uc18d\ud558\ub294 \uc774\ubbf8\uc9c0 \uc218\ub97c \uac00\uc838\uc62c \uac83\uc785\ub2c8\ub2e4. (\uc608\ub97c \ub4e4\uc5b4, \"cucumber\".)  \n\uc774 \uc815\ubcf4\ub97c \ud398\uc774\ub85c\ub4dc \ud544\ub4dc\uc758 \uce74\uc6b4\ud2b8\uc5d0 \ub300\ud574 \uc5bb\uae30 \uc704\ud574, \uadf8 \ud544\ub4dc\uc5d0 \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud558\uc5ec \uc790\uc6d0\uc744 \ucd5c\uc801\ud654\ud574\uc57c \ud569\ub2c8\ub2e4 (\ud55c \ubc88\ub9cc \uc218\ud589\ud558\uba74 \ub429\ub2c8\ub2e4). \uc774\uac83\uc774 \uc5ec\uae30\uc5d0\uc11c \uc77c\uc5b4\ub098\ub294 \uc77c\uc785\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "0c8896f7-8c57-4add-bc4d-03c4a774bdf1",
      "name": "Payload index on crop_name",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        500,
        160
      ],
      "parameters": {
        "url": "={{ $('Qdrant cluster variables').first().json.qdrantCloudURL }}/collections/{{ $('Qdrant cluster variables').first().json.collectionName }}/index",
        "method": "PUT",
        "options": {},
        "jsonBody": "={\n  \"field_name\": \"crop_name\",\n  \"field_schema\": \"keyword\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "qdrantApi"
      },
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "342186f6-41bf-46be-9be8-a9b1ca290d55",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -360
      ],
      "parameters": {
        "height": 300,
        "content": "\ubcc0\uc218 \uc124\uc815  \n1) \ud074\ub77c\uc6b0\ub4dc URL - Qdrant Cloud\uc5d0 \uc5f0\uacb0\ud558\uae30 \uc704\ud574 (\uc0ac\uc6a9\uc790\uc758 \uac1c\uc778 \ud074\ub7ec\uc2a4\ud130 URL)  \n2) Qdrant\uc758 \uceec\ub809\uc158 \uc774\ub984  \n3) Voyage \uc784\ubca0\ub529\uc758 \ud06c\uae30 (Qdrant\uc5d0\uc11c \uceec\ub809\uc158 \uc0dd\uc131\uc5d0 \ud544\uc694) <\uc774\uac83\uc740 \uc784\ubca0\ub529 \ubaa8\ub378\uc774 \ubcc0\uacbd\ub418\uc9c0 \uc54a\ub294 \ud55c \ubcc0\uacbd\ud558\uc9c0 \ub9d0\uc544\uc57c \ud568>  \n4) Qdrant\uc5d0 \ubc30\uce58 \uc784\ubca0\ub529/\ubc30\uce58 \uc5c5\ub85c\ub4dc\ub97c \uc704\ud55c \ubc30\uce58 \ud06c\uae30"
      },
      "typeVersion": 1
    },
    {
      "id": "fae9248c-dbcc-4b6d-b977-0047f120a587",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -100,
        -220
      ],
      "parameters": {
        "content": "Qdrant\uc5d0\uc11c \uceec\ub809\uc158\uc740 \ud55c \ubc88\ub9cc \uc0dd\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uac19\uc740 \uc774\ub984\uc73c\ub85c \ub450 \ubc88 \uc0dd\uc131\ud558\ub824\uace0 \ud558\uba74 \uc624\ub958\uac00 \ubc1c\uc0dd\ud558\ubbc0\ub85c, \uc774 \uc774\ub984\uc758 \uceec\ub809\uc158\uc774 \uc774\ubbf8 \uc874\uc7ac\ud558\ub294\uc9c0 \ud655\uc778\ud558\ub294 \ucf54\ub4dc\ub97c \ucd94\uac00\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "f7aea242-3d98-4a1c-a98a-986ac2b4928b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        340
      ],
      "parameters": {
        "height": 280,
        "content": "\ubcc0\uc218\uc5d0 \uc124\uc815\ub41c \uc774\ub984\uc758 \uceec\ub809\uc158\uc774 \uc544\uc9c1 \uc874\uc7ac\ud558\uc9c0 \uc54a\uc73c\uba74, \ube48 \uceec\ub809\uc158\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4; \n\n\uceec\ub809\uc158\uc740 [named vectors](https://qdrant.tech/documentation/concepts/vectors/#named-vectors)\ub97c \ud3ec\ud568\ud558\uba70, \uc774\ub984\uc740 \"voyage\"\uc785\ub2c8\ub2e4.\n\uc774 \uc774\ub984\uc774 \ubd99\uc740 \ubca1\ud130\uc5d0 \ub300\ud574 \ub450 \uac00\uc9c0 \ub9e4\uac1c\ubcc0\uc218\ub97c \uc815\uc758\ud569\ub2c8\ub2e4:\n1) \ubca1\ud130 \ud06c\uae30(\uc6b0\ub9ac \uacbd\uc6b0, Voyage \uc784\ubca0\ub529 \ud06c\uae30)\n2) \uc784\ubca0\ub529\uc744 \ube44\uad50\ud558\uae30 \uc704\ud55c \uc720\uc0ac\uc131 \uce21\uc815: \uc6b0\ub9ac \uacbd\uc6b0, **\"Cosine\"**."
      },
      "typeVersion": 1
    },
    {
      "id": "b84045c1-f66a-4543-8d42-1e76de0b6e91",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -280
      ],
      "parameters": {
        "height": 400,
        "content": "\uc774\uc81c Qdrant\uc5d0 \uc6b0\ub9ac \uc774\ubbf8\uc9c0 \ub370\uc774\ud130\uc14b\uc744 \uc784\ubca0\ub4dc \ubc0f \uc5c5\ub85c\ub4dc\ud560 \uc2dc\uac04\uc785\ub2c8\ub2e4;  \n\ub458 \ub2e4, [crops](https://www.kaggle.com/datasets/mdwaquarazam/agricultural-crops-image-classification)\uc640 [lands](https://www.kaggle.com/datasets/apollo2506/landuse-scene-classification)\uc740 \uc6b0\ub9ac Google Cloud Storage \ubc84\ud0b7\uc5d0 \uc5c5\ub85c\ub4dc\ub418\uc5c8\uace0, \uc774 \uc6cc\ud06c\ud50c\ub85c\uc6b0\uc5d0\uc11c **crops \ub370\uc774\ud130\uc14b**\uc744 \uac00\uc838\uc624\uace0 \uc788\uc2b5\ub2c8\ub2e4 (lands\uc758 \uacbd\uc6b0 \ubcc0\uc218 \uc774\ub984\uae4c\uc9c0 \uac70\uc758 \ub3d9\uc77c\ud55c \uc6cc\ud06c\ud50c\ub85c\uc6b0\uac00 \ub420 \uac83\uc785\ub2c8\ub2e4)  \n(\uc774\ub97c \ub2f9\uc2e0\uc758 \uc774\ubbf8\uc9c0 \ub370\uc774\ud130\uc14b\uc73c\ub85c \uad50\uccb4\ud574\uc57c \ud569\ub2c8\ub2e4)  \n\n\ub370\uc774\ud130\uc14b\uc740 **\uc774\ubbf8\uc9c0 URL**\ub85c \uad6c\uc131\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4; \uc774\ubbf8\uc9c0\ub294 \ud074\ub798\uc2a4\ub97c \uae30\ubc18\uc73c\ub85c \ud3f4\ub354\ub85c \uadf8\ub8f9\ud654\ub429\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, crops \ub370\uc774\ud130\uc14b\uc758 \uacbd\uc6b0 *\"tomato\"*\uc640 *\"cucumber\"*\uc640 \uac19\uc740 \ud558\uc704 \ud3f4\ub354 \uc2dc\uc2a4\ud15c\uc774 \uc788\uc73c\uba70, \uac01\uac01\uc758 \ud074\ub798\uc2a4\uc758 \uc774\ubbf8\uc9c0 URL\uc774 \uc788\uc2b5\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "255dfad8-c545-4d75-bc9c-529aa50447a9",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1080,
        -140
      ],
      "parameters": {
        "height": 240,
        "content": "Google Storage \ub178\ub4dc\uac00 mediaLink\uc744 \ubc18\ud658\ud569\ub2c8\ub2e4. \uc774 mediaLink\uc740 \uc774\ubbf8\uc9c0\ub97c \uc9c1\uc811 \ub2e4\uc6b4\ub85c\ub4dc\ud558\ub294 \ub370 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \uc6b0\ub9ac\ub294 Voyage API\uac00 \ucc98\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \uacf5\uac1c \uc774\ubbf8\uc9c0 URL\ub9cc \ud544\uc694\ud569\ub2c8\ub2e4. \uadf8\ub798\uc11c \uc5ec\uae30\uc11c \uc774 \uacf5\uac1c \ub9c1\ud06c\ub97c \uad6c\uc131\ud558\uace0, \uc774\ubbf8\uc9c0\uac00 \uc800\uc7a5\ub41c \ud3f4\ub354\uc5d0\uc11c \uc791\ubb3c \uc774\ub984\uc744 \ucd94\ucd9c\ud569\ub2c8\ub2e4(\uc608\ub97c \ub4e4\uc5b4, \"cucumber\")."
      },
      "typeVersion": 1
    },
    {
      "id": "a6acce75-cce0-4de3-bc64-37592c97359b",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -80
      ],
      "parameters": {
        "height": 180,
        "content": "\uc774\ubbf8\uc9c0\ub97c `batchSize` \ud06c\uae30\uc758 \ubc30\uce58\ub85c \uadf8\ub8f9\ud654\ud558\uace0, Qdrant\uc5d0 \ubc30\uce58 \uc5c5\ub85c\ub4dc\ub97c \uac00\ub2a5\ud558\uac8c \ud558\uae30 \uc704\ud574 UUID\ub97c \uc0dd\uc131\ud558\uc5ec \uc774\ub97c \ubc30\uce58 [point IDs](https://qdrant.tech/documentation/concepts/points/#point-ids)\ub85c \uc0ac\uc6a9\ud569\ub2c8\ub2e4 (Qdrant\uc740 \uc0ac\uc6a9\uc790\ub97c \uc704\ud574 ID\ub97c \uc124\uc815\ud558\uc9c0 \uc54a\uc73c\ubbc0\ub85c, \uc0ac\uc6a9\uc790\uac00 \uc9c1\uc811 \uc120\ud0dd\ud574\uc57c \ud569\ub2c8\ub2e4)"
      },
      "typeVersion": 1
    },
    {
      "id": "cab3cc83-b50c-41f4-8d51-59e04bba5556",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1340,
        -60
      ],
      "parameters": {
        "content": "\uc6b0\ub9ac\uac00 \uc791\ubb3c \ub370\uc774\ud130\uc14b\uc744 \uae30\ubc18\uc73c\ub85c \uc774\uc0c1 \uac10\uc9c0 \uc2dc\uc2a4\ud15c\uc744 \uad6c\ucd95\ud558\uace0 \uc788\uae30 \ub54c\ubb38\uc5d0, \uc774\ub97c \uc81c\ub300\ub85c \ud14c\uc2a4\ud2b8\ud558\uae30 \uc704\ud574, Qdrant\uc5d0 \ud1a0\ub9c8\ud1a0 \uc0ac\uc9c4\uc744 \uc804\ud600 \uc5c5\ub85c\ub4dc\ud558\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4; \uc5ec\uae30\uc11c \uadf8\uac83\ub4e4\uc744 \ud544\ud130\ub9c1\ud569\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "e5cdcce5-efdc-41f2-9796-656bd345f783",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1860,
        -100
      ],
      "parameters": {
        "height": 200,
        "content": "Voyage API\uac00 \ubc30\uce58 \uc784\ubca0\ub529\uc744 \uc704\ud574 [specific json structure](https://docs.voyageai.com/reference/multimodal-embeddings-api)\ub97c \uc694\uad6c\ud558\uae30 \ub54c\ubb38\uc5d0, [Qdrant's API for uploading points in batches](https://api.qdrant.tech/api-reference/points/upsert-points)\ub3c4 \ub9c8\ucc2c\uac00\uc9c0\ub85c, \ub098\ub294 JSON\uc758 \uad6c\uc870\ub97c \uc801\uc751\uc2dc\ud0a4\uace0 \uc788\uc2b5\ub2c8\ub2e4\n\n[NB] - [payload = Qdrant\uc758 \uba54\ud0c0 \ub370\uc774\ud130]"
      },
      "typeVersion": 1
    },
    {
      "id": "a7f15c44-3d5c-4b43-bfb2-94fe27a32071",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2120,
        20
      ],
      "parameters": {
        "width": 180,
        "height": 80,
        "content": "\uc774\ubbf8\uc9c0\ub97c Voyage \ubaa8\ub378\ub85c \uc784\ubca0\ub529 (input_type\uc5d0 \uc8fc\uc758)"
      },
      "typeVersion": 1
    },
    {
      "id": "01b92e7e-d954-4d58-85b1-109c336546c4",
      "name": "Filtering out tomato to test anomalies",
      "type": "n8n-nodes-base.filter",
      "position": [
        1340,
        160
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f7953ae2-5333-4805-abe5-abf6da645c5e",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.cropName }}",
              "rightValue": "tomato"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8d564817-885e-453a-a087-900b34b84d9c",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1160,
        -280
      ],
      "parameters": {
        "width": 440,
        "height": 460,
        "content": "## Qdrant\uc5d0 \ub370\uc774\ud130\uc14b \uc77c\uad04 \uc5c5\ub85c\ub4dc  \n### \uc774 \ud15c\ud50c\ub9bf\uc740 \uc2a4\ud1a0\ub9ac\uc9c0\uc5d0\uc11c \ub370\uc774\ud130\uc14b \uc774\ubbf8\uc9c0\ub97c \uac00\uc838\uc640, \uc774\ub97c \uc77c\uad04\ub85c \uc784\ubca0\ub529\uc744 \uc0dd\uc131\ud558\uace0, Qdrant\uc5d0 \uc77c\uad04 \uc5c5\ub85c\ub4dc\ud569\ub2c8\ub2e4. \uc774 \ud2b9\uc815 \ud15c\ud50c\ub9bf\uc5d0\uc11c\ub294 [\uc791\ubb3c \ub370\uc774\ud130\uc14b](https://www.kaggle.com/datasets/mdwaquarazam/agricultural-crops-image-classification)\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uadf8\ub7ec\ub098 [\ud1a0\uc9c0 \ub370\uc774\ud130\uc14b](https://www.kaggle.com/datasets/apollo2506/landuse-scene-classification)\uacfc \uc720\uc0ac\ud558\uba70, \uc77c\ubc18\uc801\uc73c\ub85c \uc774\ubbf8\uc9c0 URL\ub85c \uad6c\uc131\ub41c \uc5b4\ub5a4 \ub370\uc774\ud130\uc14b\uc5d0\ub3c4 \uc801\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4 (\ub2e4\uc74c \ud30c\uc774\ud504\ub77c\uc778\ucc98\ub7fc).  \n\n* \uba3c\uc800, \uae30\uc874 Qdrant \uceec\ub809\uc158\uc744 \ud655\uc778\ud558\uc5ec \uc0ac\uc6a9\ud558\uac70\ub098, \uadf8\ub807\uc9c0 \uc54a\uc73c\uba74 \uc5ec\uae30\uc5d0 \uc0dd\uc131\ud569\ub2c8\ub2e4. \ucd94\uac00\ub85c, \uceec\ub809\uc158\uc744 \uc0dd\uc131\ud560 \ub54c [\ud398\uc774\ub85c\ub4dc \uc778\ub371\uc2a4](https://qdrant.tech/documentation/concepts/indexing/#payload-index)\ub97c \uc0dd\uc131\ud560 \uac83\uc785\ub2c8\ub2e4. \uc774\ub294 \ub098\uc911\uc5d0 \uc0ac\uc6a9\ud560 \ud2b9\uc815 \uc720\ud615\uc758 Qdrant \uc694\uccad\uc5d0 \ud544\uc694\ud569\ub2c8\ub2e4.  \n* \ub2e4\uc74c\uc73c\ub85c, Google Storage\uc5d0\uc11c \ubaa8\ub4e0 (\ub370\uc774\ud130\uc14b) \uc774\ubbf8\uc9c0\ub97c \uac00\uc838\uc624\ub418, \ud1a0\ub9c8\ud1a0 \uad00\ub828\ub418\uc9c0 \uc54a\uc740 \uac83\ub9cc \uc720\uc9c0\ud569\ub2c8\ub2e4 (\uc774\uc0c1 \ud0d0\uc9c0 \ud14c\uc2a4\ud2b8\ub97c \uc704\ud574).  \n* \ubaa8\ub4e0 \uac00\uc838\uc628 \uc774\ubbf8\uc9c0\uc5d0 \ub300\ud574 Voyage AI \uba40\ud2f0\ubaa8\ub2ec \uc784\ubca0\ub529 API\ub97c \uc0ac\uc6a9\ud558\uc5ec (\uc77c\uad04\ub85c) \uc784\ubca0\ub529\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4.  \n* \ub9c8\uc9c0\ub9c9\uc73c\ub85c, \uc0dd\uc131\ub41c \uc784\ubca0\ub529\uacfc \uc774\ubbf8\uc9c0 \uc124\uba85\uc790\ub97c Qdrant\uc5d0 \uc77c\uad04 \uc5c5\ub85c\ub4dc\ud569\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "0233d3d0-bbdf-4d5b-a366-53cbfa4b6f9c",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -860,
        360
      ],
      "parameters": {
        "color": 4,
        "width": 540,
        "height": 420,
        "content": "### \uc774\uc0c1 \ud0d0\uc9c0\uc6a9\n**1. \uc774\ub294 (crops) \ub370\uc774\ud130\uc14b\uc744 Qdrant\uc758 \uceec\ub809\uc158\uc5d0 \uc5c5\ub85c\ub4dc\ud558\ub294 \uccab \ubc88\uc9f8 \ud30c\uc774\ud504\ub77c\uc778\uc785\ub2c8\ub2e4.**\n2. \ub450 \ubc88\uc9f8 \ud30c\uc774\ud504\ub77c\uc778\uc740 \uc774 Qdrant \uceec\ub809\uc158\uc5d0 \ud074\ub7ec\uc2a4\ud130 (\ud074\ub798\uc2a4) \uc13c\ud130\ub97c \uc124\uc815\ud558\uace0 \ud074\ub7ec\uc2a4\ud130 (\ud074\ub798\uc2a4) \uc784\uacc4\uac12 \uc810\uc218\ub97c \uc124\uc815\ud569\ub2c8\ub2e4.\n3. \uc138 \ubc88\uc9f8\ub294 \uc774\uc0c1 \ud0d0\uc9c0 \ub3c4\uad6c\ub85c, \uc785\ub825\uc73c\ub85c \uc5b4\ub5a4 \uc774\ubbf8\uc9c0\ub4e0 \ubc1b\uc544 Qdrant (crops) \uceec\ub809\uc158\uc5d0\uc11c \uc218\ud589\ub41c \ubaa8\ub4e0 \uc900\ube44 \uc791\uc5c5\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4.\n\n### KNN (k \ucd5c\uadfc\uc811 \uc774\uc6c3) \ubd84\ub958\uc6a9\n**1. \uc774\ub294 (lands) \ub370\uc774\ud130\uc14b\uc744 Qdrant\uc758 \uceec\ub809\uc158\uc5d0 \uc5c5\ub85c\ub4dc\ud558\ub294 \uccab \ubc88\uc9f8 \ud30c\uc774\ud504\ub77c\uc778\uc785\ub2c8\ub2e4.**\n2. \ub450 \ubc88\uc9f8\ub294 KNN \ubd84\ub958\uae30 \ub3c4\uad6c\ub85c, \uc785\ub825\uc73c\ub85c \uc5b4\ub5a4 \uc774\ubbf8\uc9c0\ub4e0 \ubc1b\uc544 Qdrant (lands) \uceec\ub809\uc158\uc5d0 \ub300\ud55c \ucffc\ub9ac\ub97c \uae30\ubc18\uc73c\ub85c \ubd84\ub958\ud569\ub2c8\ub2e4.\n\n### \ub458 \ub2e4 \uc7ac\uc0dd\uc131\ud558\uae30 \uc704\ud574\n[crops](https://www.kaggle.com/datasets/mdwaquarazam/agricultural-crops-image-classification) \ubc0f [lands](https://www.kaggle.com/datasets/apollo2506/landuse-scene-classification) \ub370\uc774\ud130\uc14b\uc744 Kaggle\uc5d0\uc11c \uc790\uc2e0\uc758 Google Storage \ubc84\ud0b7\uc5d0 \uc5c5\ub85c\ub4dc\ud574\uc57c \ud558\uba70, [Qdrant Cloud](https://qdrant.tech/documentation/quickstart-cloud/) (\ubb34\ub8cc \ud2f0\uc5b4 \ud074\ub7ec\uc2a4\ud130\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc74c), Voyage AI API \ubc0f Google Cloud Storage\uc5d0 \ub300\ud55c API/\uc5f0\uacb0\uc744 \uc7ac\uc0dd\uc131\ud574\uc57c \ud569\ub2c8\ub2e4.\n\n**\uc77c\ubc18\uc801\uc73c\ub85c \ud30c\uc774\ud504\ub77c\uc778\uc740 \uc774\ubbf8\uc9c0 \ub370\uc774\ud130\uc14b\uc5d0 \uc801\uc6a9 \uac00\ub2a5\ud569\ub2c8\ub2e4.**"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "27776c4a-3bf9-4704-9c13-345b75ffacc0",
  "connections": {
    "Embed crop image": {
      "main": [
        [
          {
            "node": "Batch Upload to Qdrant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Cloud Storage": {
      "main": [
        [
          {
            "node": "Get fields for Qdrant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If collection exists": {
      "main": [
        [
          {
            "node": "Google Cloud Storage",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Qdrant Collection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get fields for Qdrant": {
      "main": [
        [
          {
            "node": "Filtering out tomato to test anomalies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Batch Upload to Qdrant": {
      "main": [
        []
      ]
    },
    "Create Qdrant Collection": {
      "main": [
        [
          {
            "node": "Payload index on crop_name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant cluster variables": {
      "main": [
        [
          {
            "node": "Check Qdrant Collection Existence",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Payload index on crop_name": {
      "main": [
        [
          {
            "node": "Google Cloud Storage",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Batches in the API's format": {
      "main": [
        [
          {
            "node": "Embed crop image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Qdrant Collection Existence": {
      "main": [
        [
          {
            "node": "If collection exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Qdrant cluster variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filtering out tomato to test anomalies": {
      "main": [
        [
          {
            "node": "Split in batches, generate uuids for Qdrant points",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split in batches, generate uuids for Qdrant points": {
      "main": [
        [
          {
            "node": "Batches in the API's format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}