{
  "name": "My solution for the \"Agentic Arena Community Contest\" (RAG, Qdrant, Mistral OCR)",
  "nodes": [
    {
      "id": "ff9d2c01-8f8b-4e2b-927a-68e73a048a50",
      "name": "Only if we are evaluating",
      "type": "n8n-nodes-base.evaluation",
      "position": [
        -176,
        336
      ]
    },
    {
      "id": "061e124c-c05a-4d8e-be34-5e3894d5afc9",
      "name": "Eval Input",
      "type": "n8n-nodes-base.set",
      "position": [
        -1392,
        320
      ]
    },
    {
      "id": "1b9691ad-a118-4c57-a970-6dae65cf4f6a",
      "name": "Eval Set",
      "type": "n8n-nodes-base.evaluationTrigger",
      "position": [
        -1600,
        320
      ]
    },
    {
      "id": "2f3235df-a66a-4ac2-82b3-38b58985357e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        96
      ],
      "parameters": {
        "width": 1024,
        "height": 560,
        "content": "## Eval for Correctness"
      }
    },
    {
      "id": "aadf0db5-676b-47c0-99ef-12f9b14aaffe",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        208
      ],
      "parameters": {
        "width": 656,
        "height": 288,
        "content": "## Eval Input\n\nCorrect the _Set-Node_ directly to your Agent, once done"
      }
    },
    {
      "id": "98e04e20-12dc-4d2b-947f-5dc54ba9abc0",
      "name": "Respond to Chat",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        304,
        512
      ]
    },
    {
      "id": "adf0d271-cae7-4aa7-b8fd-e58a3d4fd4af",
      "name": "Filter Empty Rows",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1184,
        320
      ]
    },
    {
      "id": "ac63265e-e361-4df3-9a32-4f3aca4d504f",
      "name": "Save Eval",
      "type": "n8n-nodes-base.evaluation",
      "position": [
        560,
        272
      ]
    },
    {
      "id": "baac5f6a-46ab-4207-94c0-cc2445c3a0aa",
      "name": "Run Evaluation",
      "type": "n8n-nodes-base.evaluation",
      "position": [
        208,
        272
      ]
    },
    {
      "id": "f9b69d7f-87c5-412e-844f-b198aa7b64d0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        160
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "## Hook up your own GSheet for saving Outputs"
      }
    },
    {
      "id": "56ade4de-8554-4a50-9a9c-e0a9f4ad30b0",
      "name": "LLM as a Judge",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        576,
        496
      ]
    },
    {
      "id": "787c3ae3-8d48-4cb3-8380-0f00a69962ed",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        432
      ],
      "parameters": {
        "width": null,
        "height": 224,
        "content": "## Do not touch this!\n\n![I see you](https://cloud.let-the-work-flow.com/workflow-data/eval-emoji-72.png)\nSincerely,\n_Pure Eval_"
      }
    },
    {
      "id": "c050a45d-7708-4981-8f87-09f97589e2e6",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1568,
        -1216
      ]
    },
    {
      "id": "81da391f-e1a8-4bec-8020-ba452132c46f",
      "name": "Mistral Upload",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -960,
        -912
      ]
    },
    {
      "id": "1c48b0d2-8256-406f-86cc-c05f3b762117",
      "name": "Mistral Signed URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -640,
        -912
      ]
    },
    {
      "id": "1868dc23-f486-4ec7-85e4-41ca7a677c7a",
      "name": "Mistral DOC OCR",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -320,
        -912
      ]
    },
    {
      "id": "1795d977-cce8-42aa-a74e-9d8ac80bf5c5",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1552,
        -640
      ]
    },
    {
      "id": "1bc2beaf-c0da-41ec-95c4-740ae35cd55d",
      "name": "Refresh collection",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1248,
        -1216
      ]
    },
    {
      "id": "83d76a59-2184-4d36-bb00-eb882c6882eb",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -768,
        -368
      ]
    },
    {
      "id": "f2170147-3b23-460c-b9d4-8d5554a8d90c",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -624,
        -400
      ]
    },
    {
      "id": "8c819fbd-daa2-4390-af6e-10665073e0e7",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        -912
      ]
    },
    {
      "id": "2f4108c9-9ac2-49e9-b9d1-52db9d50d518",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -224,
        -624
      ]
    },
    {
      "id": "994ae38c-8f8d-4dfb-9441-a72de0d32d3c",
      "name": "Qdrant Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        -704,
        -624
      ]
    },
    {
      "id": "7304d3bc-929a-4e99-9663-b9e6ccee849d",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -592,
        -1216
      ]
    },
    {
      "id": "77330811-3fc7-4cab-b370-c7053b99d613",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -1616,
        -912
      ]
    },
    {
      "id": "1de75150-f5a5-4eec-82d0-f1cf930babb0",
      "name": "Create collection",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1568,
        -1472
      ]
    },
    {
      "id": "46919cd2-4558-413e-8676-6dfc85b060fe",
      "name": "Set page",
      "type": "n8n-nodes-base.set",
      "position": [
        -1088,
        -624
      ]
    },
    {
      "id": "fbfdd7d6-f648-4460-b645-7f98228eb57d",
      "name": "Search PDFs",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -896,
        -1216
      ]
    },
    {
      "id": "0a35360d-17a7-4095-a93b-0c0ca6efa754",
      "name": "Get PDF",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1312,
        -912
      ]
    },
    {
      "id": "6f6ee381-0c36-4c59-823e-a7bb522ccc70",
      "name": "Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
      "position": [
        -608,
        -192
      ]
    },
    {
      "id": "003c9ac1-c683-4b5d-9a43-dbdaca687b37",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -880,
        336
      ]
    },
    {
      "id": "8d8a79c6-0055-4829-89f7-08b98399c157",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -768,
        528
      ]
    },
    {
      "id": "7e2250c0-a209-4c51-b87e-73193dc192d8",
      "name": "Reranker Cohere",
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "position": [
        -512,
        704
      ]
    },
    {
      "id": "b89afe71-728c-497c-8f07-7c8ace131607",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -672,
        704
      ]
    },
    {
      "id": "22f8a99c-77a1-4708-b086-b75723d82031",
      "name": "RAG",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        -640,
        528
      ]
    },
    {
      "id": "f0aec6e7-a4b4-43a6-a15b-890712c59703",
      "name": "Call 'Agent Arena'",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        32,
        -1200
      ]
    },
    {
      "id": "c49b7933-592a-4cb7-86f5-fcba33269e4d",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -928,
        528
      ]
    },
    {
      "id": "315b9054-8eb6-48b7-a6b5-97663e5059f5",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1664,
        -2752
      ],
      "parameters": {
        "width": 1904,
        "height": 432,
        "content": "# Agentic Arena Community Contest\n\n## Overview\n\nThis competition challenges you to build a Retrieval-Augmented Generation (RAG) AI agent in n8n that can accurately answer questions based on a provided"
      }
    },
    {
      "id": "35156e25-624e-47cc-9d2d-48e4a335b970",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1664,
        -2288
      ],
      "parameters": {
        "width": 1904,
        "height": 352,
        "content": "\n## Rules\n\n### 1. PDF Knowledge Base\n- Find a folder with the [PDF files here](https://drive.google.com/drive/folders/1FqVwbNrAPn2dHhIwSEtlu5kl3z2jEC0U?usp=sharing).\n- Copy or download them for use fr"
      }
    },
    {
      "id": "4ca9e2fe-fa70-4f5e-b694-5e0c2c0d08fd",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1664,
        -1888
      ],
      "parameters": {
        "width": 1904,
        "height": 1856,
        "content": "## My Solution\n\n1. **Create a collection on Qdrant** (Self-hosted) - Set up a new vector collection in Qdrant for storing embeddings\n\n2. **Retrieve PDF files from Google Drive** - Download or access t"
      }
    },
    {
      "id": "fc396562-d642-46d9-a287-8357bf79b59f",
      "name": "Get File ID",
      "type": "n8n-nodes-base.set",
      "position": [
        -272,
        -1200
      ]
    }
  ],
  "connections": {
    "RAG": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get PDF": {
      "main": [
        [
          {
            "node": "Mistral Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Only if we are evaluating",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Eval Set": {
      "main": [
        [
          {
            "node": "Eval Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set page": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Eval Input": {
      "main": [
        [
          {
            "node": "Filter Empty Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File ID": {
      "main": [
        [
          {
            "node": "Call 'Agent Arena'",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search PDFs": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "LLM as a Judge": {
      "ai_languageModel": [
        [
          {
            "node": "Run Evaluation",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Upload": {
      "main": [
        [
          {
            "node": "Mistral Signed URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Evaluation": {
      "main": [
        [
          {
            "node": "Save Eval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Set page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mistral DOC OCR": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reranker Cohere": {
      "ai_reranker": [
        [
          {
            "node": "RAG",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [],
        [
          {
            "node": "Get File ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Filter Empty Rows": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Call 'Agent Arena'": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "RAG",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Signed URL": {
      "main": [
        [
          {
            "node": "Mistral DOC OCR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Refresh collection": {
      "main": [
        [
          {
            "node": "Search PDFs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Only if we are evaluating": {
      "main": [
        [
          {
            "node": "Run Evaluation",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond to Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Get PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Refresh collection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}