{
  "name": "google-drive-rag",
  "nodes": [
    {
      "parameters": {
        "mode": "insert",
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "company-files",
          "cachedResultName": "company-files"
        },
        "options": {}
      },
      "id": "8b0181f1-72d3-4c90-8cee-926ee3db7768",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -60,
        220
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "modelName": "models/text-embedding-004"
      },
      "id": "43ae538f-f209-4eb1-b9ca-ba6a011cffef",
      "name": "Embeddings Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        -100,
        500
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "dataType": "binary",
        "binaryMode": "specificField",
        "options": {}
      },
      "id": "2df18c6c-ef4b-4f0c-8dfd-449e8c80dd2f",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        100,
        440
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "chunkOverlap": 100,
        "options": {}
      },
      "id": "4e03201b-ed7f-43c4-9c45-b541512833a3",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        80,
        640
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "You are a helpful HR assistant designed to answer employee questions based on company policies.\n\nRetrieve relevant information from the provided internal documents and provide a concise, accurate, and informative answer to the employee's question.\n\nUse the tool called \"company_documents_tool\" to retrieve any information from the company's documents.\n\nIf the answer cannot be found in the provided documents, respond with \"I cannot find the answer in the available resources.\""
        }
      },
      "id": "374ef2f9-4618-4527-96fc-8c875d44b5c7",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -320,
        1060
      ],
      "typeVersion": 1.7
    },
    {
      "parameters": {
        "name": "company_documents_tool",
        "description": "Retrieve information from any company documents"
      },
      "id": "6e3fb396-c514-4739-bc10-f85d4fbbddbf",
      "name": "Vector Store Tool",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        80,
        1280
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "company-files",
          "cachedResultName": "company-files"
        },
        "options": {}
      },
      "id": "e72f6d38-789e-47b6-8e16-6331bc43b370",
      "name": "Pinecone Vector Store (Retrieval)",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -20,
        1460
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "modelName": "models/text-embedding-004"
      },
      "id": "f2a77824-10ed-45f3-96a4-fc38bdb1a71c",
      "name": "Embeddings Google Gemini (retrieval)",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        -40,
        1620
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {
          "fileName": "={{ $json.name }}"
        }
      },
      "id": "70bce54a-1de2-4465-878d-0c8b70976c59",
      "name": "Download File From Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -280,
        220
      ],
      "typeVersion": 3
    },
    {
      "parameters": {
        "content": "## Chat with company documents"
      },
      "id": "eb1a156b-9dd7-46b9-8b85-d565f04cab08",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        880
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W",
          "cachedResultName": "INNOVI PRO"
        },
        "event": "fileUpdated",
        "options": {}
      },
      "id": "74655a16-d630-48b2-bca8-ad018d67fbb8",
      "name": "Google Drive File Updated",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -600,
        360
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1evDIoHePhjw_LgVFZXSZyK1sZm2GHp9W",
          "cachedResultName": "INNOVI PRO"
        },
        "event": "fileCreated",
        "options": {
          "fileType": "all"
        }
      },
      "id": "e1b2681b-ac9c-4c70-9099-6ce916146233",
      "name": "Google Drive File Created",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -600,
        100
      ],
      "typeVersion": 1
    },
    {
      "parameters": {},
      "id": "006576ee-6670-41b7-bbae-fc3c87796219",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -240,
        1360
      ],
      "typeVersion": 1.3
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "f75d6256-3e5d-47e3-b551-91c2a6906627",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -660,
        1060
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "content": "## Add docuemnts to vector store when updating or creating new documents in Google Drive",
        "width": 320
      },
      "id": "96051dd0-ec5b-4275-bce1-31dead8ef740",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        -20
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.0-flash-exp",
        "options": {}
      },
      "id": "c1912957-2132-445d-b537-1d68dcfafd27",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -420,
        1360
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.0-flash-exp",
        "options": {}
      },
      "id": "ed406930-dcd6-4eec-ab63-1643cc5e7155",
      "name": "Google Gemini Chat Model (retrieval)",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        340,
        1460
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "## Set up steps\n\n1. Google Cloud Project and Vertex AI API:\n* Create a Google Cloud project.\n* Enable the Vertex AI API for your project.\n2. Google AI API Key:\n* Obtain a Google AI API key from Google AI Studio.\n3. Pinecone Account:\n* Create a free account on the Pinecone website.\nObtain your API key from your Pinecone dashboard.\n* Create an index named company-files in your Pinecone project.\n4. Google Drive:\n* Create a dedicated folder in your Google Drive where company documents will be stored.\n5. Credentials in n8n: Configure credentials in your n8n environment for:\n* Google Drive OAuth2\n* Google Gemini(PaLM) Api (using your Google AI API key)\n* Pinecone API (using your Pinecone API key)\n5. Import the Workflow:\n* Import this workflow into your n8n instance.\n6. Configure the Workflow:\n* Update both Google Drive Trigger nodes to watch the specific folder you created in your Google Drive.\n* Configure the Pinecone Vector Store nodes to use your company-files index.",
        "height": 720,
        "width": 420
      },
      "id": "8d9ce86e-dbb1-4b47-bc61-80ada00ad3c8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1280,
        440
      ],
      "typeVersion": 1
    }
  ],
  "connections": {
    "Vector Store Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive File Created": {
      "main": [
        [
          {
            "node": "Download File From Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive File Updated": {
      "main": [
        [
          {
            "node": "Download File From Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File From Google Drive": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store",
            "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
          }
        ]
      ]
    },
    "Embeddings Google Gemini (retrieval)": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store (Retrieval)",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model (retrieval)": {
      "ai_languageModel": [
        [
          {
            "node": "Vector Store Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0f576ed6-57bf-4a26-a54d-623148c38bda",
  "id": "oaUiP1piK9Ih9T4I",
  "tags": []
}