{
  "name": "Implement on-prem RAG with Qdrant and Ollama for a self-hosted KB",
  "nodes": [
    {
      "id": "80b20667-49e6-4d2a-9e0a-aa159ff701da",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        112,
        96
      ]
    },
    {
      "id": "02ffa064-6225-41ab-8952-6e2ca52f3a0f",
      "name": "Embeddings Ollama",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOllama",
      "position": [
        352,
        560
      ]
    },
    {
      "id": "c45b9793-b55c-43e1-8b48-539a9e7e3bd2",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        -176
      ],
      "parameters": {
        "width": 528,
        "height": 1200,
        "content": "\n## Try It\n### This n8n template provides a self hosted RAG implementation.\n\n### How it works\n* Provides one workflow to maintain the knowledge base and another one to query the knowledge base.\n* Uplo"
      }
    },
    {
      "id": "4e3202d4-7b64-49a1-8f7f-63f2cd02e815",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -384,
        -160
      ],
      "parameters": {
        "width": 704,
        "height": 496,
        "content": "## 1. Update Knowledge base\n"
      }
    },
    {
      "id": "3306b8ee-e953-4218-9f7e-60a10cc26c66",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        608,
        -80
      ]
    },
    {
      "id": "4aaafa6c-286b-495e-a87b-87e76b789862",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        832,
        -80
      ]
    },
    {
      "id": "1cf662db-7d82-4b09-9f6b-1025d694615a",
      "name": "Ollama Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "position": [
        640,
        128
      ]
    },
    {
      "id": "068c18a2-bc98-4975-851e-c6fe462d6753",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -160
      ],
      "parameters": {
        "width": 816,
        "height": 496,
        "content": "## 2. Query Knowledge base"
      }
    },
    {
      "id": "b9f2ba62-e432-43e3-952e-261b83420229",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        848,
        128
      ]
    },
    {
      "id": "4072d63b-b349-4089-909b-839e5fb33567",
      "name": "Add to Qdrant Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        -80,
        -64
      ]
    },
    {
      "id": "019770da-2265-46d4-848f-a3e9305f401d",
      "name": "Read from Qdrant Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        992,
        128
      ]
    },
    {
      "id": "5a942bd4-8794-442d-a751-f50eb9c62b88",
      "name": "Upload document",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -288,
        -64
      ]
    }
  ],
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Upload document": {
      "main": [
        [
          {
            "node": "Add to Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Ollama": {
      "ai_embedding": [
        [
          {
            "node": "Add to Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Read from Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Ollama Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Add to Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read from Qdrant Vector Store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}