{
  "createdAt": "2025-09-17T05:47:59.457Z",
  "updatedAt": "2025-09-18T17:08:06.222Z",
  "id": "WtkK75lu6sUAhthF",
  "name": "d23-RAG",
  "active": true,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "public": true,
        "initialMessages": "\u55e8\uff0c\u6211\u662f Huanry \u7684\u5c0f\u5e6b\u624b \ud83e\udd16\u2728  \n\u6211\u6703\u6839\u64da Huanry \u7684\u300c30 \u5929\u751f\u6210\u5f0f AI \u5de5\u4f5c\u6d41\uff1a\u793e\u7fa4\u7d93\u71df\u8005\u7684\u81ea\u52d5\u5316\u5be6\u6230\u300d\u7cfb\u5217\u6587\u7ae0\uff0c\u4f86\u56de\u7b54\u4f60\u95dc\u65bc **n8n \u81ea\u52d5\u5316** \u7684\u5404\u7a2e\u554f\u984c\uff01\n\n\ud83d\udcda [\u67e5\u770b\u7cfb\u5217\u6587\u7ae0](https://ithelp.ithome.com.tw/users/20178495/ironman/8470)\n\n\u6b61\u8fce\u96a8\u6642\u554f\u6211\u4efb\u4f55\u76f8\u95dc\u554f\u984c\uff0c\u8b93\u6211\u5011\u4e00\u8d77\u89e3\u9396\u81ea\u52d5\u5316\u7684\u5a01\u529b\u5427\uff01\ud83d\ude80",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        0
      ],
      "id": "cef15755-fe7a-4911-9454-7bc5c0732a67",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "options": {
          "systemPromptTemplate": "\u77e5\u8b58\u5eab\u4e2d\u5b58\u6709 Huanry \u64b0\u5beb\u7684 n8n \u5b78\u7fd2\u7d93\u9a57\u6587\u7ae0\u3002\n\u7576\u6709\u4eba\u63d0\u554f\u6642\uff0c\u512a\u5148\u6839\u64da\u9019\u4e9b\u6587\u7ae0\u5167\u5bb9\u56de\u7b54\uff0c\u4e26\u4e14\u53ef\u4ee5\u56de\u50b3\u76f8\u95dc\u6587\u7ae0\u9023\u7d50\u3002\n\u5982\u679c\u77e5\u8b58\u5eab\u4e2d \u6c92\u6709\u76f8\u95dc\u5167\u5bb9\uff0c\u518d\u7528\u4e00\u822c\u65b9\u5f0f\u6b63\u5e38\u56de\u7b54\u554f\u984c\u3002\n\u82e5\u771f\u7684\u4e0d\u77e5\u9053\u7b54\u6848\uff0c\u8acb\u76f4\u63a5\u56de\u7b54\u300c\u6211\u4e0d\u77e5\u9053\u300d\uff0c\u4e0d\u8981\u634f\u9020\u7b54\u6848\u3002\n---------------- \nContext: {context}"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
      "typeVersion": 1.6,
      "position": [
        256,
        0
      ],
      "id": "ead0cee4-e3fc-4ef8-82db-604b2d0d5418",
      "name": "Question and Answer Chain"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        224,
        224
      ],
      "id": "c530149f-1fd7-4d1f-8660-7c300c685eba",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
      "typeVersion": 1,
      "position": [
        352,
        224
      ],
      "id": "cc597f05-144a-4c4c-aa1f-076c78662f43",
      "name": "Vector Store Retriever"
    },
    {
      "parameters": {
        "tableName": {
          "__rl": true,
          "value": "documents",
          "mode": "list",
          "cachedResultName": "documents"
        },
        "options": {
          "queryName": "match_documents"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "typeVersion": 1.3,
      "position": [
        352,
        432
      ],
      "id": "22c64f7e-c060-4dba-b453-b7e5a5786bed",
      "name": "Supabase Vector Store",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "typeVersion": 1,
      "position": [
        432,
        640
      ],
      "id": "ed990dc0-5c93-43e4-aa1c-b80fa168ae9f",
      "name": "Embeddings Google Gemini",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "return [\n  {\n    json: {\n      text: $json[\"response\"] // \u53d6\u51fa response \u6b04\u4f4d\n    }\n  }\n];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        608,
        0
      ],
      "id": "54927ccc-6069-4ec0-929f-7bb79be09d13",
      "name": "Code in JavaScript"
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Vector Store Retriever": {
      "ai_retriever": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "ai_retriever",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "Vector Store Retriever",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini": {
      "ai_embedding": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Question and Answer Chain": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "versionId": "5c383417-dfc3-4475-9674-c87be638b3a3",
  "triggerCount": 1,
  "shared": [
    {
      "createdAt": "2025-09-17T05:47:59.457Z",
      "updatedAt": "2025-09-17T05:47:59.457Z",
      "role": "workflow:owner",
      "workflowId": "WtkK75lu6sUAhthF",
      "projectId": "6NV7foKyOeJG8Mz6"
    }
  ],
  "tags": [
    {
      "createdAt": "2025-09-14T06:27:04.834Z",
      "updatedAt": "2025-09-14T06:27:04.834Z",
      "id": "S14KyMmdLj6QsyYh",
      "name": "ithome"
    }
  ]
}