Skip to main content

My solution for the "Agentic Arena Community Contest" (RAG, Qdrant, Mistral OCR)

Workflow preview

Workflow preview
100%
My solution for the "Agentic Arena Community Contest" (RAG, Qdrant, Mistral OCR) preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow is my personal solution for the Agentic Arena Community Contest , where the goal is to build a Retrieval Augmented Generation (RAG) AI agent capable of answering questions based ...

Best for

  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.evaluation, n8n-nodes-base.set, n8n-nodes-base.evaluationtrigger, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.chat, n8n-nodes-base.filter, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.manualtrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Davide.

Original n8n.io source

1.1 Workflow description

Title
My solution for the "Agentic Arena Community Contest" (RAG, Qdrant, Mistral OCR)
Workflow name
My solution for the "Agentic Arena Community Contest" (RAG, Qdrant, Mistral OCR)

πŸ€–πŸ“ˆ This workflow is my personal solution for the Agentic Arena Community Contest, where the goal is to build a Retrieval-Augmented Generation (RAG) AI agent capable of answering questions based on a provided PDF knowledge base.


Key Advantages

  • βœ… End-to-End RAG Implementation Fully automates the ingestion, processing, and retrieval of knowledge from PDFs into a vector database.

  • βœ… Accuracy through Multi-Layered Retrieval Combines embeddings, Qdrant search, and Cohere reranking to ensure the agent retrieves the most relevant policy information.

  • βœ… Robust Evaluation System Includes an automated correctness evaluation pipeline powered by GPT-4.1 as a judge, ensuring transparent scoring and continuous improvement.

  • βœ… Citation-Driven Compliance The AI agent is instructed to provide citations for every answer, making it suitable for high-stakes use cases like policy compliance.

  • βœ… Scalability and Modularity Can easily integrate with different data sources (Google Drive, APIs, other storage systems) and be extended to new use cases.

  • βœ… Seamless Collaboration with Google Sheets Both the evaluation set and the results are integrated with Google Sheets, enabling easy monitoring, iteration, and reporting.

  • βœ… Cloud and Self-Hosted Flexibility Works with self-hosted Qdrant on Hetzner, Mistral Cloud for OCR, and OpenAI/Cohere APIs, combining local control with powerful cloud AI services.


How it Works

  1. Knowledge Base Ingestion (The "Setup" Execution):

    • When started manually, the workflow first clears an existing Qdrant vector database collection.
    • It then searches a specified Google Drive folder for PDF files. For each PDF found, it performs the following steps:
      • Uploads the file to the Mistral AI API.
      • Processes the PDF using Mistral's OCR service to extract text and convert it into a structured markdown format.
      • Splits the text into manageable chunks.
      • Generates embeddings for each text chunk using OpenAI's model.
      • Stores the embeddings in the Qdrant vector store, creating a searchable knowledge base.
  2. Agent Evaluation (The "Testing" Execution):

    • The workflow is triggered by an evaluation Google Sheet containing questions and correct answers.
    • For each question, the core AI Agent is activated. This agent:
      • Uses the RAG tool to search the pre-populated Qdrant vector store for relevant information from the PDFs.
      • Employs a Cohere reranker to refine the search results for the highest quality context.
      • Leverages a GPT-4.1 model to generate an answer based strictly on the retrieved context.
    • The agent's answer is then passed to an "LLM as a Judge" (another GPT-4.1 instance), which compares it to the ground truth answer from the evaluation sheet.
    • The judge provides a detailed score (1-5) based on factual correctness and citation accuracy.
    • Finally, both the agent's answer and the correctness score are saved back to a Google Sheet for review.

Set up Steps

To implement this solution, you need to configure the following components and credentials:

  1. Configure Core AI Services:

    • OpenAI API Credentials: Required for the main AI agent, the judge LLM, and generating embeddings.
    • Mistral AI API Credentials: Necessary for the OCR service that processes PDF files.
    • Cohere API Credentials: Used for the reranker node that improves retrieval quality.
    • Google Service Accounts: Set up OAuth for Google Sheets (to read questions and save results) and Google Drive (to access the PDF source files).
  2. Set up the Vector Database (Qdrant):

    • This workflow uses a self-hosted Qdrant instance. You must deploy and configure your own Qdrant server.
    • Update the Qdrant Vector Store and RAG nodes with the correct API endpoint URL and credentials for your Qdrant instance.
    • Ensure the collection name (agentic-arena) is created or matches your setup.
  3. Connect Data Sources:

    • PDF Source: In the "Search PDFs" node, update the folderId parameter to point to your own Google Drive folder containing the contest PDFs.
    • Evaluation Sheet: In the "Eval Set" node, update the documentId to point to your own copy of the evaluation Google Sheet containing the test questions and answers.
    • Results Sheet: In the "Save Eval" node, update the documentId to point to the Google Sheet where you want to save the evaluation results.

Need help customizing?

Contact me for consulting and support or add me on Linkedin.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Only if we are evaluating

Type / Role
n8n-nodes-base.evaluation - evaluation
Config choices
Version 4.7

Block 2 - Eval Input

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Eval Set

Type / Role
n8n-nodes-base.evaluationTrigger - evaluationTrigger
Config choices
Version 4.6

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Respond to Chat

Type / Role
@n8n/n8n-nodes-langchain.chat - chat
Config choices
Version 1

Block 7 - Filter Empty Rows

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 8 - Save Eval

Type / Role
n8n-nodes-base.evaluation - evaluation
Config choices
Version 4.7

Block 9 - Run Evaluation

Type / Role
n8n-nodes-base.evaluation - evaluation
Config choices
Version 4.7

Block 10 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - LLM as a Judge

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 12 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - When clicking β€˜Execute workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 14 - Mistral Upload

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 15 - Mistral Signed URL

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 16 - Mistral DOC OCR

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 17 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 18 - Refresh collection

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 19 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.1

Block 20 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 21 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 22 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 23 - Qdrant Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreQdrant - vectorStoreQdrant
Config choices
Version 1.1

Block 24 - Loop Over Items1

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Showing the first 24 of 41 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow My solution for the "Agentic Arena Community Contest" (RAG, Qdrant, Mistral OCR)
Complexity advanced
Nodes 41
Categories AI RAG
Author Davide
Published 26 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8944/8944.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does My solution for the "Agentic Arena Community Contest" (RAG, Qdrant, Mistral OCR) do?

This workflow is my personal solution for the Agentic Arena Community Contest , where the goal is to build a Retrieval Augmented Generation (RAG) AI agent capable of answering questions based ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your AI RAG use case.