{
  "name": "Chat with Google Drive documents using Pinecone and OpenAI RAG",
  "nodes": [
    {
      "id": "14a0099f-eb2a-4b5e-876e-11c8c1f3df84",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        1440,
        0
      ]
    },
    {
      "id": "5bf95b79-eafe-48c7-86ea-a13ced15611b",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1552,
        208
      ]
    },
    {
      "id": "96970907-bf3c-4d4d-8840-676438a71f95",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1776,
        320
      ]
    },
    {
      "id": "c0c13ac9-d126-439b-838f-d9c50fa1d309",
      "name": "Vector Store Tool",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        1312,
        1344
      ]
    },
    {
      "id": "8c2ff1ee-7982-42b9-bea7-d466ead05e65",
      "name": "Pinecone Vector Store (Retrieval)",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        1152,
        1504
      ]
    },
    {
      "id": "107d6722-a8ba-4234-8eff-075c8180b1a0",
      "name": "Download File From Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1168,
        0
      ]
    },
    {
      "id": "a896f7d1-6f8f-44d1-8783-2adef0005c58",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        592,
        1136
      ],
      "parameters": {
        "width": 1216,
        "height": 576,
        "content": "## Chat with company documents\n\n### Available chat tool with customized css style\n"
      }
    },
    {
      "id": "6c242bef-9cb0-41a2-af93-603e5b5ee267",
      "name": "Google Drive File Updated",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        112,
        704
      ]
    },
    {
      "id": "fb8c97e9-54b6-46d3-8b15-ee58b8af685e",
      "name": "Google Drive File Created",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        112,
        496
      ]
    },
    {
      "id": "32bcde62-2e41-4431-b432-c82a5fe20318",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        976,
        1456
      ]
    },
    {
      "id": "19843767-9ac7-4ada-87c9-e11fcf282ea8",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        288
      ],
      "parameters": {
        "width": 320,
        "height": 592,
        "content": "## Add documents to vector store when updating or creating new documents in Google Drive"
      }
    },
    {
      "id": "00cea317-6e8e-4997-847e-1b0abbf11934",
      "name": "Search files and folders",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        336,
        -208
      ]
    },
    {
      "id": "bd60461c-3c81-41e5-9b66-774c6062bf90",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -112,
        -112
      ]
    },
    {
      "id": "c849a85d-237a-4904-9efb-51f7ae9bb186",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1776,
        0
      ]
    },
    {
      "id": "48898663-6588-4d71-bda0-30724b636069",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        624,
        1248
      ]
    },
    {
      "id": "a2c2f1fb-343c-4e14-9558-3d9d0b13559c",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        800,
        1408
      ]
    },
    {
      "id": "ce98d6ae-9fbc-463f-9eb7-4a6b71ca89f8",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1616,
        1472
      ]
    },
    {
      "id": "2870d0f4-3da0-445a-b4f7-26a661892dee",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1376,
        1600
      ]
    },
    {
      "id": "6bc490b7-53e7-42dc-a304-39c6afd6dcaa",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1376,
        208
      ]
    },
    {
      "id": "c9807b69-3e69-4565-b675-a1fbc8922c2b",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        752,
        -240
      ]
    },
    {
      "id": "c3d3d370-7c01-4394-8f73-5d0bc6812cd5",
      "name": "Download File From Google Drive1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1056,
        592
      ]
    },
    {
      "id": "bddb2c85-08f0-4e5d-8b51-b282064dece8",
      "name": "Pinecone Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        1376,
        576
      ]
    },
    {
      "id": "5c49a685-8ca8-4a95-a8c7-d5d325101432",
      "name": "Embeddings OpenAI2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1296,
        768
      ]
    },
    {
      "id": "7c0a1146-8b18-4155-a7f1-d53816a41ba1",
      "name": "Default Data Loader1",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1472,
        752
      ]
    },
    {
      "id": "b640dd1a-9d5d-4e1c-8298-0aeb0f6ec3d8",
      "name": "Recursive Character Text Splitter1",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1504,
        928
      ]
    },
    {
      "id": "936a8ca2-a608-42ec-9649-1596e2f36098",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        -176
      ],
      "parameters": {
        "width": 736,
        "height": 768,
        "content": "## RAG with Google Drive, Pinecone, and OpenAI\n\nThis workflow builds a living knowledge base from your Google Drive and lets users chat with company documents in real time. Files are continuously inde"
      }
    },
    {
      "id": "212199f2-47cf-423f-81a3-c482d56fe1dd",
      "name": "Pinecone – Delete All Vectors",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        96,
        -144
      ]
    },
    {
      "id": "30c76f1d-d945-4cf6-bd9e-0233abea69a1",
      "name": "Loop Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        544,
        -176
      ]
    },
    {
      "id": "521867f9-a510-45d9-9960-e2ca95ebf8fa",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        -352
      ],
      "parameters": {
        "width": 1520,
        "height": 816,
        "content": "## Embedding entire folder\n\n### Upload all documents from a folder "
      }
    },
    {
      "id": "7d132873-bd24-4fac-b329-881c55267e12",
      "name": "Documents finder",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        896,
        1248
      ]
    },
    {
      "id": "8b9e7cad-7cd1-4719-867b-23cc50876117",
      "name": "Filter PDF files",
      "type": "n8n-nodes-base.filter",
      "position": [
        352,
        496
      ]
    },
    {
      "id": "37e1557e-47eb-4b17-8400-430b02b8aa1d",
      "name": "Filter PDF files1",
      "type": "n8n-nodes-base.filter",
      "position": [
        368,
        704
      ]
    },
    {
      "id": "c125e787-2a8c-4136-a31b-c5bfa8b55b9e",
      "name": "If length > 0",
      "type": "n8n-nodes-base.if",
      "position": [
        736,
        496
      ]
    },
    {
      "id": "31847f2b-f4cf-415b-83af-1ed9ce04af05",
      "name": "If length > 0_",
      "type": "n8n-nodes-base.if",
      "position": [
        736,
        704
      ]
    },
    {
      "id": "dbe33969-9c03-495f-b4d0-21db42636a15",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        512
      ],
      "parameters": {
        "width": 736,
        "height": 576,
        "content": "## Embedding documents information into Pinecone vector database\n"
      }
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Items": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download File From Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If length > 0": {
      "main": [
        [
          {
            "node": "Download File From Google Drive1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If length > 0_": {
      "main": [
        [
          {
            "node": "Download File From Google Drive1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Documents finder": {
      "main": [
        []
      ]
    },
    "Filter PDF files": {
      "main": [
        [
          {
            "node": "If length > 0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store (Retrieval)",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Filter PDF files1": {
      "main": [
        [
          {
            "node": "If length > 0_",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Documents finder",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Vector Store Tool": {
      "ai_tool": [
        [
          {
            "node": "Documents finder",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI2": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Vector Store Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader1": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store1",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "Documents finder",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search files and folders": {
      "main": [
        [
          {
            "node": "Loop Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive File Created": {
      "main": [
        [
          {
            "node": "Filter PDF files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive File Updated": {
      "main": [
        [
          {
            "node": "Filter PDF files1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Documents finder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File From Google Drive": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone – Delete All Vectors": {
      "main": [
        [
          {
            "node": "Search files and folders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File From Google Drive1": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store (Retrieval)": {
      "ai_vectorStore": [
        [
          {
            "node": "Vector Store Tool",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter1": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader1",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Pinecone – Delete All Vectors",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}