{
  "nodes": [
    {
      "parameters": {
        "model": "llama3.2:3b",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "typeVersion": 1,
      "position": [
        640,
        80
      ],
      "id": "dcd46074-9863-438d-803f-36bb4a7a9d2b",
      "name": "Ollama Chat Model",
      "credentials": {
        "ollamaApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": "nomic-embed-text:v1.5"
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOllama",
      "typeVersion": 1,
      "position": [
        384,
        400
      ],
      "id": "926f745e-3738-4038-8952-3f7c72fe5695",
      "name": "Embeddings Ollama",
      "credentials": {
        "ollamaApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "### Embeddings\n\nThe Insert and Retrieve operation use the same embedding node.\n\nThis is to ensure that they are using the **exact same embeddings and settings**.\n\nDifferent embeddings might not work at all, or have unintended consequences.\n",
        "height": 240,
        "width": 320,
        "color": 4
      },
      "id": "6d1d376e-271c-4037-838b-557e49ca1b6a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        336
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "### \ud83d\udc15 2. Retriever Flow",
        "height": 460,
        "width": 680,
        "color": 7
      },
      "id": "7b55c6a9-c73f-4468-8e3b-d5e04c493ee0",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        -176
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "18caf08a-f9c6-414a-b41d-a10396940fa9",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        544,
        -128
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "cd9d7635-4674-4cc1-8ce6-c9d4c39e9bfb",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        752,
        -128
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "knowledge_base",
        "toolDescription": "Use this knowledge base to answer questions from the user",
        "memoryKey": {
          "__rl": true,
          "mode": "list",
          "value": "vector_store_key"
        }
      },
      "id": "bf97992d-c804-4d63-90fa-222c24f57165",
      "name": "Query Data Tool",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        752,
        96
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "mode": "insert",
        "memoryKey": {
          "__rl": true,
          "mode": "list",
          "value": "vector_store_key",
          "cachedResultName": "vector_store_key"
        }
      },
      "id": "42dd9809-05f0-479f-9af2-f079b5858916",
      "name": "Insert Data to Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        -128,
        -112
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "content": "### \ud83d\udcda Load Data Flow",
        "height": 460,
        "width": 700,
        "color": 7
      },
      "id": "157ff8a2-1edb-4484-9ab6-10073c247390",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        -176
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "### Readme\nLoad your data into a vector database with the \ud83d\udcda **Load Data** flow, and then use your data as chat context with the \ud83d\udc15 **Retriever** flow.\n\n**Quick start**\n1. Click on the `Execute Workflow` button to run the \ud83d\udcda **Load Data** flow.\n2. Click on `Open Chat` button to run the \ud83d\udc15 **Retriever** flow. Then ask a question about content from your document(s)\n\n\nFor more info, check our [docs on RAG in n8n](https://docs.n8n.io/advanced-ai/rag-in-n8n/)",
        "height": 300,
        "width": 440,
        "color": 4
      },
      "id": "f96de2b5-e01d-442c-88fb-d48899b0d57b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        -176
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "dataType": "binary",
        "options": {}
      },
      "id": "76c1ba75-1641-49f5-9179-5f8aab23ed38",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        144,
        48
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "formTitle": "Upload your data to test RAG",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Upload your file(s)",
              "fieldType": "file",
              "acceptFileTypes": ".txt",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "id": "7dc0c179-397e-4897-9f12-8935b413107b",
      "name": "Upload your file here",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -304,
        -112
      ],
      "typeVersion": 2.2
    }
  ],
  "connections": {
    "Ollama Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Ollama": {
      "ai_embedding": [
        [
          {
            "node": "Query Data Tool",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Insert Data to Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query Data Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Insert Data to Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Upload your file here": {
      "main": [
        [
          {
            "node": "Insert Data to Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}