{
  "name": "AI-Powered RAG Document Processing & Chatbot with Google Drive, Supabase, OpenAI",
  "nodes": [
    {
      "id": "dcd42ca2-abff-41a7-b392-6e0de1b6999f",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1320,
        2380
      ]
    },
    {
      "id": "8eb7679b-eec3-40e4-afb0-2bd7f544ec9e",
      "name": "Extract from PDF",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        2500,
        2340
      ]
    },
    {
      "id": "cf0a457c-2555-4375-86b8-bbb676d1ee82",
      "name": "Extract from CSV",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        2500,
        2540
      ]
    },
    {
      "id": "21b6bae8-a26e-47e5-8b14-ba43bf8f9295",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        4580,
        2540
      ]
    },
    {
      "id": "12ee63ca-5662-400f-a0a0-b9e12346091d",
      "name": "Google Drive Trigger File Created",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        1060,
        2380
      ]
    },
    {
      "id": "915d117f-69aa-4f56-9051-cb3d3ba862c2",
      "name": "Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
      "position": [
        4680,
        2720
      ]
    },
    {
      "id": "741ee49a-04d3-47e5-89cc-2a8f50a94ad8",
      "name": "Set File ID",
      "type": "n8n-nodes-base.set",
      "position": [
        1580,
        2400
      ]
    },
    {
      "id": "94f4b238-7365-4fd0-b7fd-1cdc9c5bbc00",
      "name": "Download FIle",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1820,
        2400
      ]
    },
    {
      "id": "c3ed78a0-7ff3-40f0-a4be-038d4908d0bc",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        2100,
        2400
      ]
    },
    {
      "id": "c8c85b4c-b568-4e44-96dc-b6feabc463f5",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3320,
        2620
      ]
    },
    {
      "id": "5d448edf-f219-4edb-90a3-a5b64bd2239a",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        4100,
        2500
      ]
    },
    {
      "id": "5a399f9f-df56-4c0f-913a-8f02c15bf334",
      "name": "Process Context",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        3940,
        2340
      ]
    },
    {
      "id": "04138472-84dc-47d6-8909-7ff9404613b1",
      "name": "Document Data",
      "type": "n8n-nodes-base.set",
      "position": [
        2760,
        2340
      ]
    },
    {
      "id": "aec980bc-6f3f-43b9-bd11-bd1fd07c9f5c",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        3560,
        2340
      ]
    },
    {
      "id": "ca2fb84a-db88-488c-a240-3a2e4ddd40af",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "position": [
        3740,
        2340
      ]
    },
    {
      "id": "fc015ac7-c474-40d0-91fd-9502d0bd4b25",
      "name": "Summarize",
      "type": "n8n-nodes-base.summarize",
      "position": [
        4260,
        2340
      ]
    },
    {
      "id": "0873b091-e714-41d6-b23e-1a3222061806",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        4460,
        2540
      ]
    },
    {
      "id": "5f4ccb20-f17b-41b6-9700-06cccfd10fee",
      "name": "Add Data to Supabase Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        4460,
        2340
      ]
    },
    {
      "id": "1f99f8b9-3335-4c82-b04d-873637914605",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        3120,
        2640
      ]
    },
    {
      "id": "ecb8a6de-2937-4658-b063-be11253350ed",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        980,
        2200
      ],
      "parameters": {
        "width": 1960,
        "height": 560,
        "content": "## 📁 Data Processing from Google Drive\nAutomatically monitors your Google Drive folder and processes new files. When you upload a PDF, CSV, or Google Doc, this section downloads the file, extracts all"
      }
    },
    {
      "id": "52e22d2e-4633-484b-bd00-d6baa7659366",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3000,
        2200
      ],
      "parameters": {
        "width": 1940,
        "height": 700,
        "content": "## 🧠 RAG Data Upload Pipeline\nTakes your extracted document text and makes it AI-ready. It creates smart summaries, breaks documents into digestible chunks, adds context to each piece, and stores ever"
      }
    },
    {
      "id": "935fb434-2404-42f2-9a46-0830a1dfe01c",
      "name": "Create Metadata Title & Description",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        3060,
        2340
      ]
    },
    {
      "id": "803601cb-5289-493a-8475-4fb99817c513",
      "name": "Split into chunks",
      "type": "n8n-nodes-base.code",
      "position": [
        3400,
        2340
      ]
    },
    {
      "id": "3b6c1bab-b11f-499b-8fba-b2b12449aadc",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2680,
        1720
      ]
    },
    {
      "id": "4dcc7e04-d939-47de-9b37-41abc4c9c2c3",
      "name": "Supabase Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        2980,
        1760
      ]
    },
    {
      "id": "21016db6-a271-4306-ac0d-941a2c459322",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2720,
        1500
      ]
    },
    {
      "id": "0f5e7c7c-8adf-4688-92cd-f0195e972346",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        3060,
        1940
      ]
    },
    {
      "id": "525f1628-a913-400e-895e-d009be257293",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        2480,
        1500
      ]
    },
    {
      "id": "aea2befa-20ce-4f27-999b-95c682f70f50",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2840,
        1760
      ]
    },
    {
      "id": "465f36f8-5d33-4580-867c-cd854f16a871",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2300,
        1380
      ],
      "parameters": {
        "width": 1180,
        "height": 760,
        "content": "## AI Chat Agent - Chat with your documents stored in Supabase Vector Store\nour personal AI assistant that can answer questions about all your uploaded documents. Ask anything in plain English - it se"
      }
    },
    {
      "id": "f15e6542-dccf-457b-af0a-d2d6a9eab48f",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        1380
      ],
      "parameters": {
        "width": 460,
        "height": 320,
        "content": "## 📄 AI-Powered RAG Document Processing & Chatbot with Google Drive, Supabase, OpenAI\n\n**What This Workflow Does:**\n- Watches a Google Drive folder for new documents\n- Extracts text from PDF/CSV files"
      }
    },
    {
      "id": "dfd4d156-8f0b-4a27-ac69-3578d1602722",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        2200
      ],
      "parameters": {
        "width": 660,
        "height": 1500,
        "content": "## 📋 Data Processing & RAG Workflow\n\n### 📁 Step 1: Google Drive Trigger  \nWatches a specific Google Drive folder for new file uploads. Triggers every minute.\n\n### 🔁 Step 2: Loop Over Uploaded Files  \n"
      }
    },
    {
      "id": "122852a9-eb55-4af6-a959-f0a95a9b61c3",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2300,
        820
      ],
      "parameters": {
        "width": 1160,
        "height": 520,
        "content": "\n## SETUP REQUIRED  \n**Author:** [Billy Christi](https://n8n.io/creators/billy/)\n\n---\n\n### 📚 Database: Supabase Table `documents`\n\nTo manage and store embeddings and metadata, we use a Supabase table "
      }
    },
    {
      "id": "851bb367-bcc4-4444-9b01-21dd9666265f",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        1380
      ],
      "parameters": {
        "width": 660,
        "height": 760,
        "content": "\n## 🤖 CHAT INTERFACE WORKFLOW\n\n### 💬 Step 1: Chat Trigger  \nListens for user chat input (e.g., question about a document).\n\n### 🧠 Step 2: Simple Memory  \nStores last 10 messages to maintain conversati"
      }
    },
    {
      "id": "7429d34b-af0f-476c-893f-285cfe8e28ba",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3640,
        2480
      ],
      "parameters": {
        "width": 340,
        "height": 300,
        "content": "📌 **Understanding the Limit Node**\nThe **Limit Node** restricts the number of records or items processed in your workflow. This is especially useful for:\n✅ **Testing** your setup with a smaller datase"
      }
    },
    {
      "id": "c4ad1f43-43ff-4f19-8e68-915c5ffeeb37",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3520,
        1380
      ],
      "parameters": {
        "width": 380,
        "height": 760,
        "content": "# 👋 Hi, I’m Billy\n![My Photo](https://i.ibb.co/Gvn63Bzc/Billy-Christi-AI-Automation.jpg)\nI help businesses build **n8n workflows** & **AI automation projects**.  \nNeed help with n8n or AI Automation p"
      }
    }
  ],
  "connections": {
    "Limit": {
      "main": [
        [
          {
            "node": "Process Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Extract from PDF",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract from CSV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize": {
      "main": [
        [
          {
            "node": "Add Data to Supabase Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set File ID": {
      "main": [
        [
          {
            "node": "Download FIle",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Document Data": {
      "main": [
        [
          {
            "node": "Create Metadata Title & Description",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download FIle": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Set File ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Context": {
      "main": [
        [
          {
            "node": "Summarize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from CSV": {
      "main": [
        [
          {
            "node": "Document Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from PDF": {
      "main": [
        [
          {
            "node": "Document Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Add Data to Supabase Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Split into chunks": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Add Data to Supabase Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Vector Store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Process Context",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Create Metadata Title & Description",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Create Metadata Title & Description",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger File Created": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Metadata Title & Description": {
      "main": [
        [
          {
            "node": "Split into chunks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}