{
  "name": "Build a product catalog chatbot with Mistral AI, Google Drive & Supabase RAG",
  "nodes": [
    {
      "id": "7ee96301-3c33-431e-b098-827e4ff1ef9a",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1824,
        304
      ]
    },
    {
      "id": "87114bf9-78cf-434f-b1ef-892d7a88665c",
      "name": "Set File ID",
      "type": "n8n-nodes-base.set",
      "position": [
        -1328,
        320
      ]
    },
    {
      "id": "08806589-35a2-47f5-8478-a5833921a378",
      "name": "Google Drive1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -2080,
        304
      ]
    },
    {
      "id": "e9769228-810b-49ad-b3f3-9ba506426a10",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -896,
        320
      ]
    },
    {
      "id": "4d617e84-f840-44db-9c0b-f1b8e7a510b3",
      "name": "Default Data Loader1",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        128,
        480
      ]
    },
    {
      "id": "60638340-405f-40f0-a366-0d0cfeaa748f",
      "name": "Character Text Splitter1",
      "type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
      "position": [
        208,
        592
      ]
    },
    {
      "id": "338993e9-5533-48be-aca5-0b7f94e407cd",
      "name": "Embeddings Mistral Cloud2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsMistralCloud",
      "position": [
        16,
        608
      ]
    },
    {
      "id": "28c68d4a-a057-4844-99ce-d8ba61dc8635",
      "name": "Insert into Supabase Vectorstore",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        32,
        320
      ]
    },
    {
      "id": "10d4cdd8-bb87-47fe-815d-9df3dbb00a64",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        -720,
        320
      ]
    },
    {
      "id": "60509aa4-872a-40bd-873c-665d59ef8d88",
      "name": "Wait4",
      "type": "n8n-nodes-base.wait",
      "position": [
        560,
        320
      ]
    },
    {
      "id": "cb7a06ea-1272-48d3-bd3b-c26401b3c6a6",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2368,
        304
      ]
    },
    {
      "id": "df903e02-f71d-49e8-b247-b285b9229ac2",
      "name": "Supabase Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        -1072,
        1488
      ]
    },
    {
      "id": "8a39783b-5c59-4f6a-817a-d18f2aad682e",
      "name": "Mistral Cloud Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        -1856,
        1552
      ]
    },
    {
      "id": "44f63ffe-17ae-4ad4-9f9a-b40f9e12f045",
      "name": "Embeddings Mistral Cloud",
      "type": "@n8n/n8n-nodes-langchain.embeddingsMistralCloud",
      "position": [
        -1232,
        1552
      ]
    },
    {
      "id": "41d840ba-6ee3-4c90-9a9f-e5261f6dadb1",
      "name": "Simple Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -1632,
        1536
      ]
    },
    {
      "id": "dec01f91-30f9-4410-ae0e-30466607e5a3",
      "name": "Webhook1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2208,
        1232
      ]
    },
    {
      "id": "c209a25c-eb4d-4a48-9055-0b132ab1f772",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        -2048,
        1232
      ]
    },
    {
      "id": "52e03830-fc49-4bb4-b9da-b7694c237870",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2144,
        176
      ],
      "parameters": {
        "width": null,
        "height": 336,
        "content": "## Drive ingestion\nFinds files in the configured Drive folder. Loops over items and downloads each file.\n"
      }
    },
    {
      "id": "df9dba08-cc68-4268-ad4b-a27faa661fce",
      "name": "extract metadata",
      "type": "n8n-nodes-base.code",
      "position": [
        -1600,
        320
      ]
    },
    {
      "id": "c387499d-5e44-4385-8cc6-16e28b7b4d7e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        192
      ],
      "parameters": {
        "width": 192,
        "height": 304,
        "content": "## map extracted metadata "
      }
    },
    {
      "id": "6bc90f18-32ff-47ae-a4be-727d42580393",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        208
      ],
      "parameters": {
        "width": null,
        "height": 272,
        "content": "### Chunk & split\nCreates text chunks with overlap to prepare for embeddings.\n"
      }
    },
    {
      "id": "7f030ecd-600a-47a7-976d-f4a456e375db",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        192
      ],
      "parameters": {
        "width": 192,
        "height": 304,
        "content": "### downloaded file from google drive"
      }
    },
    {
      "id": "3a18d2df-f3d3-436f-a43f-c556619b33f9",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        192
      ],
      "parameters": {
        "width": 208,
        "height": 304,
        "content": "### Parse content\nConverts downloaded file into JSON/text and attaches minimal metadata (page, title, source_url)."
      }
    },
    {
      "id": "9e71eb01-c2b9-478f-bdc5-161fd1dcf70f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        208
      ],
      "parameters": {
        "width": 182,
        "height": 272,
        "content": "## Map fields\nMaps parsed JSON into standardized fields\n"
      }
    },
    {
      "id": "0f48281c-ce78-4bbe-bacd-cf8ae0ea44cb",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        160
      ],
      "parameters": {
        "width": 176,
        "height": 352,
        "content": "## Extract metadata\nPulls file id, title, modified date, and other metadata used downstream.\n"
      }
    },
    {
      "id": "092ea181-86c2-4727-a5ce-24dc94cc8e31",
      "name": "Google Drive  get file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1088,
        320
      ]
    },
    {
      "id": "5f6a16f5-e10a-4015-acdb-cdbeb4e2a321",
      "name": "map data into fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -528,
        320
      ]
    },
    {
      "id": "baa333ed-24cb-45c4-b88a-ea4cea117c25",
      "name": "convert data into chunks",
      "type": "n8n-nodes-base.code",
      "position": [
        -304,
        320
      ]
    },
    {
      "id": "4a7f01a0-9b1f-4d53-85be-31c2c3c627c0",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        176
      ],
      "parameters": {
        "width": 416,
        "height": 560,
        "content": "## vector store and data loader\n### Embeddings → Store\nGenerates embeddings and inserts them into the Supabase vector table for RAG queries.\n"
      }
    },
    {
      "id": "83cf290d-040e-465d-973e-b9a01973e217",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -2208,
        1392
      ]
    },
    {
      "id": "e961571d-89fa-4291-ba98-e749b6574c62",
      "name": "product catalog agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1696,
        1184
      ]
    },
    {
      "id": "dda37d31-6eea-4199-9d4d-f5f3d26ed9dc",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        1088
      ],
      "parameters": {
        "width": 464,
        "height": 288,
        "content": "## Catalog Agent\nQueries Supabase only when needed. Returns product name, specs, image, and suggested items.\n"
      }
    },
    {
      "id": "6ad0f9e3-4ae0-4f69-8258-c9bcb96f9e0c",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2256,
        1088
      ],
      "parameters": {
        "width": 336,
        "height": 448,
        "content": "### Chat & Trigger\nReceives user queries via chat or webhook. Starts the RAG lookup when the user asks for product suggestions.\n"
      }
    },
    {
      "id": "2e6bae65-a6d5-4f1c-bd9d-4cc6efaa1fd9",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1312,
        1376
      ],
      "parameters": {
        "width": 480,
        "height": 272,
        "content": "## vector store with product catalog\n### Supabase Vectorstore\nHolds document vectors used by the agent to retrieve relevant product info at query time.\n"
      }
    },
    {
      "id": "9aa14ebc-a28d-4067-b0a3-dfc18b0402bd",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3008,
        -16
      ],
      "parameters": {
        "width": 464,
        "height": 560,
        "content": "\n## How it works\n- Loads files from a selected Google Drive folder.  \n- Extracts key details from each file (title, modified date, type).  \n- Converts documents into readable text.  \n- Splits long tex"
      }
    },
    {
      "id": "c8268dc2-c532-466a-bd15-13ca9db738b7",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2432,
        0
      ],
      "parameters": {
        "width": 2032,
        "height": 752,
        "content": "# Drive ingestion\nFinds files in a Drive folder and loops through each file for processing.\n"
      }
    },
    {
      "id": "ab41c3ae-cfab-479c-aaf0-174e34d27767",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        0
      ],
      "parameters": {
        "width": 1104,
        "height": 752,
        "content": "## Chunk and Embed\nSplits text into chunks, creates embeddings, and saves them to Supabase.\n"
      }
    },
    {
      "id": "e19e722d-3e51-42ba-bc64-3b17348d0b3a",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        224
      ],
      "parameters": {
        "width": null,
        "height": 256,
        "content": "## Rate / pacing\nDelays between inserts to avoid API rate limits and ensure stable ingestion.\n"
      }
    },
    {
      "id": "f476d73d-94e8-45a2-918d-22b861132960",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        1440
      ],
      "parameters": {
        "width": 272,
        "height": 256,
        "content": "## Simple Memory\nShort-window memory for session context; do not store sensitive data.\n"
      }
    },
    {
      "id": "d4143eb7-8fc1-4f5e-a220-6f0eaa049ae4",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1920,
        1456
      ],
      "parameters": {
        "width": 192,
        "height": 224,
        "content": "### Mistral Model \nMistral handles text generation and user query."
      }
    }
  ],
  "connections": {
    "Wait1": {
      "main": [
        [
          {
            "node": "map data into fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait4": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook1": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set File ID": {
      "main": [
        [
          {
            "node": "Google Drive  get file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "product catalog agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "product catalog agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "extract metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract metadata": {
      "main": [
        [
          {
            "node": "Set File ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader1": {
      "ai_document": [
        [
          {
            "node": "Insert into Supabase Vectorstore",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "map data into fields": {
      "main": [
        [
          {
            "node": "convert data into chunks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Vector Store": {
      "ai_tool": [
        [
          {
            "node": "product catalog agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive  get file": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Character Text Splitter1": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader1",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Mistral Cloud": {
      "ai_embedding": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "convert data into chunks": {
      "main": [
        [
          {
            "node": "Insert into Supabase Vectorstore",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Mistral Cloud2": {
      "ai_embedding": [
        [
          {
            "node": "Insert into Supabase Vectorstore",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Cloud Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "product catalog agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "product catalog agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert into Supabase Vectorstore": {
      "main": [
        [
          {
            "node": "Wait4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Google Drive1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}