{
  "createdAt": "2025-07-14T19:05:41.138Z",
  "updatedAt": "2025-07-14T19:05:41.138Z",
  "id": "OiHsGnrs0QJyemfO",
  "name": "26-ask-questions-about-a-pdf-using-ai",
  "active": false,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "content": "### Load data into database\nFetch file from Google Drive, split it into chunks and insert into Pinecone index",
        "height": 627,
        "width": 918,
        "color": 7
      },
      "id": "892a12bc-f5e3-4781-b1a9-b1cdff60bdf9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        40
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "### Chat with database\nEmbed the incoming chat message and use it retrieve relevant chunks from the vector store. These are passed to the model to formulate an answer ",
        "height": 627,
        "width": 534,
        "color": 7
      },
      "id": "03deb6b2-49a6-45b0-ae4b-efb3fa7af6ca",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1140,
        40
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "## Try me out\n1. In Pinecone, create an index with 1536 dimensions and select it in *both* Pinecone nodes\n2. Click 'test workflow' at the bottom of the canvas to load data into the vector store\n3. Click 'chat' at the bottom of the canvas to ask questions about the data",
        "height": 264.61498034081166
      },
      "id": "c197926c-7742-4e8b-a307-6700040a33be",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        400
      ],
      "typeVersion": 1
    },
    {
      "parameters": {},
      "id": "719f686a-4b08-4fae-a604-d92bdfc530a3",
      "name": "When clicking 'Test Workflow' button",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -300,
        140
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "mode": "insert",
        "pineconeIndex": {
          "__rl": true,
          "mode": "id",
          "value": "test-index"
        },
        "options": {
          "clearNamespace": true
        }
      },
      "id": "d6e2a0ff-d91e-464e-a7c6-4d435638db91",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        480,
        140
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "6e9ba1a6-1429-4dcc-bdca-ecd145a64e08",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        960,
        140
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "c1ee0d1e-b769-4d95-b7ec-2a91af706388",
      "name": "Question & Answer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1200,
        140
      ],
      "typeVersion": 1.8
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "d08ef1f5-932b-4bbb-bb02-0cbdff26a636",
              "name": "file_url",
              "type": "string",
              "value": "https://drive.google.com/file/d/11Koq9q53nkk0F5Y8eZgaWJUVR03I4-MM/view"
            }
          ]
        },
        "options": {}
      },
      "id": "67bb077c-2f0f-45ab-b7ca-60ba37554cb7",
      "name": "Set Google Drive file URL",
      "type": "n8n-nodes-base.set",
      "position": [
        20,
        140
      ],
      "typeVersion": 3.4
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $json.file_url }}"
        },
        "options": {}
      },
      "id": "3cd8726c-b1fb-45a6-8218-e1efe597de5e",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        220,
        140
      ],
      "typeVersion": 3
    },
    {
      "parameters": {
        "dataType": "binary",
        "options": {}
      },
      "id": "f07e9e4b-b5d9-4ad0-8caa-c9c0765dddaf",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        580,
        360
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "chunkSize": 3000,
        "chunkOverlap": 200,
        "options": {}
      },
      "id": "d362d586-80e4-4934-a2e0-6661cccffb6a",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        660,
        480
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "a61c089f-9002-4fab-88d9-a5b979791f4e",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1400,
        480
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "a7df53b2-1997-42e4-a600-b41df5e1634b",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        460,
        360
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "bitcoin_paper",
        "toolDescription": "Call this tool to retrieve facts from the bitcoin whitepaper",
        "pineconeIndex": {
          "__rl": true,
          "mode": "id",
          "value": "test-index"
        },
        "includeDocumentMetadata": false,
        "options": {}
      },
      "id": "d9eecde3-5655-45a9-a9d9-acd5374df8d3",
      "name": "Pinecone Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        1320,
        360
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "id": "57fd9a01-967d-4a66-b9cb-e41f89405f9a",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1200,
        360
      ],
      "typeVersion": 1.2
    }
  ],
  "connections": {
    "Google Drive": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Question & Answer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store1": {
      "ai_tool": [
        [
          {
            "node": "Question & Answer",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Set Google Drive file URL": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Question & Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Test Workflow' button": {
      "main": [
        [
          {
            "node": "Set Google Drive file URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "versionId": "2883e432-d97e-4c30-9e34-b167f612524e",
  "triggerCount": 0,
  "shared": [
    {
      "createdAt": "2025-09-03T06:21:15.821Z",
      "updatedAt": "2025-09-03T06:21:15.821Z",
      "role": "workflow:owner",
      "workflowId": "OiHsGnrs0QJyemfO",
      "projectId": "DUObCiOoOXJuG68P"
    }
  ],
  "tags": []
}