Comunidad de la arena de mis agentes

Avanzado

Este es unContent Creation, Multimodal AIflujo de automatización del dominio deautomatización que contiene 41 nodos.Utiliza principalmente nodos como Set, Code, Wait, Filter, Evaluation. Construye un sistema de preguntas y respuestas basado en RAG usando Qdrant, OCR de Mistral y GPT-4

Requisitos previos
  • Credenciales de API de Google Drive
  • Pueden requerirse credenciales de autenticación para la API de destino
  • Clave de API de OpenAI
  • Información de conexión del servidor Qdrant
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "id": "9wQdbEN53X1Q78fl",
  "meta": {
    "instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
    "templateCredsSetupCompleted": true
  },
  "name": "My Agentic Arena Community Contest",
  "tags": [],
  "nodes": [
    {
      "id": "ff9d2c01-8f8b-4e2b-927a-68e73a048a50",
      "name": "Solo si estamos evaluando",
      "type": "n8n-nodes-base.evaluation",
      "position": [
        -176,
        336
      ],
      "parameters": {
        "operation": "checkIfEvaluating"
      },
      "typeVersion": 4.7
    },
    {
      "id": "061e124c-c05a-4d8e-be34-5e3894d5afc9",
      "name": "Entrada de Evaluación",
      "type": "n8n-nodes-base.set",
      "position": [
        -1392,
        320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "91a79047-f1c3-4b16-921e-0c8a45c43320",
              "name": "chatInput",
              "type": "string",
              "value": "={{ $json.question }}"
            },
            {
              "id": "56cb3f48-70b0-4737-b4cd-8563fdd28455",
              "name": "sessionId",
              "type": "string",
              "value": "=pureEval-{{ Math.round(Math.random()*1000) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1b9691ad-a118-4c57-a970-6dae65cf4f6a",
      "name": "Conjunto de Evaluación",
      "type": "n8n-nodes-base.evaluationTrigger",
      "position": [
        -1600,
        320
      ],
      "parameters": {
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "agent answer"
            }
          ]
        },
        "limitRows": true,
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ed0c-Nt4BTETlbwpCA3oTdp7Z_-h1om2tJGasOpPvbo/edit#gid=0",
          "cachedResultName": "Eval"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ed0c-Nt4BTETlbwpCA3oTdp7Z_-h1om2tJGasOpPvbo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ed0c-Nt4BTETlbwpCA3oTdp7Z_-h1om2tJGasOpPvbo/edit?usp=drivesdk",
          "cachedResultName": "Public Agentic Arena Evaluation Set"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "JYR6a64Qecd6t8Hb",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "2f3235df-a66a-4ac2-82b3-38b58985357e",
      "name": "Nota Adhesiva3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        96
      ],
      "parameters": {
        "color": 4,
        "width": 1024,
        "height": 560,
        "content": "## Eval for Correctness"
      },
      "typeVersion": 1
    },
    {
      "id": "aadf0db5-676b-47c0-99ef-12f9b14aaffe",
      "name": "Nota Adhesiva4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        208
      ],
      "parameters": {
        "color": 4,
        "width": 656,
        "height": 288,
        "content": "## Eval Input\n\nCorrect the _Set-Node_ directly to your Agent, once done"
      },
      "typeVersion": 1
    },
    {
      "id": "98e04e20-12dc-4d2b-947f-5dc54ba9abc0",
      "name": "Responder al Chat",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        304,
        512
      ],
      "parameters": {
        "message": "={{ $json.output }}",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "adf0d271-cae7-4aa7-b8fd-e58a3d4fd4af",
      "name": "Filtrar Filas Vacías",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1184,
        320
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "9eab8192-200a-4520-afe9-b13c14cd000c",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.chatInput }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ac63265e-e361-4df3-9a32-4f3aca4d504f",
      "name": "Guardar Evaluación",
      "type": "n8n-nodes-base.evaluation",
      "position": [
        560,
        272
      ],
      "parameters": {
        "outputs": {
          "values": [
            {
              "outputName": "correctness",
              "outputValue": "={{ $json.Correctness }}"
            },
            {
              "outputName": "agent answer",
              "outputValue": "={{ $('AI Agent').item.json.output }}"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1D1P_B70KYuzLXVhSFGd6t19Q2u7msEenvhUqajwLw7k/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ed0c-Nt4BTETlbwpCA3oTdp7Z_-h1om2tJGasOpPvbo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ed0c-Nt4BTETlbwpCA3oTdp7Z_-h1om2tJGasOpPvbo/edit?usp=drivesdk",
          "cachedResultName": "Public Agentic Arena Evaluation Set"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "JYR6a64Qecd6t8Hb",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "baac5f6a-46ab-4207-94c0-cc2445c3a0aa",
      "name": "Ejecutar Evaluación",
      "type": "n8n-nodes-base.evaluation",
      "position": [
        208,
        272
      ],
      "parameters": {
        "prompt": "You are an expert factual evaluator assessing the accuracy of answers compared to established ground truths.\n\nEvaluate the factual correctness of a given output compared to the provided ground truth on a scale from 1 to 5. Use detailed reasoning to thoroughly analyze all claims before determining the final score.\n\n# Scoring Criteria\n\n- 5: Highly similar - The output and ground truth are nearly identical, with only minor, insignificant differences.\n- 4: Somewhat similar - The output is largely similar to the ground truth but has few noticeable differences.\n- 3: Moderately similar - There are some evident differences, but the core essence is captured in the output.\n- 2: Slightly similar - The output only captures a few elements of the ground truth and contains several differences.\n- 1: Not similar - The output is significantly different from the ground truth, with few or no matching elements.\n- 0: Not similar at all – The outpus is completely different from the ground truth or not provided. Like nothings is matching.\n\nEvery correct Citation (ideally exact) inside of the Output that matches the provided ground truth is a strong boost for a good score. Also important: A Citation DOES NOT require to be in square brackets. Correct Text is perfectly fine.\n\n# Evaluation Steps\n\n1. Identify and list the key elements present in both the output and the ground truth.\n2. Compare these key elements to evaluate their similarities and differences, considering both content and structure.\n3. Analyze the semantic meaning conveyed by both the output and the ground truth, noting any significant deviations.\n4. Consider factual accuracy of specific details, including names, dates, numbers, and relationships.\n5. Assess whether the output maintains the factual integrity of the ground truth, even if phrased differently.\n6. Determine the overall level of similarity and accuracy according to the defined criteria.\n7. Check if the Citation of Source is provided and matches the original source of the ground truth.\n\n# Output Format\n\nProvide:\n- A detailed analysis of the comparison (extended reasoning)\n- A one-sentence summary highlighting key differences (not similarities)\n- The final similarity score as an integer (0, 1, 2, 3, 4, or 5)\n\nAlways follow the JSON format below and return nothing else:\n{\n  \"extended_reasoning\": \"<detailed step-by-step analysis of factual accuracy and similarity>\",\n  \"reasoning_summary\": \"<one sentence summary focusing on key differences>\",\n  \"score\": <number: integer from 1 to 5>,\n  \"expected_citation\": \"<exact correct citation of the source like in expected answer>\",\n}\n\n# Examples\n\n**Example 1:**\n\nInput:\n- Output: \"The cat sat on the mat.\"\n- Ground Truth: \"The feline is sitting on the rug.\"\n\nExpected Output:\n{\n  \"extended_reasoning\": \"I need to compare 'The cat sat on the mat' with 'The feline is sitting on the rug.' First, let me identify the key elements: both describe an animal ('cat' vs 'feline') in a position ('sat' vs 'sitting') on a surface ('mat' vs 'rug'). The subject is semantically identical - 'cat' and 'feline' refer to the same animal. The action is also semantically equivalent - 'sat' and 'sitting' both describe the same position, though one is past tense and one is present continuous. The location differs in specific wording ('mat' vs 'rug') but both refer to floor coverings that serve the same function. The basic structure and meaning of both sentences are preserved, though they use different vocabulary and slightly different tense. The core information being conveyed is the same, but there are noticeable wording differences.\",\n  \"reasoning_summary\": \"The sentences differ in vocabulary choice ('cat' vs 'feline', 'mat' vs 'rug') and verb tense ('sat' vs 'is sitting').\",\n  \"score\": 3\n}\n\n**Example 2:**\n\nInput:\n- Output: \"The quick brown fox jumps over the lazy dog.\"\n- Ground Truth: \"A fast brown animal leaps over a sleeping canine.\"\n\nExpected Output:\n{\n  \"extended_reasoning\": \"I need to compare 'The quick brown fox jumps over the lazy dog' with 'A fast brown animal leaps over a sleeping canine.' Starting with the subjects: 'quick brown fox' vs 'fast brown animal'. Both describe the same entity (a fox is a type of animal) with the same attributes (quick/fast and brown). The action is described as 'jumps' vs 'leaps', which are synonymous verbs describing the same motion. The object in both sentences is a dog, described as 'lazy' in one and 'sleeping' in the other, which are related concepts (a sleeping dog could be perceived as lazy). The structure follows the same pattern: subject + action + over + object. The sentences convey the same scene with slightly different word choices that maintain the core meaning. The level of specificity differs slightly ('fox' vs 'animal', 'dog' vs 'canine'), but the underlying information and imagery remain very similar.\",\n  \"reasoning_summary\": \"The sentences use different but synonymous terminology ('quick' vs 'fast', 'jumps' vs 'leaps', 'lazy' vs 'sleeping') and varying levels of specificity ('fox' vs 'animal', 'dog' vs 'canine').\",\n  \"score\": 4\n}\n\n# Notes\n\n- Focus primarily on factual accuracy and semantic similarity, not writing style or phrasing differences.\n- Identify specific differences rather than making general assessments.\n- Pay special attention to dates, numbers, names, locations, and causal relationships when present.\n- Consider the significance of each difference in the context of the overall information.\n- Be consistent in your scoring approach across different evaluations.\n- Value the Citation if correct. False Citation is a negative factor. A missing Citation is strong negative factor.",
        "options": {},
        "operation": "setMetrics",
        "actualAnswer": "={{ $json.output || \"No output provided.\" }}",
        "expectedAnswer": "={{ $('Eval Set').item.json.answer }}"
      },
      "typeVersion": 4.7
    },
    {
      "id": "f9b69d7f-87c5-412e-844f-b198aa7b64d0",
      "name": "Nota Adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        160
      ],
      "parameters": {
        "content": "## Hook up your own GSheet for saving Outputs"
      },
      "typeVersion": 1
    },
    {
      "id": "56ade4de-8554-4a50-9a9c-e0a9f4ad30b0",
      "name": "LLM como Juez",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        576,
        496
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {
          "temperature": 0.1,
          "responseFormat": "json_object"
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "TefveNaDaMERl1hY",
          "name": "OpenAi account (Eure)"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "787c3ae3-8d48-4cb3-8380-0f00a69962ed",
      "name": "Nota Adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        432
      ],
      "parameters": {
        "color": 3,
        "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_"
      },
      "typeVersion": 1
    },
    {
      "id": "c050a45d-7708-4981-8f87-09f97589e2e6",
      "name": "Al hacer clic en 'Ejecutar flujo de trabajo'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1568,
        -1216
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "81da391f-e1a8-4bec-8020-ba452132c46f",
      "name": "Subida Mistral",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -960,
        -912
      ],
      "parameters": {
        "url": "https://api.mistral.ai/v1/files",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "purpose",
              "value": "ocr"
            },
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "nodeCredentialType": "mistralCloudApi"
      },
      "credentials": {
        "mistralCloudApi": {
          "id": "FydnNvrpqnG0B7ee",
          "name": "Mistral Cloud account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1c48b0d2-8256-406f-86cc-c05f3b762117",
      "name": "URL Firmada Mistral",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -640,
        -912
      ],
      "parameters": {
        "url": "=https://api.mistral.ai/v1/files/{{ $json.id }}/url",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "expiry",
              "value": "24"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "mistralCloudApi"
      },
      "credentials": {
        "mistralCloudApi": {
          "id": "FydnNvrpqnG0B7ee",
          "name": "Mistral Cloud account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1868dc23-f486-4ec7-85e4-41ca7a677c7a",
      "name": "OCR de Documento Mistral",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -320,
        -912
      ],
      "parameters": {
        "url": "https://api.mistral.ai/v1/ocr",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"mistral-ocr-latest\",\n  \"document\": {\n    \"type\": \"document_url\",\n    \"document_url\": \"{{ $json.url }}\"\n  },\n  \"include_image_base64\": true\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "mistralCloudApi"
      },
      "credentials": {
        "mistralCloudApi": {
          "id": "FydnNvrpqnG0B7ee",
          "name": "Mistral Cloud account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1795d977-cce8-42aa-a74e-9d8ac80bf5c5",
      "name": "Iterar sobre Elementos",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1552,
        -640
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "1bc2beaf-c0da-41ec-95c4-740ae35cd55d",
      "name": "Actualizar Colección",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1248,
        -1216
      ],
      "parameters": {
        "url": "http://XX.XX.XX:6333/collections/agentic-arena/points/delete",
        "method": "POST",
        "options": {},
        "jsonBody": "{\n  \"filter\": {}\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "qhny6r5ql9wwotpn",
          "name": "Qdrant API (Hetzner)"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "83d76a59-2184-4d36-bb00-eb882c6882eb",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -768,
        -368
      ],
      "parameters": {
        "options": {
          "stripNewLines": false
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "4zwP0MSr8zkNvvV9",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "f2170147-3b23-460c-b9d4-8d5554a8d90c",
      "name": "Cargador de Datos Predeterminado",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -624,
        -400
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "document",
                "value": "={{$('Get PDF').item.binary.data.fileName}}"
              }
            ]
          }
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8c819fbd-daa2-4390-af6e-10665073e0e7",
      "name": "Código",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        -912
      ],
      "parameters": {
        "jsCode": "const data = $json.pages;\n\nreturn data.map(entry => ({\n  json: {\n    markdown: entry.markdown\n  }\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "2f4108c9-9ac2-49e9-b9d1-52db9d50d518",
      "name": "Esperar",
      "type": "n8n-nodes-base.wait",
      "position": [
        -224,
        -624
      ],
      "webhookId": "1000b40d-5dc5-4795-9dd2-8a23653c2b49",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "994ae38c-8f8d-4dfb-9441-a72de0d32d3c",
      "name": "Almacén Vectorial Qdrant",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        -704,
        -624
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "qdrantCollection": {
          "__rl": true,
          "mode": "list",
          "value": "agentic-arena",
          "cachedResultName": "agentic-arena"
        }
      },
      "credentials": {
        "qdrantApi": {
          "id": "iyQ6MQiVaF3VMBmt",
          "name": "QdrantApi account (Hetzner)"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "7304d3bc-929a-4e99-9663-b9e6ccee849d",
      "name": "Iterar sobre Elementos1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -592,
        -1216
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "77330811-3fc7-4cab-b370-c7053b99d613",
      "name": "Cuando se Ejecuta por Otro Flujo de Trabajo",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -1616,
        -912
      ],
      "parameters": {
        "inputSource": "passthrough"
      },
      "typeVersion": 1.1
    },
    {
      "id": "1de75150-f5a5-4eec-82d0-f1cf930babb0",
      "name": "Crear Colección",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1568,
        -1472
      ],
      "parameters": {
        "url": "http://XX.XX.XX:6333/collections/agentic-arena",
        "method": "PUT",
        "options": {},
        "jsonBody": "{\n  \"vectors\": {\n    \"size\": 1536,\n    \"distance\": \"Cosine\"  \n  },\n  \"shard_number\": 1,  \n  \"replication_factor\": 1,  \n  \"write_consistency_factor\": 1 \n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "qhny6r5ql9wwotpn",
          "name": "Qdrant API (Hetzner)"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "46919cd2-4558-413e-8676-6dfc85b060fe",
      "name": "Establecer Página",
      "type": "n8n-nodes-base.set",
      "position": [
        -1088,
        -624
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "189f4944-a692-423c-bc6d-76747e1d04df",
              "name": "text",
              "type": "string",
              "value": "={{ $json.markdown }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "fbfdd7d6-f648-4460-b645-7f98228eb57d",
      "name": "Buscar PDFs",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -896,
        -1216
      ],
      "parameters": {
        "filter": {
          "folderId": {
            "__rl": true,
            "mode": "list",
            "value": "1dbVllHyJvJqJs2P5lTzvhqP8NNCrqwVp",
            "cachedResultUrl": "https://drive.google.com/drive/folders/1dbVllHyJvJqJs2P5lTzvhqP8NNCrqwVp",
            "cachedResultName": "Agentic Arena"
          },
          "whatToSearch": "files"
        },
        "options": {},
        "resource": "fileFolder",
        "returnAll": true
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "HEy5EuZkgPZVEa9w",
          "name": "Google Drive account (n3w.it)"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "0a35360d-17a7-4095-a93b-0c0ca6efa754",
      "name": "Obtener PDF",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1312,
        -912
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.file_id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "HEy5EuZkgPZVEa9w",
          "name": "Google Drive account (n3w.it)"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "6f6ee381-0c36-4c59-823e-a7bb522ccc70",
      "name": "Separador de Texto por Carácter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
      "position": [
        -608,
        -192
      ],
      "parameters": {
        "separator": "#",
        "chunkOverlap": 100
      },
      "typeVersion": 1
    },
    {
      "id": "003c9ac1-c683-4b5d-9a43-dbdaca687b37",
      "name": "Agente de IA",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -880,
        336
      ],
      "parameters": {
        "text": "={{ $json.chatInput }}",
        "options": {
          "systemMessage": "=You are a Ministry of Finance (MoF) policy compliance assistant specialized in permit applications and regulatory analysis. Your role is to evaluate permit applications against established MoF policies and provide accurate determinations.\n\n**CORE INSTRUCTIONS:**\n1. **Always use the RAG tool** for each request to retrieve relevant policy information\n2. **Never invent or fabricate information** - only use verified policy data\n3. **Respond in English** with clear and professional language\n4. **Provide definitive determinations** - start with \"Yes\" or \"No\" followed by specific reasoning\n\n**RESPONSE STRUCTURE:**\n- **Opening determination:** Clear Yes/No or specific outcome statement\n- **Reasoning:** Concise explanation referencing specific policy requirements\n- **Citations:** Always include citations in format: Citation: [MoF Policy ###: Policy Name]\n\n**KEY ANALYSIS AREAS:**\n- Zone requirements and submission timelines\n- Payment timing (minimum 7 days before activation)\n- Entity type eligibility (nonprofit vs. for-profit restrictions)\n- Officer conflict of interest rules\n- Emergency processing classifications\n- Seasonal adjustment requirements\n- Fee calculations and waiver eligibility\n\n**EXAMPLE RESPONSE FORMAT:**\n```\nYes/No—[specific violation]. [Timeline/requirement details], [consequences].\n\nCitation: [MoF Policy ###: Policy Name, MoF Policy ###: Policy Name]\n```\n\n**QUALITY STANDARDS:**\n- Be precise with dates, timelines, and calculations\n- Identify ALL applicable violations in complex cases\n- Reference multiple policies when relevant\n- Maintain professional, authoritative tone\n- Ensure legal accuracy and compliance\n\nAlways cross-reference multiple policies when evaluating complex scenarios involving multiple potential violations."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "8d8a79c6-0055-4829-89f7-08b98399c157",
      "name": "Memoria Simple",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -768,
        528
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "7e2250c0-a209-4c51-b87e-73193dc192d8",
      "name": "Reclasificador Cohere",
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "position": [
        -512,
        704
      ],
      "parameters": {},
      "credentials": {
        "cohereApi": {
          "id": "abTpzDTZs5Bvhxjp",
          "name": "CohereApi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b89afe71-728c-497c-8f07-7c8ace131607",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -672,
        704
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "TefveNaDaMERl1hY",
          "name": "OpenAi account (Eure)"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "22f8a99c-77a1-4708-b086-b75723d82031",
      "name": "RAG",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        -640,
        528
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "useReranker": true,
        "toolDescription": "Search the RAG for questions you are asked\n",
        "qdrantCollection": {
          "__rl": true,
          "mode": "list",
          "value": "agentic-arena",
          "cachedResultName": "agentic-arena"
        }
      },
      "credentials": {
        "qdrantApi": {
          "id": "iyQ6MQiVaF3VMBmt",
          "name": "QdrantApi account (Hetzner)"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "f0aec6e7-a4b4-43a6-a15b-890712c59703",
      "name": "Llamar a 'Arena de Agentes'",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        32,
        -1200
      ],
      "parameters": {
        "mode": "each",
        "options": {
          "waitForSubWorkflow": true
        },
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "9wQdbEN53X1Q78fl"
        },
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c49b7933-592a-4cb7-86f5-fcba33269e4d",
      "name": "Modelo de Chat OpenAI",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -928,
        528
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {
          "temperature": 0.1
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "TefveNaDaMERl1hY",
          "name": "OpenAi account (Eure)"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "315b9054-8eb6-48b7-a6b5-97663e5059f5",
      "name": "Nota Adhesiva5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1664,
        -2752
      ],
      "parameters": {
        "color": 3,
        "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 PDF knowledge base. \n\n## What You're Building\n\nYou'll create an n8n workflow that:\n\n- Ingests PDF documents into a vector database or knowledge retrieval system\n- Processes natural language questions about the content\n- Returns accurate answers based solely on the provided documentation with proper citations\n- Demonstrates high accuracy when tested against our evaluation questions\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "35156e25-624e-47cc-9d2d-48e4a335b970",
      "name": "Nota Adhesiva6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1664,
        -2288
      ],
      "parameters": {
        "color": 5,
        "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 from your own system\n\n### 2. Evaluation Set\n- Find the Google Sheet with the [evaluation set here](https://docs.google.com/spreadsheets/d/1cgZzr0-D5Kpd6HrKowyoN_fI2dY0dkP9Ljljxix0AlI/edit?usp=sharing).\n- Copy the Sheet to use it in your workflow\n\n### 3. Starter Workflow\n- [Download this starter workflow](https://file.notion.so/f/f/d147bfac-0bab-4c58-884f-f45c5f5a13e8/7f8419b8-7ac3-4c55-8c5c-e0874aa7a46f/AgenticArena_Challenge1_StarterWorkflow.json?table=block&id=2685b6e0-c94f-809b-905c-cf39f05e0e0f&spaceId=d147bfac-0bab-4c58-884f-f45c5f5a13e8&expirationTimestamp=1758902400000&signature=C3ERsAdCUDcvYkODZBR5LZLxx9q4_2Nk1XEqjgOQNOY&downloadName=AgenticArena_Challenge1_StarterWorkflow.json) and import into your n8n instance "
      },
      "typeVersion": 1
    },
    {
      "id": "4ca9e2fe-fa70-4f5e-b694-5e0c2c0d08fd",
      "name": "Nota Adhesiva7",
      "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 the PDF documents from Google Drive\n\n3. **Convert PDF documents using Mistral OCR** - Process the PDF files through Mistral's OCR (Optical Character Recognition) system to extract text\n\n4. **Embed documents in Qdrant Vector Store** - Generate embeddings for the extracted content and store them in the Qdrant vector database\n\n5. **Set up Evaluation Workflow with AI Agent** - Configure an evaluation workflow that includes:\n   - AI Agent integration\n   - Connection to Qdrant vector database\n   - Cohere reranker implementation\n   - GPT-4.1 model (or GPT-4o/GPT-4 Turbo, depending on the actual model being used)\n\n6. **Save output to Google Sheets** - Export and store the results in a [Google Sheets document](https://docs.google.com/spreadsheets/d/1ed0c-Nt4BTETlbwpCA3oTdp7Z_-h1om2tJGasOpPvbo/edit?usp=sharing)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "fc396562-d642-46d9-a287-8357bf79b59f",
      "name": "Obtener ID de Archivo",
      "type": "n8n-nodes-base.set",
      "position": [
        -272,
        -1200
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ca7c30f2-444d-4551-988d-0f513e5ee4b1",
              "name": "file_id",
              "type": "string",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d7715ff3-8833-4b10-862e-0eb02f65c2ff",
  "connections": {
    "22f8a99c-77a1-4708-b086-b75723d82031": {
      "ai_tool": [
        [
          {
            "node": "003c9ac1-c683-4b5d-9a43-dbdaca687b37",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "8c819fbd-daa2-4390-af6e-10665073e0e7": {
      "main": [
        [
          {
            "node": "1795d977-cce8-42aa-a74e-9d8ac80bf5c5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2f4108c9-9ac2-49e9-b9d1-52db9d50d518": {
      "main": [
        [
          {
            "node": "1795d977-cce8-42aa-a74e-9d8ac80bf5c5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0a35360d-17a7-4095-a93b-0c0ca6efa754": {
      "main": [
        [
          {
            "node": "81da391f-e1a8-4bec-8020-ba452132c46f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "003c9ac1-c683-4b5d-9a43-dbdaca687b37": {
      "main": [
        [
          {
            "node": "ff9d2c01-8f8b-4e2b-927a-68e73a048a50",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1b9691ad-a118-4c57-a970-6dae65cf4f6a": {
      "main": [
        [
          {
            "node": "061e124c-c05a-4d8e-be34-5e3894d5afc9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "46919cd2-4558-413e-8676-6dfc85b060fe": {
      "main": [
        [
          {
            "node": "994ae38c-8f8d-4dfb-9441-a72de0d32d3c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "061e124c-c05a-4d8e-be34-5e3894d5afc9": {
      "main": [
        [
          {
            "node": "adf0d271-cae7-4aa7-b8fd-e58a3d4fd4af",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fc396562-d642-46d9-a287-8357bf79b59f": {
      "main": [
        [
          {
            "node": "f0aec6e7-a4b4-43a6-a15b-890712c59703",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fbfdd7d6-f648-4460-b645-7f98228eb57d": {
      "main": [
        [
          {
            "node": "7304d3bc-929a-4e99-9663-b9e6ccee849d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8d8a79c6-0055-4829-89f7-08b98399c157": {
      "ai_memory": [
        [
          {
            "node": "003c9ac1-c683-4b5d-9a43-dbdaca687b37",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "56ade4de-8554-4a50-9a9c-e0a9f4ad30b0": {
      "ai_languageModel": [
        [
          {
            "node": "baac5f6a-46ab-4207-94c0-cc2445c3a0aa",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "81da391f-e1a8-4bec-8020-ba452132c46f": {
      "main": [
        [
          {
            "node": "1c48b0d2-8256-406f-86cc-c05f3b762117",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "baac5f6a-46ab-4207-94c0-cc2445c3a0aa": {
      "main": [
        [
          {
            "node": "ac63265e-e361-4df3-9a32-4f3aca4d504f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1795d977-cce8-42aa-a74e-9d8ac80bf5c5": {
      "main": [
        [],
        [
          {
            "node": "46919cd2-4558-413e-8676-6dfc85b060fe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1868dc23-f486-4ec7-85e4-41ca7a677c7a": {
      "main": [
        [
          {
            "node": "8c819fbd-daa2-4390-af6e-10665073e0e7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7e2250c0-a209-4c51-b87e-73193dc192d8": {
      "ai_reranker": [
        [
          {
            "node": "22f8a99c-77a1-4708-b086-b75723d82031",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "7304d3bc-929a-4e99-9663-b9e6ccee849d": {
      "main": [
        [],
        [
          {
            "node": "fc396562-d642-46d9-a287-8357bf79b59f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "83d76a59-2184-4d36-bb00-eb882c6882eb": {
      "ai_embedding": [
        [
          {
            "node": "994ae38c-8f8d-4dfb-9441-a72de0d32d3c",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "adf0d271-cae7-4aa7-b8fd-e58a3d4fd4af": {
      "main": [
        [
          {
            "node": "003c9ac1-c683-4b5d-9a43-dbdaca687b37",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c49b7933-592a-4cb7-86f5-fcba33269e4d": {
      "ai_languageModel": [
        [
          {
            "node": "003c9ac1-c683-4b5d-9a43-dbdaca687b37",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "f0aec6e7-a4b4-43a6-a15b-890712c59703": {
      "main": [
        [
          {
            "node": "7304d3bc-929a-4e99-9663-b9e6ccee849d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b89afe71-728c-497c-8f07-7c8ace131607": {
      "ai_embedding": [
        [
          {
            "node": "22f8a99c-77a1-4708-b086-b75723d82031",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "1c48b0d2-8256-406f-86cc-c05f3b762117": {
      "main": [
        [
          {
            "node": "1868dc23-f486-4ec7-85e4-41ca7a677c7a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1bc2beaf-c0da-41ec-95c4-740ae35cd55d": {
      "main": [
        [
          {
            "node": "fbfdd7d6-f648-4460-b645-7f98228eb57d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f2170147-3b23-460c-b9d4-8d5554a8d90c": {
      "ai_document": [
        [
          {
            "node": "994ae38c-8f8d-4dfb-9441-a72de0d32d3c",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "994ae38c-8f8d-4dfb-9441-a72de0d32d3c": {
      "main": [
        [
          {
            "node": "2f4108c9-9ac2-49e9-b9d1-52db9d50d518",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6f6ee381-0c36-4c59-823e-a7bb522ccc70": {
      "ai_textSplitter": [
        [
          {
            "node": "f2170147-3b23-460c-b9d4-8d5554a8d90c",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "ff9d2c01-8f8b-4e2b-927a-68e73a048a50": {
      "main": [
        [
          {
            "node": "baac5f6a-46ab-4207-94c0-cc2445c3a0aa",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "98e04e20-12dc-4d2b-947f-5dc54ba9abc0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "77330811-3fc7-4cab-b370-c7053b99d613": {
      "main": [
        [
          {
            "node": "0a35360d-17a7-4095-a93b-0c0ca6efa754",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c050a45d-7708-4981-8f87-09f97589e2e6": {
      "main": [
        [
          {
            "node": "1bc2beaf-c0da-41ec-95c4-740ae35cd55d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Avanzado - Creación de contenido, IA Multimodal

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos41
Categoría2
Tipos de nodos22
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Autor

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at info@n3w.it or add me on Linkedin.com/in/davideboizza

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34