AutomationFlowsAI & RAG › RAG AI Agent with Ollama

RAG AI Agent with Ollama

Original n8n title: RAG Agent

RAG Agent. Uses vectorStoreInMemory, documentDefaultDataLoader, agent, lmChatOllama. Webhook trigger; 11 nodes.

Webhook trigger★★★☆☆ complexityAI-powered11 nodesIn-Memory Vector StoreDocument Default Data LoaderAgentOllama ChatOllama EmbeddingsMemory Buffer Window
AI & RAG Trigger: Webhook Nodes: 11 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow follows the Agent → Documentdefaultdataloader recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "RAG Agent",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        60,
        80
      ],
      "id": "13e510a4-9b68-4aa9-9722-cd4641563274",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "mode": "insert",
        "qdrantCollection": {
          "__rl": true,
          "value": "support",
          "mode": "id"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.2,
      "position": [
        300,
        80
      ],
      "id": "8b8603dd-3210-4a0b-9fc0-5301f7c3df05",
      "name": "Qdrant Vector Store",
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsonMode": "expressionData",
        "jsonData": "={{ $json.content }}",
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "title",
                "value": "={{ $json.title }}"
              },
              {
                "name": "content",
                "value": "={{ $json.content }}"
              }
            ]
          }
        }
      },
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1,
      "position": [
        200,
        320
      ],
      "id": "1362e35e-9b76-46b8-b869-dcee69151525",
      "name": "Default Data Loader"
    },
    {
      "parameters": {
        "content": "## Populate Qdrant Collection",
        "height": 660,
        "width": 700,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "daeb5cf8-6289-400c-a533-97c2c08b617e",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "You are a support agent for an online shop.  Only use the information available in the tools provided. Do not use any other information and if asked for information not available in these tools, inform the user that you cannot help them further and that they should send an email to support@shop.com."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        1200,
        80
      ],
      "id": "1c4cfaf6-b373-4685-952c-14f7a499e101",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        1020,
        80
      ],
      "id": "1eede6bd-b220-487f-9406-65a73bcee79b",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "content": "## Chat with RAG Agent using data from Qdrant Collection",
        "height": 660,
        "width": 660,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        940,
        0
      ],
      "id": "6e71f4d7-da19-4f68-b0f0-a3fe542a4640",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "support",
        "toolDescription": "Call this tool to get data from the support database",
        "qdrantCollection": {
          "__rl": true,
          "value": "support",
          "mode": "list",
          "cachedResultName": "support"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.2,
      "position": [
        1320,
        320
      ],
      "id": "9d0b0a4b-9f96-4fe9-9e3c-91727330461f",
      "name": "Qdrant Vector Store2",
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        220,
        500
      ],
      "id": "bcb11236-fcc7-4d8b-8bce-de0cbd097ffc",
      "name": "Recursive Character Text Splitter"
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        1180,
        320
      ],
      "id": "30683d51-8246-411e-9a7a-f01baacac1a3",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "llama3.2:latest",
          "mode": "list",
          "cachedResultName": "llama3.2:latest"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        1000,
        320
      ],
      "id": "06206fa9-3fce-4a94-a235-241a9320b937",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": "nomic-embed-text:latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        780,
        540
      ],
      "id": "1e4284ab-c554-4b35-bcf0-8a9348b45a50",
      "name": "Embeddings OpenAI",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store2": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store2",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6a1ae594-7c4b-4b36-8448-8ac6e9c67075",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "I33agLmP5dzRpzod",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

RAG Agent. Uses vectorStoreInMemory, documentDefaultDataLoader, agent, lmChatOllama. Webhook trigger; 11 nodes.

Source: https://github.com/decimozs/vantage-cv/blob/3e16760fe79f85a96d716afa96ecae827e6a7980/n8n/vantage-cv.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This comprehensive n8n workflow template creates an intelligent AI chatbot that automatically transforms your Google Drive documents into a searchable knowledge base. The chatbot uses OpenAI's GPT mod

Text Splitter Recursive Character Text Splitter, Document Default Data Loader, In-Memory Vector Store +8
AI & RAG

An on-premises, domain-specific AI assistant for Kaggle (tested on binary disaster-tweet classification), combining LLM, an n8n workflow engine, and Qdrant-backed Retrieval-Augmented Generation (RAG).

Local File Trigger, Document Default Data Loader, Text Splitter Recursive Character Text Splitter +10
AI & RAG

This workflow automates compliance validation between a policy/procedure and a corresponding uploaded document. It leverages an AI agent to determine whether the content of the document aligns with th

HTTP Request, Ollama Embeddings, Qdrant Vector Store +5
AI & RAG

RAG AI Agent. Uses lmChatOpenAi, memoryBufferWindow, googleDrive, documentDefaultDataLoader. Webhook trigger; 20 nodes.

OpenAI Chat, Memory Buffer Window, Google Drive +8
AI & RAG

2Chat Chatbot. Uses agent, memoryBufferWindow, formTrigger, vectorStoreInMemory. Webhook trigger; 16 nodes.

Agent, Memory Buffer Window, Form Trigger +6