{
  "name": "Process documents with recursive chunking using Google Drive, OpenAI & Gemini RAG",
  "nodes": [
    {
      "id": "95e00865-e2e3-4db6-a423-43488be3da42",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -360,
        -40
      ]
    },
    {
      "id": "43fe3da8-bc96-44da-a298-bb3ab59e6328",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -140,
        -40
      ]
    },
    {
      "id": "746c437e-ad11-4e79-995f-50d6e1211748",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        300,
        -40
      ]
    },
    {
      "id": "5ffd763b-e0f7-4ed4-8195-9a4da5b281bb",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        520,
        -40
      ]
    },
    {
      "id": "a5b0335e-f355-4959-9ece-7187d1dfd0eb",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1840,
        -40
      ]
    },
    {
      "id": "cff6ca9c-0e14-4096-8d58-d9ea332752f3",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1928,
        180
      ]
    },
    {
      "id": "c60ac23d-f256-4960-a1c2-b3238f018751",
      "name": "Summarize",
      "type": "n8n-nodes-base.summarize",
      "position": [
        2220,
        -40
      ]
    },
    {
      "id": "68beae62-7378-4ef6-a6fc-8d5f73eb5f19",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        2436,
        180
      ]
    },
    {
      "id": "f395021c-634c-4615-9630-bb1b06020504",
      "name": "Supabase Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        2452,
        -40
      ]
    },
    {
      "id": "ec2fa582-cc8b-4284-90e4-4dccb4f11779",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        2556,
        182.5
      ]
    },
    {
      "id": "e1f6953c-4fe0-43fa-bb86-77371e956d9b",
      "name": "Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
      "position": [
        2644,
        380
      ]
    },
    {
      "id": "e0d17eb8-5bf9-40d1-9642-6d853598a5aa",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1400,
        600
      ]
    },
    {
      "id": "cc7fc092-1975-45ef-ac8c-62196b4d5796",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -980,
        -260
      ],
      "parameters": {
        "width": 540,
        "height": 640,
        "content": "1. **Document Ingestion & Processing**\n\nGoogle Drive Trigger monitors for new files → Loop Over Items processes each file → File Info extracts metadata → Google Drive downloads the actual content → Sw"
      }
    },
    {
      "id": "7989a21e-2947-4ba4-bd42-21a169de2e70",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        500
      ],
      "parameters": {
        "width": 380,
        "height": 420,
        "content": "**ASK ME**\n\n\n**Query Processing & Retrieval**\n\nWhen Clicking Execute triggers user queries → OpenAI processes and understands the question → AI Agent orchestrates hybrid search (combining vector simil"
      }
    },
    {
      "id": "dfe4fbd8-b358-46a2-bcf9-c2c5027cca9d",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        720,
        600
      ]
    },
    {
      "id": "aed9c156-dcea-4fd8-887e-cb993e50e18b",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1440,
        820
      ]
    },
    {
      "id": "d9be2c8f-9f4f-475a-a30f-303389524e28",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1040,
        600
      ]
    },
    {
      "id": "803ccebd-69fe-4954-809d-9cd0b355fd6e",
      "name": "File info",
      "type": "n8n-nodes-base.set",
      "position": [
        80,
        -40
      ]
    },
    {
      "id": "c1926c20-88d6-4a95-a9d4-8dd2d1665b77",
      "name": "Extract from PDF",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        740,
        -140
      ]
    },
    {
      "id": "e4fc2a52-e1ea-424e-861f-fee7fceaa1cc",
      "name": "Extract from TEXT",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        960,
        60
      ]
    },
    {
      "id": "09a9112a-9c72-4965-818e-2351aad7528e",
      "name": "PDF to DATA",
      "type": "n8n-nodes-base.set",
      "position": [
        960,
        -140
      ]
    },
    {
      "id": "d4b03066-b191-439c-b1e9-f3a5b325f1fd",
      "name": "Recursive Splitter",
      "type": "n8n-nodes-base.code",
      "position": [
        1400,
        -40
      ]
    },
    {
      "id": "1f9b5ef2-c719-44e2-95a5-80566739345a",
      "name": "Document Data",
      "type": "n8n-nodes-base.set",
      "position": [
        1180,
        -40
      ]
    },
    {
      "id": "ba9f2a39-e3cb-45aa-9de7-8ae9a3331150",
      "name": "Chunk Splitting",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1620,
        -40
      ]
    },
    {
      "id": "46440496-6abc-46a2-843a-15988a4f717a",
      "name": "SupaBase Query",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1680,
        820
      ]
    }
  ],
  "connections": {
    "OpenAI": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Extract from PDF",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract from TEXT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "File info": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize": {
      "main": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PDF to DATA": {
      "main": [
        [
          {
            "node": "Document Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Document Data": {
      "main": [
        [
          {
            "node": "Recursive Splitter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SupaBase Query": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Summarize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chunk Splitting": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "File info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from PDF": {
      "main": [
        [
          {
            "node": "PDF to DATA",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Extract from TEXT": {
      "main": [
        [
          {
            "node": "Document Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Splitter": {
      "main": [
        [
          {
            "node": "Chunk Splitting",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}