カスタムQdrantベクタース토アMCPサーバーを構築

上級

これはBuilding Blocks, AI分野の自動化ワークフローで、44個のノードを含みます。主にIf, Set, Code, Filter, Switchなどのノードを使用、AI技術を活用したスマート自動化を実現。 カスタムQdrantベクターストアMCPサーバーを構築する

前提条件
  • ターゲットAPIの認証情報が必要な場合あり
  • OpenAI API Key
  • Qdrantサーバー接続情報
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "49620d3a-d4ec-4017-ade1-ff2ef5473c11",
      "name": "付箋",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 680,
        "height": 660,
        "content": "## 1. Set up an MCP Server Trigger\n[Read more about the MCP Server Trigger](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger)"
      },
      "typeVersion": 1
    },
    {
      "id": "f0646a81-d328-4f07-a744-60f576b5a51e",
      "name": "挿入",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -40,
        380
      ],
      "parameters": {
        "name": "insert_review",
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}"
        },
        "description": "=Call this tool to insert a customer's review into our review database.",
        "workflowInputs": {
          "value": {
            "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('text', `The contents of the review`, 'string') }}",
            "text2": "null",
            "operation": "insert",
            "companyIds": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('companyIds', `The company ID is their url address.`, 'string') }}"
          },
          "schema": [
            {
              "id": "operation",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "operation",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "text2",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "companyIds",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "companyIds",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "21e8beac-dbd5-44d7-8472-4edff3f63308",
      "name": "検索",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        80,
        440
      ],
      "parameters": {
        "name": "search_reviews",
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}",
          "cachedResultName": "={{ $workflow.id }}"
        },
        "description": "Call this tool to search our reviews database.",
        "workflowInputs": {
          "value": {
            "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('text', `the query or search terms to use`, 'string') }}",
            "text2": "null",
            "operation": "search",
            "companyIds": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('companyIds', `Optional, leave blank to search over all companies otherwise one or more company IDs comma-delimited. The company ID is their url address.`, 'string') }}"
          },
          "schema": [
            {
              "id": "operation",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "operation",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "text2",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "companyIds",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "companyIds",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "ffb100a4-9108-4ccd-a897-e5cd9e752232",
      "name": "レコメンド",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        280,
        240
      ],
      "parameters": {
        "name": "recommend_reviews",
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}"
        },
        "description": "Call this tool to generate a recommendation for a review based on positive and/or negative preferences.",
        "workflowInputs": {
          "value": {
            "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('text', `preferences to include.`, 'string') }}",
            "text2": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('text2', `preference to avoid.`, 'string') }}",
            "operation": "recommend",
            "companyIds": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('companyIds', `Optional, leave blank to search across all reviews otherwise one or more company IDs, comma-delimited. The company ID is their url address.`, 'string') }}"
          },
          "schema": [
            {
              "id": "operation",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "operation",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "text2",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "companyIds",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "companyIds",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "d1d53cbc-0a22-409d-9336-d8c98eeaa170",
      "name": "Qdrant MCPサーバー",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        -40,
        60
      ],
      "webhookId": "a1aff1b5-e5c7-4ca2-91eb-017c1fe32dab",
      "parameters": {
        "path": "a1aff1b5-e5c7-4ca2-91eb-017c1fe32dab"
      },
      "typeVersion": 1
    },
    {
      "id": "82d747a5-ff5f-44ff-9f68-cc1aa01ba1de",
      "name": "別ワークフローから実行時",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        540,
        280
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "operation"
            },
            {
              "name": "text"
            },
            {
              "name": "text2"
            },
            {
              "name": "companyIds"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "c7a2e948-5cd5-4545-a633-c1157e63edec",
      "name": "操作",
      "type": "n8n-nodes-base.switch",
      "position": [
        760,
        240
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "listCompanies",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "fe782b0f-f501-4985-a9d2-f63f4019177f",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.operation }}",
                    "rightValue": "listCompanies"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "insert",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "81b134bc-d671-4493-b3ad-8df9be3f49a6",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.operation }}",
                    "rightValue": "insert"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "search",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "8d57914f-6587-4fb3-88e0-aa1de6ba56c1",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.operation }}",
                    "rightValue": "search"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "compare",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7c38f238-213a-46ec-aefe-22e0bcb8dffc",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.operation }}",
                    "rightValue": "compare"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "recommend",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "2c691501-786a-433f-a185-3a6e0d08d336",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.operation }}",
                    "rightValue": "recommend"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "18d805db-376c-4583-963a-db1e5d09aa50",
      "name": "付箋1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -140
      ],
      "parameters": {
        "color": 7,
        "width": 580,
        "height": 320,
        "content": "## 2. Expand Functionality Beyond Vendor Implementation\n[Read more about the Qdrant Node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreqdrant)\n\nOfficially supported MCP servers are cool but may not always have the features you want. N8N MCP servers give you the freedom to expand and customise to fit your business or product needs and requirements.\n\nFor our Qdrant MCP server, we've added 2 additional capabilities from the Qdrant API; The Group Search and Recommendation API. With these, we can explore many more use-cases for our users.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ab8aeea3-0564-4c96-a67c-ff319df3297b",
      "name": "比較",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        220,
        380
      ],
      "parameters": {
        "name": "compare_reviews",
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}",
          "cachedResultName": "={{ $workflow.id }}"
        },
        "description": "Call this tool to compare search results across 2 or more companies.",
        "workflowInputs": {
          "value": {
            "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('text', `the query or search terms to use`, 'string') }}",
            "text2": "null",
            "operation": "compare",
            "companyIds": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('companyIds', `Two or more company IDs, comma-delimited. The company ID is their url address.`, 'string') }}"
          },
          "schema": [
            {
              "id": "operation",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "operation",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "text2",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "companyIds",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "companyIds",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "4f0876cb-dc07-486e-937b-334fa2cb754f",
      "name": "付箋8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        860
      ],
      "parameters": {
        "width": 213.30551928619226,
        "height": 332.38559808882246,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### 🚨Configure Your Qdrant Connection\n* Be sure to enter your endpoint address"
      },
      "typeVersion": 1
    },
    {
      "id": "02031bac-016f-4715-8413-6255cf73e103",
      "name": "レコメンド API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1980,
        900
      ],
      "parameters": {
        "url": "=http://qdrant:6333/collections/trustpilot_reviews/points/recommend",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "strategy",
              "value": "average_vector"
            },
            {
              "name": "limit",
              "value": "={{ 3 }}"
            },
            {
              "name": "positive",
              "value": "={{ [$json.embeddings[0]] }}"
            },
            {
              "name": "negative",
              "value": "={{ [$json.embeddings[1]] }}"
            },
            {
              "name": "filter",
              "value": "={{\n$('Operation').first().json.companyIds\n  ? {\n    \"must\": {\n      \"key\": \"metadata.company_id\",\n      \"match\": {\n        \"any\": $('Operation').first().json.companyIds.split(',')\n      }\n    }\n  }\n  : {}\n}}"
            },
            {
              "name": "with_payload",
              "value": "={{ true }}"
            }
          ]
        },
        "nodeCredentialType": "qdrantApi"
      },
      "credentials": {
        "qdrantApi": {
          "id": "NyinAS3Pgfik66w5",
          "name": "QdrantApi account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "9d058dae-2f24-4e34-bdb6-ba5649a3b431",
      "name": "埋め込み取得",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1580,
        900
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/embeddings",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "input",
              "value": "={{ $json.text }}"
            },
            {
              "name": "model",
              "value": "text-embedding-3-small"
            }
          ]
        },
        "nodeCredentialType": "openAiApi"
      },
      "credentials": {
        "openAiApi": {
          "id": "8gccIjcuf3gvaoEr",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "dfbb9a02-91dd-4dc4-8738-0aff41db2156",
      "name": "選好からアイテム",
      "type": "n8n-nodes-base.code",
      "position": [
        1380,
        900
      ],
      "parameters": {
        "jsCode": "return [\n  { text: $input.first().json.text },\n  { text: $input.first().json.text2 }\n]"
      },
      "typeVersion": 2
    },
    {
      "id": "7d6bda64-4f98-43d1-b181-343238f678bb",
      "name": "埋め込み集約",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1780,
        900
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "renameField": true,
              "outputFieldName": "embeddings",
              "fieldToAggregate": "data[0].embedding"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8eacac44-9cfd-4aa0-be7d-534ae630a2d4",
      "name": "埋め込み取得1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1380,
        560
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/embeddings",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "input",
              "value": "={{ $json.text }}"
            },
            {
              "name": "model",
              "value": "text-embedding-3-small"
            }
          ]
        },
        "nodeCredentialType": "openAiApi"
      },
      "credentials": {
        "openAiApi": {
          "id": "8gccIjcuf3gvaoEr",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5b23221c-aeb8-4a4f-b33b-75d46ba7a4fd",
      "name": "埋め込み集約1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1580,
        560
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "renameField": true,
              "outputFieldName": "embeddings",
              "fieldToAggregate": "data[0].embedding"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bbbfaf2f-8294-401f-9f01-efeb58e99f15",
      "name": "グループ検索 API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1780,
        560
      ],
      "parameters": {
        "url": "http://qdrant:6333/collections/trustpilot_reviews/points/search/groups",
        "method": "POST",
        "options": {},
        "jsonBody": "={{\n{\n  \"vector\": $json.embeddings[0],\n  \"group_by\": \"metadata.company_id\",\n  \"limit\": 10,\n  \"group_size\": 3,\n  \"with_payload\": true\n}\n}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "qdrantApi"
      },
      "credentials": {
        "qdrantApi": {
          "id": "NyinAS3Pgfik66w5",
          "name": "QdrantApi account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "bbed1c97-eebb-47f1-9486-73bade35d290",
      "name": "結果あり?",
      "type": "n8n-nodes-base.if",
      "position": [
        2600,
        560
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a83c0c10-74a7-4a52-b6c4-26dc8313023b",
              "operator": {
                "type": "object",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e995b27a-f331-434c-a828-bc02f978b43c",
      "name": "グループ結果簡素化",
      "type": "n8n-nodes-base.set",
      "position": [
        2180,
        560
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "caf5bf23-087a-496f-8d20-56ab70e303a8",
              "name": "category",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "db3c2c92-b951-4365-9c19-d5d0f8654a42",
              "name": "results",
              "type": "array",
              "value": "={{\n$json.hits?.map(hit => ({\n  content: hit.payload.content,\n  metadata: hit.payload.metadata\n}))\n}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e0c327a5-ab2e-46ad-9d4b-0fe8cdd1605c",
      "name": "空比較応答",
      "type": "n8n-nodes-base.set",
      "position": [
        2820,
        660
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "24ab771e-0e19-4bfe-bfee-2fed3a34f7fe",
              "name": "response",
              "type": "string",
              "value": "no results."
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "52890718-81b4-4880-9a12-b8456e96ad98",
      "name": "比較応答集約",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2820,
        440
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "response"
      },
      "typeVersion": 1
    },
    {
      "id": "bb87afe4-6910-4c79-9371-d49e77134ac3",
      "name": "埋め込み OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1340,
        -40
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "8gccIjcuf3gvaoEr",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ba6e426b-9629-445f-b96c-b8b51fcafe3d",
      "name": "デフォルトデータローダー",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1460,
        -40
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "company_id",
                "value": "={{ $json.companyIds ?? 'unspecified' }}"
              }
            ]
          }
        },
        "jsonData": "={{ $json.text }}",
        "jsonMode": "expressionData"
      },
      "typeVersion": 1
    },
    {
      "id": "de9e7ffa-49e8-40de-acef-fd92216ec10c",
      "name": "再帰的文字テキスト分割器",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1560,
        80
      ],
      "parameters": {
        "options": {},
        "chunkSize": 3000
      },
      "typeVersion": 1
    },
    {
      "id": "9d639f7f-5c3e-478f-ba6f-70b2e06394de",
      "name": "レコメンド応答簡素化",
      "type": "n8n-nodes-base.set",
      "position": [
        2180,
        900
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "56f12f89-75dc-4143-ae32-45f1561da19d",
              "name": "content",
              "type": "string",
              "value": "={{ $json.result[0].payload.content }}"
            },
            {
              "id": "57afc394-3793-4605-a751-8c0d446857e7",
              "name": "metadata",
              "type": "object",
              "value": "={{ $json.result[0].payload.metadata }}"
            }
          ]
        }
      },
      "typeVersion": 3.4,
      "alwaysOutputData": true
    },
    {
      "id": "736d02f1-8658-4d84-bdc6-3f43ad712a76",
      "name": "挿入応答取得",
      "type": "n8n-nodes-base.set",
      "position": [
        1780,
        -200
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cb612470-0d50-4179-a9af-144e592369a8",
              "name": "response",
              "type": "string",
              "value": "ok"
            }
          ]
        }
      },
      "executeOnce": true,
      "typeVersion": 3.4
    },
    {
      "id": "2a557659-8668-4dba-b3a7-2bc18981ca10",
      "name": "検索応答取得",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1780,
        240
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "response"
      },
      "typeVersion": 1
    },
    {
      "id": "017f0628-f08f-4d7c-b3da-83ada24bcfad",
      "name": "付箋9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1720,
        500
      ],
      "parameters": {
        "width": 213.30551928619226,
        "height": 332.38559808882246,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### 🚨Configure Your Qdrant Connection\n* Be sure to enter your endpoint address"
      },
      "typeVersion": 1
    },
    {
      "id": "cbbc7999-e2c4-4d84-9c21-7ce47a70ef2d",
      "name": "レビュー挿入",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        1380,
        -200
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "qdrantCollection": {
          "__rl": true,
          "mode": "list",
          "value": "trustpilot_reviews",
          "cachedResultName": "trustpilot_reviews"
        }
      },
      "credentials": {
        "qdrantApi": {
          "id": "NyinAS3Pgfik66w5",
          "name": "QdrantApi account"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "268dd3b8-631e-498c-8c50-33e61244ef7a",
      "name": "レビュー検索",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        1380,
        240
      ],
      "parameters": {
        "mode": "load",
        "topK": 10,
        "prompt": "={{ $json.text }}",
        "options": {
          "searchFilterJson": "={{\n$json.companyIds\n  ? {\n    \"must\": [\n      {\n        \"key\": \"metadata.company_id\",\n        \"match\": {\n          \"any\": $json.companyIds.split(',')\n        }\n      }\n    ]\n  }\n  : {}\n}}"
        },
        "qdrantCollection": {
          "__rl": true,
          "mode": "list",
          "value": "trustpilot_reviews",
          "cachedResultName": "trustpilot_reviews"
        }
      },
      "credentials": {
        "qdrantApi": {
          "id": "NyinAS3Pgfik66w5",
          "name": "QdrantApi account"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "45ff74b6-0e9e-4698-98b9-e778f1605df2",
      "name": "企業ごとに分割",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1980,
        560
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "result.groups"
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "1856fa8e-f184-4cef-b66f-6254e3f323ac",
      "name": "CompanyIdでフィルタ",
      "type": "n8n-nodes-base.filter",
      "position": [
        2380,
        560
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6b6fac92-c001-4070-b8ed-0c63ef54d293",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{\n$('Operation').item.json.companyIds\n  ? $('Operation').item.json.companyIds.split(',').includes($json.id)\n  : true\n}}",
              "rightValue": "={{ $json.id }}"
            }
          ]
        }
      },
      "typeVersion": 2.2,
      "alwaysOutputData": true
    },
    {
      "id": "3c468d41-9462-4ee0-b9c8-97e8213c0f32",
      "name": "レコメンド応答集約",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2600,
        780
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "response"
      },
      "typeVersion": 1
    },
    {
      "id": "825ee679-b0bd-4b7a-8684-4a1f7959926e",
      "name": "結果あり?1",
      "type": "n8n-nodes-base.if",
      "position": [
        2380,
        900
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a83c0c10-74a7-4a52-b6c4-26dc8313023b",
              "operator": {
                "type": "object",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "bfa17c34-7f84-40e2-8c9b-f92c0475fa05",
      "name": "空比較応答1",
      "type": "n8n-nodes-base.set",
      "position": [
        2600,
        1000
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "24ab771e-0e19-4bfe-bfee-2fed3a34f7fe",
              "name": "response",
              "type": "string",
              "value": "no results."
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "93860126-eb7a-40b1-8a4e-1824d0aebe01",
      "name": "埋め込み OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1480,
        400
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "8gccIjcuf3gvaoEr",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c3d89756-9073-4640-88ba-eb2c5cf370a1",
      "name": "企業一覧",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -120,
        240
      ],
      "parameters": {
        "name": "listAvailableCompanies",
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}"
        },
        "description": "Call this tool to list all available companies in the reviews database.",
        "workflowInputs": {
          "value": {
            "text": "null",
            "text2": "null",
            "operation": "listCompanies",
            "companyIds": "null"
          },
          "schema": [
            {
              "id": "operation",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "operation",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "text2",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "companyIds",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "companyIds",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "d9a02360-f9aa-4aea-b26f-f3482f55fc18",
      "name": "ファセット別一覧 API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1380,
        -440
      ],
      "parameters": {
        "url": "http://qdrant:6333/collections/trustpilot_reviews/facet",
        "method": "POST",
        "options": {},
        "jsonBody": "{\n  \"key\": \"metadata.company_id\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "qdrantApi"
      },
      "credentials": {
        "qdrantApi": {
          "id": "NyinAS3Pgfik66w5",
          "name": "QdrantApi account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6822aee2-7dfe-43ea-8238-ea0a3c8f0188",
      "name": "付箋2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        -740
      ],
      "parameters": {
        "width": 440,
        "height": 1320,
        "content": "## Try It Out!\n### This n8n demonstrates how to build your own Qdrant MCP server to extend its functionality beyond that of the official implementation.\n\nThis n8n implementation exposes other cool API features from Qdrant such as facet search, grouped search and recommendations APIs. With this, we can build an easily customisable and maintainable Qdrant MCP server for business intelligence.\n\nThis MCP example is based off an official MCP reference implementation which can be found here -https://github.com/qdrant/mcp-server-qdrant/\n\n### How it works\n* A MCP server trigger is used and connected to 5 custom workflow tools. We're using custom workflow tools as there is quite a few nodes required for each task.\n* We use a mix of n8n supported Qdrant nodes for simple operations such as insert documents and similarity search, and HTTP node to hit the Qdrant API directly for Facet search, group search and recommendations.\n* We use \"Edit Field\" and \"Aggregate\" nodes to return suitable responses to the MCP client.\n\n### How to use\n* This Qdrant MCP server allows any compatible MCP client to manage a Qdrant Collection by supporting select and create operations. You will need to have a collection available before you can use this server. Use the Prerequisite manual steps to get started!\n* Connect your MCP client by following the n8n guidelines here - https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger/#integrating-with-claude-desktop\n* Try the following queries in your MCP client:\n  * \"Can you help me list the available companies in the collection?\"\n  * \"What do customers say about product deliveries from company X?\"\n  * \"What do customers of company X and company Y say about product ease of use?\"\n\n### Requirements\n* Qdrant for vector store. This can be an a cloud-hosted instance or one you can self-host internally.\n* MCP Client or Agent for usage such as Claude Desktop - https://claude.ai/download\n\n### Customising this workflow\n* Depending on what queries you'll receive, adjust the tool inputs to make it easier for the agent to set the right parameters.\n* Not interested in Reviews? The techniques shared in this template can be used for other types of collections.\n* Remember to set the MCP server to require credentials before going to production and sharing this MCP server with others!"
      },
      "typeVersion": 1
    },
    {
      "id": "f0b1f04f-b3bd-4ad0-b128-17a96cf52b81",
      "name": "ファセットインデックス作成",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        260,
        -580
      ],
      "parameters": {
        "url": "http://qdrant:6333/collections/trustpilot_reviews/index",
        "method": "PUT",
        "options": {},
        "jsonBody": "{\n  \"field_name\": \"metadata.company_id\",\n  \"field_schema\": \"keyword\"\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "481c298b-c9e7-412e-aaa0-2e1565fabda8",
      "name": "コレクション作成",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        60,
        -580
      ],
      "parameters": {
        "url": "http://qdrant:6333/collections/trustpilot_reviews",
        "method": "PUT",
        "options": {},
        "jsonBody": "{\n  \"vectors\": {\n    \"distance\": \"Cosine\",\n    \"size\": 1536\n  }\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "07e1f0f3-6f24-4a67-9b07-75667f496a9a",
      "name": "付箋3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        -740
      ],
      "parameters": {
        "color": 4,
        "width": 700,
        "height": 360,
        "content": "## Prerequisite: Setup Qdrant Collection\nIf you don't have an existing Qdrant Collection, you can use this manual flow to get started.\n1. Creates a collection called \"trustpilot_reviews\"\n2. Creates an index to allow for facet search ie. list of values of a the \"company_id\" metadata key."
      },
      "typeVersion": 1
    },
    {
      "id": "df0dacdb-4238-475b-9d98-ae7ce9e3142d",
      "name": "「ワークフローテスト」クリック時",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -140,
        -580
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8c0f0e65-82d2-427e-8c6d-2f89bd225f46",
      "name": "付箋4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        -200
      ],
      "parameters": {
        "color": 5,
        "width": 380,
        "height": 100,
        "content": "### Always Authenticate Your Server!\nBefore going to production, it's always advised to enable authentication on your MCP server trigger."
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "f0646a81-d328-4f07-a744-60f576b5a51e": {
      "ai_tool": [
        [
          {
            "node": "d1d53cbc-0a22-409d-9336-d8c98eeaa170",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "21e8beac-dbd5-44d7-8472-4edff3f63308": {
      "ai_tool": [
        [
          {
            "node": "d1d53cbc-0a22-409d-9336-d8c98eeaa170",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "ab8aeea3-0564-4c96-a67c-ff319df3297b": {
      "ai_tool": [
        [
          {
            "node": "d1d53cbc-0a22-409d-9336-d8c98eeaa170",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "c7a2e948-5cd5-4545-a633-c1157e63edec": {
      "main": [
        [
          {
            "node": "d9a02360-f9aa-4aea-b26f-f3482f55fc18",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "cbbc7999-e2c4-4d84-9c21-7ce47a70ef2d",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "268dd3b8-631e-498c-8c50-33e61244ef7a",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "8eacac44-9cfd-4aa0-be7d-534ae630a2d4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "dfbb9a02-91dd-4dc4-8738-0aff41db2156",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ffb100a4-9108-4ccd-a897-e5cd9e752232": {
      "ai_tool": [
        [
          {
            "node": "d1d53cbc-0a22-409d-9336-d8c98eeaa170",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "bbed1c97-eebb-47f1-9486-73bade35d290": {
      "main": [
        [
          {
            "node": "52890718-81b4-4880-9a12-b8456e96ad98",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "e0c327a5-ab2e-46ad-9d4b-0fe8cdd1605c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "825ee679-b0bd-4b7a-8684-4a1f7959926e": {
      "main": [
        [
          {
            "node": "3c468d41-9462-4ee0-b9c8-97e8213c0f32",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "bfa17c34-7f84-40e2-8c9b-f92c0475fa05",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c3d89756-9073-4640-88ba-eb2c5cf370a1": {
      "ai_tool": [
        [
          {
            "node": "d1d53cbc-0a22-409d-9336-d8c98eeaa170",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "02031bac-016f-4715-8413-6255cf73e103": {
      "main": [
        [
          {
            "node": "9d639f7f-5c3e-478f-ba6f-70b2e06394de",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9d058dae-2f24-4e34-bdb6-ba5649a3b431": {
      "main": [
        [
          {
            "node": "7d6bda64-4f98-43d1-b181-343238f678bb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cbbc7999-e2c4-4d84-9c21-7ce47a70ef2d": {
      "main": [
        [
          {
            "node": "736d02f1-8658-4d84-bdc6-3f43ad712a76",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "268dd3b8-631e-498c-8c50-33e61244ef7a": {
      "main": [
        [
          {
            "node": "2a557659-8668-4dba-b3a7-2bc18981ca10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8eacac44-9cfd-4aa0-be7d-534ae630a2d4": {
      "main": [
        [
          {
            "node": "5b23221c-aeb8-4a4f-b33b-75d46ba7a4fd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bbbfaf2f-8294-401f-9f01-efeb58e99f15": {
      "main": [
        [
          {
            "node": "45ff74b6-0e9e-4698-98b9-e778f1605df2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "481c298b-c9e7-412e-aaa0-2e1565fabda8": {
      "main": [
        [
          {
            "node": "f0b1f04f-b3bd-4ad0-b128-17a96cf52b81",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bb87afe4-6910-4c79-9371-d49e77134ac3": {
      "ai_embedding": [
        [
          {
            "node": "cbbc7999-e2c4-4d84-9c21-7ce47a70ef2d",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "93860126-eb7a-40b1-8a4e-1824d0aebe01": {
      "ai_embedding": [
        [
          {
            "node": "268dd3b8-631e-498c-8c50-33e61244ef7a",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "ba6e426b-9629-445f-b96c-b8b51fcafe3d": {
      "ai_document": [
        [
          {
            "node": "cbbc7999-e2c4-4d84-9c21-7ce47a70ef2d",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "1856fa8e-f184-4cef-b66f-6254e3f323ac": {
      "main": [
        [
          {
            "node": "bbed1c97-eebb-47f1-9486-73bade35d290",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "45ff74b6-0e9e-4698-98b9-e778f1605df2": {
      "main": [
        [
          {
            "node": "e995b27a-f331-434c-a828-bc02f978b43c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7d6bda64-4f98-43d1-b181-343238f678bb": {
      "main": [
        [
          {
            "node": "02031bac-016f-4715-8413-6255cf73e103",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "dfbb9a02-91dd-4dc4-8738-0aff41db2156": {
      "main": [
        [
          {
            "node": "9d058dae-2f24-4e34-bdb6-ba5649a3b431",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5b23221c-aeb8-4a4f-b33b-75d46ba7a4fd": {
      "main": [
        [
          {
            "node": "bbbfaf2f-8294-401f-9f01-efeb58e99f15",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e995b27a-f331-434c-a828-bc02f978b43c": {
      "main": [
        [
          {
            "node": "1856fa8e-f184-4cef-b66f-6254e3f323ac",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9d639f7f-5c3e-478f-ba6f-70b2e06394de": {
      "main": [
        [
          {
            "node": "825ee679-b0bd-4b7a-8684-4a1f7959926e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "de9e7ffa-49e8-40de-acef-fd92216ec10c": {
      "ai_textSplitter": [
        [
          {
            "node": "ba6e426b-9629-445f-b96c-b8b51fcafe3d",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "82d747a5-ff5f-44ff-9f68-cc1aa01ba1de": {
      "main": [
        [
          {
            "node": "c7a2e948-5cd5-4545-a633-c1157e63edec",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "df0dacdb-4238-475b-9d98-ae7ce9e3142d": {
      "main": [
        [
          {
            "node": "481c298b-c9e7-412e-aaa0-2e1565fabda8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

上級 - ビルディングブロック, 人工知能

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
上級
ノード数44
カテゴリー2
ノードタイプ17
難易度説明

上級者向け、16ノード以上の複雑なワークフロー

作成者
Jimleuk

Jimleuk

@jimleuk

Freelance consultant based in the UK specialising in AI-powered automations. I work with select clients tackling their most challenging projects. For business enquiries, send me an email at hello@jimle.uk LinkedIn: https://www.linkedin.com/in/jimleuk/ X/Twitter: https://x.com/jimle_uk

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34