Système RAG vectoriel PDF : Mistral OCR, base de données Weaviate et serveur MCP

Intermédiaire

Ceci est unDocument Extraction, Multimodal AIworkflow d'automatisation du domainecontenant 13 nœuds.Utilise principalement des nœuds comme Set, MistralAi, FormTrigger, McpTrigger, RerankerCohere. Construire un système de recherche PDF avec Mistral OCR et la base de données Weaviate

Prérequis
  • Aucun prérequis spécial, prêt à l'emploi après importation
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "id": "rV1w47cZn1rsk7MP",
  "meta": {
    "instanceId": "402614e91d3374d08756ba129f83d1678d5ada16d0573bfa1398e795ef5f7589",
    "templateCredsSetupCompleted": true
  },
  "name": "PDF to Vector RAG System: Mistral OCR, Weaviate Database and MCP Server",
  "tags": [],
  "nodes": [
    {
      "id": "d9e90589-d6b6-4601-bac8-5009b765fa78",
      "name": "Cohere Embeddings",
      "type": "@n8n/n8n-nodes-langchain.embeddingsCohere",
      "position": [
        160,
        336
      ],
      "parameters": {
        "modelName": "embed-multilingual-v3.0"
      },
      "typeVersion": 1
    },
    {
      "id": "5e7c6668-64a4-4cc2-b519-ab75f07ecab5",
      "name": "Chargeur de documents",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -144,
        336
      ],
      "parameters": {
        "options": {},
        "textSplittingMode": "custom"
      },
      "typeVersion": 1.1
    },
    {
      "id": "b808993d-a6b9-497f-88b5-271c16abc185",
      "name": "Cohere Reranker",
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "position": [
        304,
        336
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "117948ee-4be7-4869-b35b-d0c58a66fcd5",
      "name": "Serveur de connaissances MCP",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        192,
        -80
      ],
      "webhookId": "4f3bebe7-f088-4131-b3ad-c4e300f74517",
      "parameters": {
        "path": "c74c97f5-0197-45e3-b4dd-f3efbd4bab22",
        "authentication": "headerAuth"
      },
      "typeVersion": 2
    },
    {
      "id": "700afe32-2bcc-4f31-a680-cdce710861e2",
      "name": "Rechercher la base de connaissances",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreWeaviate",
      "position": [
        256,
        128
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "useReranker": true,
        "toolDescription": "Use this tool to search and retrieve information from the knowledge base containing various documents and resources",
        "weaviateCollection": {
          "__rl": true,
          "mode": "list",
          "value": "KnowledgeDocuments",
          "cachedResultName": "KnowledgeDocuments"
        },
        "includeDocumentMetadata": false
      },
      "typeVersion": 1.3
    },
    {
      "id": "4075cf1b-e9f6-44cc-b827-29fa5eb1ee97",
      "name": "Instructions de téléchargement",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -16
      ],
      "parameters": {
        "color": 5,
        "width": 688,
        "height": 304,
        "content": "## Manual Document (PDF) Upload Section\nThis section allows users to upload PDF files to the knowledge base. The files will be processed by Mistrals OCR and stored in the vector database for later retrieval and search."
      },
      "typeVersion": 1
    },
    {
      "id": "bf763fa9-03f4-4010-a6a9-63b6bb104fa1",
      "name": "Séparateur de texte",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        -144,
        480
      ],
      "parameters": {
        "options": {
          "splitCode": "markdown"
        },
        "chunkSize": 600,
        "chunkOverlap": 200
      },
      "typeVersion": 1
    },
    {
      "id": "d1fe1c74-d9bc-4040-8446-47e90365c5f7",
      "name": "Télécharger PDF",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -832,
        112
      ],
      "webhookId": "ff827d70-a596-4f81-a99e-63bf42189fd0",
      "parameters": {
        "options": {
          "ignoreBots": true,
          "buttonLabel": "Upload Document",
          "appendAttribution": true
        },
        "formTitle": "Upload Documents to Knowledge Base",
        "formFields": {
          "values": [
            {
              "fieldType": "file",
              "fieldLabel": "PDF File",
              "multipleFiles": false,
              "requiredField": true,
              "acceptFileTypes": ".pdf"
            }
          ]
        },
        "responseMode": "lastNode",
        "formDescription": "Upload PDF files to the knowledge base for AI-powered search and retrieval"
      },
      "typeVersion": 2.2
    },
    {
      "id": "1f04ecce-0277-4a88-9514-fec6b45ba1cf",
      "name": "Extraire le texte du PDF",
      "type": "n8n-nodes-base.mistralAi",
      "position": [
        -608,
        112
      ],
      "parameters": {
        "options": {},
        "binaryProperty": "file"
      },
      "retryOnFail": true,
      "typeVersion": 1
    },
    {
      "id": "53c82051-ce9b-432e-b90e-d5eb83483e49",
      "name": "Préparer les données documentaires",
      "type": "n8n-nodes-base.set",
      "position": [
        -384,
        112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "518ae17b-b486-4438-8151-f49afb3b68eb",
              "name": "filename",
              "type": "string",
              "value": "={{ $('Upload PDF').item.json.file.filename }}"
            },
            {
              "id": "a574ee4d-6341-4fd5-ac8e-9452eff70aa1",
              "name": "content",
              "type": "string",
              "value": "={{ $json.extractedText }}"
            },
            {
              "id": "metadata-source",
              "name": "source",
              "type": "string",
              "value": "uploaded_pdf"
            },
            {
              "id": "metadata-timestamp",
              "name": "upload_timestamp",
              "type": "string",
              "value": "={{ new Date().toISOString() }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d465c50a-87e9-4824-83ca-d5662630590c",
      "name": "Stocker dans la base de données vectorielle",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreWeaviate",
      "position": [
        -112,
        112
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "weaviateCollection": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "5a5e4028-3764-4bb2-8900-df77c0c47bde",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        304
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "height": 288,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Embedding and Rerank\nYou can exchange the models, but you **must** use the same model for embedding and retrieval and **no switching** later on"
      },
      "typeVersion": 1
    },
    {
      "id": "f0ecfbb5-e9ce-49fd-a921-672b12b7ef13",
      "name": "Note adhésive1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        -240
      ],
      "parameters": {
        "width": 336,
        "height": 288,
        "content": "## MCP Server Trigger\nYou can call this MCP Server as a tool in your AI Workflow"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8b3d2e49-d84f-4fca-bdda-298f3da3c15b",
  "connections": {
    "d1fe1c74-d9bc-4040-8446-47e90365c5f7": {
      "main": [
        [
          {
            "node": "1f04ecce-0277-4a88-9514-fec6b45ba1cf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bf763fa9-03f4-4010-a6a9-63b6bb104fa1": {
      "ai_textSplitter": [
        [
          {
            "node": "5e7c6668-64a4-4cc2-b519-ab75f07ecab5",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "b808993d-a6b9-497f-88b5-271c16abc185": {
      "ai_reranker": [
        [
          {
            "node": "700afe32-2bcc-4f31-a680-cdce710861e2",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "5e7c6668-64a4-4cc2-b519-ab75f07ecab5": {
      "ai_document": [
        [
          {
            "node": "d465c50a-87e9-4824-83ca-d5662630590c",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "d9e90589-d6b6-4601-bac8-5009b765fa78": {
      "ai_embedding": [
        [
          {
            "node": "700afe32-2bcc-4f31-a680-cdce710861e2",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "d465c50a-87e9-4824-83ca-d5662630590c",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "1f04ecce-0277-4a88-9514-fec6b45ba1cf": {
      "main": [
        [
          {
            "node": "53c82051-ce9b-432e-b90e-d5eb83483e49",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "53c82051-ce9b-432e-b90e-d5eb83483e49": {
      "main": [
        [
          {
            "node": "d465c50a-87e9-4824-83ca-d5662630590c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "700afe32-2bcc-4f31-a680-cdce710861e2": {
      "ai_tool": [
        [
          {
            "node": "117948ee-4be7-4869-b35b-d0c58a66fcd5",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Intermédiaire - Extraction de documents, IA Multimodale

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Intermédiaire
Nombre de nœuds13
Catégorie2
Types de nœuds10
Description de la difficulté

Adapté aux utilisateurs expérimentés, avec des workflows de complexité moyenne contenant 6-15 nœuds

Auteur
Dietmar

Dietmar

@docd

Medical specialist in internal medicine, gastroenterology, and infectious diseases. Building innovative healthcare automation workflows with n8n, integrating AI, speech-to-text, and medical data standards for efficient clinical documentation and analysis.

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34