{
  "name": "Portfolio RAG",
  "nodes": [
    {
      "parameters": {
        "formTitle": "Upload your data to test RAG",
        "formFields": {
          "values": [
            {
              "fieldLabel": "fileup(s)",
              "fieldType": "file",
              "acceptFileTypes": ".pdf, .csv, .txt",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        -1072,
        -144
      ],
      "id": "c1d07089-4654-4572-b274-26d96a9ade18",
      "name": "Upload your file here",
      "webhookId": "67caaa6e-039b-4dc3-a340-c857e551a3c2"
    },
    {
      "parameters": {
        "dataType": "binary",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1.1,
      "position": [
        -592,
        128
      ],
      "id": "e2d0cc63-7c11-4aa2-9295-1c1a517ad0a1",
      "name": "Default Data Loader"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        144,
        -176
      ],
      "id": "f1bcf220-e659-4fdb-8ceb-f38b89b6c2e7",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "mode": "insert",
        "qdrantCollection": {
          "__rl": true,
          "value": "intersindo",
          "mode": "list",
          "cachedResultName": "intersindo"
        },
        "embeddingBatchSize": 20,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.3,
      "position": [
        -784,
        -144
      ],
      "id": "0886ff45-bb64-49be-b9ba-f7fb79817b5a",
      "name": "Qdrant Vector Store",
      "notesInFlow": false,
      "credentials": {
        "qdrantApi": {
          "id": "D1AspIqWnAhlS76X",
          "name": "QdrantApi account 4"
        }
      }
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolDescription": "Anda adalah Assisten intersindo, bertugas menjawab pertanyaan user dari database",
        "qdrantCollection": {
          "__rl": true,
          "value": "intersindo",
          "mode": "list",
          "cachedResultName": "intersindo"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.3,
      "position": [
        192,
        320
      ],
      "id": "d1074ef4-d5c6-4d3f-9d01-8a6adcbd2d56",
      "name": "Qdrant Vector Store3",
      "credentials": {
        "qdrantApi": {
          "id": "D1AspIqWnAhlS76X",
          "name": "QdrantApi account 4"
        }
      }
    },
    {
      "parameters": {
        "contextWindowLength": 50
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        176,
        80
      ],
      "id": "24f1a029-a1a4-494d-b0cd-c8c2aa49d590",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "4f0ea9f9-8b30-403f-930c-0bc0c21f0aa3",
        "responseMode": "responseNode",
        "options": {
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "application/json"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        -288,
        -160
      ],
      "id": "57c7e951-69ae-4ac7-a3bb-b4b2e232ae22",
      "name": "Webhook for Chat",
      "webhookId": "4f0ea9f9-8b30-403f-930c-0bc0c21f0aa3",
      "executeOnce": false
    },
    {
      "parameters": {
        "jsCode": "const chatInput = $json.body.message || $json.body.query || $json.body.text;\n\n// Ambil sessionId dari body, kalau ga ada bisa pakai default\nconst sessionId = $json.body.sessionId || \"default\";\n\n// Format data untuk AI Agent\nreturn {\n  chatInput: chatInput,\n  sessionId: sessionId\n};\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -64,
        -160
      ],
      "id": "36004b15-6aac-453b-935c-019a315fdfbe",
      "name": "Process Webhook Input"
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ \"answer\": $json.output }) }}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        512,
        -144
      ],
      "id": "6020fe5e-86c0-4b74-b0fe-c50e83e06f9a",
      "name": "Respond to Webhook",
      "notes": "Fokus pada jawaban "
    },
    {
      "parameters": {
        "model": "z-ai/glm-4.7-flash",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        -144,
        208
      ],
      "id": "77af8c8c-e811-4e0c-8555-d66ea4a300fe",
      "name": "OpenRouter Chat Model",
      "notesInFlow": false,
      "credentials": {
        "openRouterApi": {
          "id": "hxDM5bTk1wL3nMnG",
          "name": "OpenRouter account"
        }
      }
    },
    {
      "parameters": {
        "modelName": "models/gemini-embedding-001"
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "typeVersion": 1,
      "position": [
        -784,
        416
      ],
      "id": "7195d81d-0ef4-4cde-b7ff-497e5dabd48f",
      "name": "Embeddings Google Gemini1",
      "credentials": {
        "googlePalmApi": {
          "id": "ErTp7mLBoplBWSn4",
          "name": "Google Gemini(PaLM) Api account"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        32,
        96
      ],
      "id": "54dd6821-ae04-4e96-ad7a-590844cc7dbc",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "id": "ErTp7mLBoplBWSn4",
          "name": "Google Gemini(PaLM) Api account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Upload your file here": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store3": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Webhook for Chat": {
      "main": [
        [
          {
            "node": "Process Webhook Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Webhook Input": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        []
      ]
    },
    "Embeddings Google Gemini1": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Qdrant Vector Store3",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "callerPolicy": "workflowsFromSameOwner",
    "timeSavedMode": "fixed",
    "availableInMCP": false,
    "timeSavedPerExecution": 10,
    "saveDataErrorExecution": "none",
    "saveDataSuccessExecution": "none",
    "saveExecutionProgress": false,
    "saveManualExecutions": false
  },
  "versionId": "6bc450af-f548-4419-a53f-8eb545100f67",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "621c08ae92b8b0051e87bf7f851dd28f2845257428a2f1c32ac827c8bd2a2a02"
  },
  "id": "czIxRvTWOHb7kQZH",
  "tags": []
}