{
  "name": "RAG Agent Part-1 (Context Injection)",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -272,
        0
      ],
      "id": "e9ef4aca-0221-4e70-9092-3ed70406e7b1",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "resource": "fileFolder",
        "limit": 10,
        "filter": {
          "folderId": {
            "__rl": true,
            "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID",
            "mode": "list",
            "cachedResultName": "n8n_documents_rag_agent_pinecone",
            "cachedResultUrl": "https://drive.google.com/drive/folders/YOUR_GOOGLE_DRIVE_FOLDER_ID"
          }
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -64,
        0
      ],
      "id": "ac3d471e-eee9-4b7d-abd8-26bb8451fe85",
      "name": "Search files and folders",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "={{ $json.id }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        144,
        0
      ],
      "id": "056cf30c-9893-4bc3-ac45-7667c130a1c5",
      "name": "Download file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "mode": "insert",
        "pineconeIndex": {
          "__rl": true,
          "value": "resume-projects-docs",
          "mode": "list",
          "cachedResultName": "resume-projects-docs"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "typeVersion": 1.3,
      "position": [
        352,
        0
      ],
      "id": "152e92e5-3931-486b-83a3-a5bce0cdc98d",
      "name": "Pinecone Vector Store",
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        272,
        208
      ],
      "id": "cd34e7eb-0eca-4bd7-a8c9-a1860276392c",
      "name": "Embeddings OpenAI",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "dataType": "binary",
        "textSplittingMode": "custom",
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "file_name",
                "value": "={{ $json.name }}"
              }
            ]
          }
        }
      },
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1.1,
      "position": [
        496,
        208
      ],
      "id": "4509bbdd-1166-4401-88b7-79e4f2cae359",
      "name": "Default Data Loader"
    },
    {
      "parameters": {
        "chunkOverlap": 250,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        496,
        368
      ],
      "id": "34d266ab-b05f-45ff-a517-04765f4d528e",
      "name": "Recursive Character Text Splitter"
    },
    {
      "parameters": {
        "content": "Pinecone API Key: \nYOUR_PINECONE_API_KEY",
        "width": 448
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -32
      ],
      "typeVersion": 1,
      "id": "00c5f2d9-3055-4aed-8a04-96cae224d56a",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "Note: \n\nVector dimension should always match with dimension of index. (e.g., 512, 1536). \n\nChange dimension while creating 'index' in Pinecone database. ",
        "height": 176,
        "width": 336,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        208
      ],
      "typeVersion": 1,
      "id": "7a9c8cfd-dd31-41ed-a375-314f3fd0eac0",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "Learning (Data Injection Flow): \n\nData Extraction: The process begins with source documents, such as PDFs. Data is extracted from these files to begin the workflow.\n\nChunking: The extracted text is split into smaller segments called \"Chunks of text\" (e.g., Chunk 1, Chunk 2, etc.).\n\nEmbedding Generation: These text chunks are sent to an \"Embedding API\". The API converts the text chunks into numerical representations known as \"vectors\" or \"Embeddings\".\n\nStorage in Semantic Index: The generated embeddings are then stored in a \"semantic index,\" which becomes the \"Knowledge base\".\n\nVector Store Components: In this index/vector store, both the \"Embeddings\" and the original \"Doc chunks\" are stored together.\n\nSupported Technologies: Examples of technologies used for this storage include ChromaDb, Faiss, Pinecone, and Azure Index.\n",
        "height": 608,
        "width": 448,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        208
      ],
      "typeVersion": 1,
      "id": "3171ffe9-0b6c-4768-9c0e-65286e6dc1fc",
      "name": "Sticky Note2"
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Search files and folders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search files and folders": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "staticData": null,
  "triggerCount": 0,
  "meta": {
    "templateCredsSetupCompleted": true
  }
}