{
  "name": "Document-based chatbot with memory using OpenAI, Pinecone and Google Drive",
  "nodes": [
    {
      "id": "bbb66001-07da-4516-a07a-314b7a1393ac",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        660,
        -840
      ]
    },
    {
      "id": "ee1f2819-7c49-4914-ba2e-3de145fae2d1",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1692,
        -1140
      ]
    },
    {
      "id": "1d58365b-3331-4532-ba73-1d491b72d5b6",
      "name": "Save Memory",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        1860,
        -920
      ]
    },
    {
      "id": "d496dcb7-d8fb-4c05-a2f1-fd4de825f4b6",
      "name": "Get Memories",
      "type": "n8n-nodes-base.airtable",
      "position": [
        880,
        -765
      ]
    },
    {
      "id": "98df3edd-e7b7-4433-a073-4bafd91f00bc",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1100,
        -765
      ]
    },
    {
      "id": "27e407b1-3d2a-40b3-90a7-03b6b2163bfc",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1320,
        -840
      ]
    },
    {
      "id": "d01a413f-64c9-4b52-887d-d8f9ffa0a7bc",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1720,
        -920
      ]
    },
    {
      "id": "4e8a2cc2-c848-459e-9093-35e37621fc3c",
      "name": "When clicking 'Test Workflow' button",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        760,
        -140
      ]
    },
    {
      "id": "8fe55e76-9f22-4f0a-b151-c608ca4e6dfa",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        980,
        -140
      ]
    },
    {
      "id": "64380fb2-04f0-4ff5-ac17-b83a39173031",
      "name": "Get Content",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1200,
        -140
      ]
    },
    {
      "id": "8801ac09-96a1-4024-a824-c9cc023233bf",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1420,
        -140
      ]
    },
    {
      "id": "48a698ce-1abf-44b7-870e-7007aec6b6b0",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        1640,
        -140
      ]
    },
    {
      "id": "6d9f0396-2bce-41c5-98e3-c6686c1349c3",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1640,
        80
      ]
    },
    {
      "id": "c206d689-e381-482b-bb53-5bc99689869e",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1760,
        80
      ]
    },
    {
      "id": "efb5dccc-509f-445d-beab-c5a4a3dad92f",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1840,
        280
      ]
    },
    {
      "id": "7067fe20-938c-483b-9bf5-5c9fbb0e9c4b",
      "name": "Answer questions with a vector store",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        1960,
        -920
      ]
    },
    {
      "id": "e1c13db8-58ee-4daf-83b1-b5c7767d07b6",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2140,
        -720
      ]
    },
    {
      "id": "90f31fb5-731f-461e-ae76-b30828cc4342",
      "name": "Pinecone Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        1860,
        -720
      ]
    },
    {
      "id": "1b90e47f-b373-4ed1-a69b-897f790b1f31",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1940,
        -540
      ]
    },
    {
      "id": "6f081578-2db6-4d3f-b09e-ce2b0f26c67b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        588,
        -1200
      ],
      "parameters": {
        "width": 1760,
        "height": 820,
        "content": "## AI Agent\nThis is where the Chatbot is and all of the tools needed."
      }
    },
    {
      "id": "55ee0fea-ef7c-402a-b29a-45646908b179",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        -320
      ],
      "parameters": {
        "width": 1540,
        "height": 740,
        "content": "## Document Processing \nThis is where the AI will retrieve, download, and process the documents (PDF, CSV,...) to be used by the AI Agent"
      }
    },
    {
      "id": "6f2200f7-5cf2-4a56-b367-df54269ef719",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1580,
        -920
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get Content": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Memory": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Memories": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Get Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Answer questions with a vector store",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store1": {
      "ai_vectorStore": [
        [
          {
            "node": "Answer questions with a vector store",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Get Memories",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Answer questions with a vector store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Test Workflow' button": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}