{
  "name": "AI-powered document search with Oracle and ONNX embeddings for recruiting",
  "nodes": [
    {
      "id": "7f6e0486-a00b-459d-9bb4-19d05af06316",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1488,
        -848
      ]
    },
    {
      "id": "bf015c88-32d6-46ef-8301-50d2c32e46c5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2768,
        -1488
      ],
      "parameters": {
        "width": 1004,
        "height": 1472,
        "content": "# Oracle AI Hybrid Vector Search\n\n- This workflow automates the vector search alongside keyword search using the ***DBMS_HYBRID_VECTOR.SEARCH*** PL/SQL query API.\n- It shows how to use hybrid search i"
      }
    },
    {
      "id": "af3ac78d-58c1-4e6c-9c7f-114346e3953a",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1488,
        -320
      ]
    },
    {
      "id": "348a0e46-876f-46c6-935a-3454bb108638",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -1488
      ],
      "parameters": {
        "width": 816,
        "height": 368,
        "content": "## Create a local user and grant privileges\n\n- This step creates a new database user named ***docuser*** and assigns the necessary privileges to enable hybrid search operations. \n- It also provides th"
      }
    },
    {
      "id": "07e4ac13-969f-4821-b3bb-49073e8e0ca7",
      "name": "Create a user",
      "type": "n8n-nodes-base.oracleDatabase",
      "position": [
        -912,
        -1312
      ]
    },
    {
      "id": "ea50be65-2334-4772-a5b8-8cdc60a3eb00",
      "name": "ONNX Model Directory path",
      "type": "n8n-nodes-base.code",
      "position": [
        -704,
        -1312
      ]
    },
    {
      "id": "1897566f-531f-4e29-8c8a-3783e25b8e21",
      "name": "Grant Privileges to user",
      "type": "n8n-nodes-base.oracleDatabase",
      "position": [
        -496,
        -1312
      ]
    },
    {
      "id": "2556d56f-d4c8-4b17-8dc8-8631ce32662f",
      "name": "Setup the table, Reload ONNX model and clear old data",
      "type": "n8n-nodes-base.oracleDatabase",
      "position": [
        -16,
        -1312
      ]
    },
    {
      "id": "6102864a-83e1-400a-9bb2-b3af4b968086",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -1488
      ],
      "parameters": {
        "width": 496,
        "height": 368,
        "content": "## Setup the table, Reload ONNX model and clear old data\n\n- This step reloads the ONNX model, creates table ***doc_tab*** for storing the document contents and clears old table data and vector index.\n"
      }
    },
    {
      "id": "4a5c7ae4-15b0-4c8b-a46d-c1fe3afae49f",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -1488
      ],
      "parameters": {
        "width": 512,
        "height": 368,
        "content": "## Add the Documents\n\n- This step loads all the documents into table, ***doc_tab***.\n\n"
      }
    },
    {
      "id": "a79d4bf0-6b04-4f64-960d-eaf7c1861867",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        -1488
      ],
      "parameters": {
        "width": 480,
        "height": 368,
        "content": "## Create Hybrid Index\n\n- An index named ***my_hybrid_idx*** is created on the text column of the ***doc_tab*** table. \n\n"
      }
    },
    {
      "id": "2e5884db-f50f-4707-b477-380335320009",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1024,
        -960
      ],
      "parameters": {
        "width": 816,
        "height": 368,
        "content": "## Pure semantic search  in document mode \n\nThis is a pure vector-based similarity query to fetch document-level search results. Here, the search_text string is vectorized into a query vector for a **"
      }
    },
    {
      "id": "b49000a3-e0f3-4705-847a-0ad0e63347b1",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1024,
        -512
      ],
      "parameters": {
        "width": 816,
        "height": 496,
        "content": "## Hybrid Search\n\nThis search text t (C, Python, Database)  provided in Chat interface is transformed into a ***CONTAINS*** query for keyword search, and is ***vectorized*** for a VECTOR_DISTANCE quer"
      }
    },
    {
      "id": "e7316c5e-c178-4a0d-8b1d-7706c114770b",
      "name": "Generate Documents data",
      "type": "n8n-nodes-base.code",
      "position": [
        448,
        -1312
      ]
    },
    {
      "id": "7efb09bd-7c35-41f6-ab65-b8680801203e",
      "name": "Add Documents in to table",
      "type": "n8n-nodes-base.oracleDatabase",
      "position": [
        688,
        -1312
      ]
    },
    {
      "id": "4c39f326-a43f-4ec3-a7b7-970b4fcdb9b2",
      "name": "Create Hybrid Index",
      "type": "n8n-nodes-base.oracleDatabase",
      "position": [
        1136,
        -1312
      ]
    },
    {
      "id": "70b09847-5cfe-49f0-9ab3-c97cc8f7672b",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        -512
      ],
      "parameters": {
        "width": 416,
        "height": 496,
        "content": "## Hybrid Search\n\nThis search text (C, Python, Database)  provided in Chat interface is provided to perform Hybrid Search.\n\n"
      }
    },
    {
      "id": "18c92702-3318-4a98-8ccd-bd0482099869",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        -1072
      ],
      "parameters": {
        "width": 416,
        "height": 496,
        "content": "## Semantic Search\n\nIt triggers the workflow to perform semantic search on the documents loaded.\n\n"
      }
    },
    {
      "id": "0afb5bed-1be8-4643-842a-967ca805b113",
      "name": "Text Input",
      "type": "n8n-nodes-base.code",
      "position": [
        -752,
        -800
      ]
    },
    {
      "id": "dc54168a-429d-421b-8bb8-cc0a8b669748",
      "name": "Perform Semantic Search",
      "type": "n8n-nodes-base.oracleDatabase",
      "position": [
        -544,
        -800
      ]
    },
    {
      "id": "3dc37f34-fa98-4a58-b90c-e03b8f199613",
      "name": "Perform Hybrid Search",
      "type": "n8n-nodes-base.oracleDatabase",
      "position": [
        -912,
        -320
      ]
    },
    {
      "id": "85729e6f-db83-4b74-b997-de9f3106995d",
      "name": "Format the result",
      "type": "n8n-nodes-base.code",
      "position": [
        -720,
        -320
      ]
    }
  ],
  "connections": {
    "Text Input": {
      "main": [
        [
          {
            "node": "Perform Semantic Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a user": {
      "main": [
        [
          {
            "node": "ONNX Model Directory path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Hybrid Index": {
      "main": [
        []
      ]
    },
    "Perform Hybrid Search": {
      "main": [
        [
          {
            "node": "Format the result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Documents data": {
      "main": [
        [
          {
            "node": "Add Documents in to table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Perform Semantic Search": {
      "main": [
        []
      ]
    },
    "Grant Privileges to user": {
      "main": [
        [
          {
            "node": "Setup the table, Reload ONNX model and clear old data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Documents in to table": {
      "main": [
        [
          {
            "node": "Create Hybrid Index",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ONNX Model Directory path": {
      "main": [
        [
          {
            "node": "Grant Privileges to user",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Perform Hybrid Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Text Input",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create a user",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Setup the table, Reload ONNX model and clear old data": {
      "main": [
        [
          {
            "node": "Generate Documents data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}