{
  "name": "Evaluate hybrid search for legal question-answering using Qdrant & BM25/mxbai",
  "nodes": [
    {
      "id": "eb8d4dd7-f40b-4524-a9de-f9ef9eef0eca",
      "name": "Index Dataset from HuggingFace",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -256,
        400
      ]
    },
    {
      "id": "78030f66-5331-463f-ad22-9d09f477e3f9",
      "name": "Split Them All Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        176,
        400
      ]
    },
    {
      "id": "e6d1e789-1293-480b-a163-992b0c7a2ae8",
      "name": "Get Dataset Splits",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -32,
        400
      ]
    },
    {
      "id": "cb58241e-4579-4c5b-bd65-4a20f6cf3698",
      "name": "Divide Per Row",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        816,
        400
      ]
    },
    {
      "id": "2ee71c28-71fd-4cba-87c7-c9886fb403c7",
      "name": "Keep Test Split",
      "type": "n8n-nodes-base.filter",
      "position": [
        384,
        400
      ]
    },
    {
      "id": "484a82fe-93d8-439b-bbb5-e96a4b5d7861",
      "name": "Get Test Queries",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        592,
        400
      ]
    },
    {
      "id": "20f67ae7-6631-4602-aa20-42a382db12ae",
      "name": "Query Points",
      "type": "n8n-nodes-qdrant.qdrant",
      "position": [
        2144,
        416
      ]
    },
    {
      "id": "445ace25-f900-4bcf-9f7d-9bc1db662867",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        2320,
        608
      ]
    },
    {
      "id": "c631ce99-a672-499f-bbf3-e740ef431884",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1776,
        400
      ]
    },
    {
      "id": "c075a745-ed50-459f-87dd-101a559e4523",
      "name": "Keep Questions with Answers in the Dataset",
      "type": "n8n-nodes-base.filter",
      "position": [
        1056,
        400
      ]
    },
    {
      "id": "94f78e9b-f9eb-4179-9844-d6e23bc79751",
      "name": "Keep Questions & IDs",
      "type": "n8n-nodes-base.set",
      "position": [
        1280,
        400
      ]
    },
    {
      "id": "08f67e31-ba8f-47fd-bc78-f352a160d4fd",
      "name": "Aggregate Evals",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2032,
        224
      ]
    },
    {
      "id": "413ade44-d27d-4c49-862f-afb9d4e18bf6",
      "name": "Percentage of isHits in Evals",
      "type": "n8n-nodes-base.set",
      "position": [
        2256,
        224
      ]
    },
    {
      "id": "c0840c22-8954-4937-80d9-f32741b81e1e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        144
      ],
      "parameters": {
        "width": 1520,
        "height": 464,
        "content": "## Get Questions to Eval Retrieval from Hugging Face Dataset (Already Indexed to Qdrant)\n\nFetching questions from a sample Q&A dataset on Hugging Face using the [Dataset Viewer API](https://huggingfac"
      }
    },
    {
      "id": "742e68ae-0013-4dda-a818-4485ff80a986",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        -256
      ],
      "parameters": {
        "width": 1088,
        "height": 1120,
        "content": "## Check Quality of Simple Hybrid Search on Legal Q&A Dataset\nFor each question in the evaluation set, using the qdrant collection created and indexed in Part 1:\n1. **Perform a Hybrid Search in Qdrant"
      }
    },
    {
      "id": "d4a32298-02ef-4f9e-b22d-3f30e9b74eb2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        -128
      ],
      "parameters": {
        "width": 1008,
        "height": 960,
        "content": "## Evaluate Hybrid Search on Legal Dataset\n*This is the second part of **\"Hybrid Search with Qdrant & n8n, Legal AI.\"**\nThe first part, **\"Indexing,\"** covers preparing and uploading the dataset to Qd"
      }
    },
    {
      "id": "56a5efd8-ed3f-46f7-85c8-966536f24a13",
      "name": "isHit = If we Found the Correct Answer",
      "type": "n8n-nodes-base.set",
      "position": [
        2512,
        608
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "isHit = If we Found the Correct Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query Points": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Divide Per Row": {
      "main": [
        [
          {
            "node": "Keep Questions with Answers in the Dataset",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Evals": {
      "main": [
        [
          {
            "node": "Percentage of isHits in Evals",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep Test Split": {
      "main": [
        [
          {
            "node": "Get Test Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Aggregate Evals",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          },
          {
            "node": "Query Points",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Test Queries": {
      "main": [
        [
          {
            "node": "Divide Per Row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Dataset Splits": {
      "main": [
        [
          {
            "node": "Split Them All Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Them All Out": {
      "main": [
        [
          {
            "node": "Keep Test Split",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep Questions & IDs": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Index Dataset from HuggingFace": {
      "main": [
        [
          {
            "node": "Get Dataset Splits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "isHit = If we Found the Correct Answer": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep Questions with Answers in the Dataset": {
      "main": [
        [
          {
            "node": "Keep Questions & IDs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}