{
  "name": "tool_search_products",
  "nodes": [
    {
      "id": "Start",
      "name": "Start",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1,
      "position": [
        -460,
        120
      ],
      "parameters": {}
    },
    {
      "id": "Embed Query",
      "name": "Embed Query",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1,
      "position": [
        -220,
        120
      ],
      "parameters": {
        "model": "text-embedding-3-small",
        "text": "={{ $json.query }}"
      }
    },
    {
      "id": "Qdrant Search",
      "name": "Qdrant Search",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1,
      "position": [
        20,
        120
      ],
      "parameters": {
        "operation": "retrieve",
        "collection": "products",
        "topK": 5,
        "includeMetadata": true
      }
    },
    {
      "id": "Format",
      "name": "Format",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        260,
        120
      ],
      "parameters": {
        "jsCode": "const rows = $json.matches || [];\nreturn [{ results: rows.map(r => ({ id: r.payload?.id, name: r.payload?.name, category: r.payload?.category, price: r.payload?.price, description: r.payload?.description, score: r.score })) }];"
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Embed Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embed Query": {
      "main": [
        [
          {
            "node": "Qdrant Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Search": {
      "main": [
        [
          {
            "node": "Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false
}