8
n8n 한국어amn8n.com

Jotform, Supabase에서 RAG, Together AI, Gemini를 사용하여 지식庫 챗봇을 구축합니다.

중급

이것은자동화 워크플로우로, 15개의 노드를 포함합니다.주로 Code, Supabase, Aggregate, HttpRequest, JotFormTrigger 등의 노드를 사용하며. Jotform, Supabase에서 RAG, Together AI, Gemini를 사용하여 지식庫 챗봇을 구축합니다.

사전 요구사항
  • Supabase URL과 API Key
  • 대상 API의 인증 정보가 필요할 수 있음
  • Google Gemini API Key

카테고리

-
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "meta": {
    "instanceId": "93f396852104089b8670e7494b0f3668b420464668ae4a8c1d6b4b5799f8e3ef",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "1c57da69-7af2-47c8-8bc2-92e49449bd81",
      "name": "청크로 분할",
      "type": "n8n-nodes-base.code",
      "position": [
        2192,
        -496
      ],
      "parameters": {
        "jsCode": "const text = $input.first().json.text;\nconst chunkSize = 1000;\n\nlet chunks = [];\nfor (let i = 0; i < text.length; i += chunkSize) {\n  chunks.push({\n    json: { chunk: text.slice(i, i + chunkSize) }\n  });\n}\n\nreturn chunks;\n\n"
      },
      "typeVersion": 2
    },
    {
      "id": "d5ed1aaf-6089-4731-980d-b5c356b22403",
      "name": "업로드 문서 임베딩",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2416,
        -496
      ],
      "parameters": {
        "url": "https://api.together.xyz/v1/embeddings",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "BAAI/bge-large-en-v1.5"
            },
            {
              "name": "input",
              "value": "={{ $json.chunk }}"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "ePx2TlbqIiRjDGfW",
          "name": "Together API"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0b1c609f-e335-4541-8dae-e3517ec4bb63",
      "name": "임베딩을 DB에 저장",
      "type": "n8n-nodes-base.supabase",
      "position": [
        2624,
        -496
      ],
      "parameters": {
        "tableId": "RAG",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "chunk",
              "fieldValue": "={{ $('Splitting into Chunks').item.json.chunk }}"
            },
            {
              "fieldId": "embeddings",
              "fieldValue": "={{ JSON.stringify($json.data[0].embedding) }}"
            }
          ]
        }
      },
      "credentials": {
        "supabaseApi": {
          "id": "sNLLVD1n1FkMp81B",
          "name": "abhi.vaar"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3a39d174-434e-4c81-921c-8a354fad5ebe",
      "name": "집계",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2064,
        64
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "chunk"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4ce2ab5b-bb1e-46ce-9dd8-2cfdee5510a2",
      "name": "임베딩 검색",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1840,
        64
      ],
      "parameters": {
        "url": "https://enter-your-supabase-host/rest/v1/rpc/matchembeddings1",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "=query_embedding",
              "value": "={{ $json.data[0].embedding }}"
            },
            {
              "name": "match_count",
              "value": "5"
            }
          ]
        },
        "nodeCredentialType": "supabaseApi"
      },
      "credentials": {
        "supabaseApi": {
          "id": "sNLLVD1n1FkMp81B",
          "name": "abhi.vaar"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "76c8df3f-cf64-4848-b077-d04e9de88d12",
      "name": "사용자 메시지 임베딩",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1616,
        64
      ],
      "parameters": {
        "url": "https://api.together.xyz/v1/embeddings",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "BAAI/bge-large-en-v1.5"
            },
            {
              "name": "input",
              "value": "={{ $json.chatInput }}"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "ePx2TlbqIiRjDGfW",
          "name": "Together API"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d8dba80c-597e-470b-852b-6d53363238bc",
      "name": "Google Gemini 채팅 모델",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        2272,
        288
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "qsaK3VMNWQDWLweQ",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f74c0006-15e0-4f48-8c02-b0b765154c5b",
      "name": "AI 에이전트",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2272,
        64
      ],
      "parameters": {
        "text": "=You are a helpful and professional customer support agent. Use the following context to answer the user's question. \n\nHandle greetings without the need of the context...\n\nContext:\n{{ $json.chunk }}\n\nUser's message:\n{{ $('When chat message received').item.json.chatInput }}\n\nFormat your reply in WhatsApp style:\n- Use _italics_ for emphasis\n- Use *bold* for key points\n- Use • for bullet lists (no markdown dashes or hashes)\n- Keep responses short, clear, and conversational, like real WhatsApp support\n- Avoid markdown headers or code blocks\n\nGive a clear, accurate, and friendly response based only on the context.  \nIf the answer cannot be found in the context, reply: _\"I don't know based on the provided information.\"_\n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "81c63733-c5c8-4a4d-b634-e3d93d9bb1c6",
      "name": "PDF 파일에서 텍스트 추출",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        2000,
        -496
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "490c541e-fae8-4965-9840-9e13d562acdd",
      "name": "채팅 메시지 수신 시",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        1392,
        64
      ],
      "webhookId": "2032c492-7d92-4d79-b545-5e0b9807253f",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "8add4f5e-d2f8-4ea8-a6e1-6d4912d60393",
      "name": "스티키 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        -768
      ],
      "parameters": {
        "width": 1584,
        "height": 512,
        "content": "### Part 1: Feeding the AI Knowledge (The \"Librarian\" part)\n\nThis part of the workflow runs whenever someone uploads a new PDF contract using your Jotform form. Its only job is to read, understand, and store the information from that document.\n\n* A user uploads a PDF contract through a JotForm, which is then downloaded.\n* The system extracts the raw text and splits it into smaller, more manageable chunks.\n* Each text chunk is converted into a numerical representation, called an embedding, that captures its semantic meaning.\n* These embeddings and their original text are stored in a Supabase vector database, effectively creating a searchable knowledge library.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d764c67f-cca8-476e-8d63-78d2733f6b64",
      "name": "스티키 노트1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        -208
      ],
      "parameters": {
        "width": 1600,
        "height": 656,
        "content": "---\n\n### Part 2: Asking the AI a Question (The \"Researcher\" part)\n\nThis part of the workflow runs whenever a user sends a message in a chat interface. Its job is to find the right information from the library and generate an answer.\n\n* A user asks a question, which the system converts into a numerical embedding to understand its meaning.\n* This embedding is used to search a vector database, retrieving the most relevant chunks of text from the stored documents.\n* The retrieved text chunks are then provided to an AI agent as the sole context for answering the question.\n* The AI generates a precise and accurate answer based only on the provided context, ensuring it doesn't invent information."
      },
      "typeVersion": 1
    },
    {
      "id": "d1f68d16-6baa-4420-8606-dbc7ca5791c7",
      "name": "JotForm 트리거",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        1376,
        -496
      ],
      "webhookId": "52c8e2e7-7277-4dfd-8336-c3857f945102",
      "parameters": {
        "form": "252862840518058",
        "onlyAnswers": false
      },
      "credentials": {
        "jotFormApi": {
          "id": "4612J1BsqtC505ac",
          "name": "secondary"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8f035b6b-c3c0-449a-acb4-0c359c309e32",
      "name": "새 지식베이스 가져오기",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1584,
        -496
      ],
      "parameters": {
        "url": "=https://api.jotform.com/submission/{{ $json.submissionID }}?apiKey=enter-your-jotfomr-api",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "b826edc5-d97f-498c-bea1-b3f3d1430635",
      "name": "업로드된 지식베이스 파일 링크 가져오기",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1792,
        -496
      ],
      "parameters": {
        "url": "={{ $json.content.answers['6'].answer[0] }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "APIKEY",
              "value": "enter-your-jotfomr-api"
            }
          ]
        }
      },
      "typeVersion": 4.2
    }
  ],
  "pinData": {},
  "connections": {
    "f74c0006-15e0-4f48-8c02-b0b765154c5b": {
      "main": [
        []
      ]
    },
    "3a39d174-434e-4c81-921c-8a354fad5ebe": {
      "main": [
        [
          {
            "node": "f74c0006-15e0-4f48-8c02-b0b765154c5b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d1f68d16-6baa-4420-8606-dbc7ca5791c7": {
      "main": [
        [
          {
            "node": "8f035b6b-c3c0-449a-acb4-0c359c309e32",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4ce2ab5b-bb1e-46ce-9dd8-2cfdee5510a2": {
      "main": [
        [
          {
            "node": "3a39d174-434e-4c81-921c-8a354fad5ebe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "76c8df3f-cf64-4848-b077-d04e9de88d12": {
      "main": [
        [
          {
            "node": "4ce2ab5b-bb1e-46ce-9dd8-2cfdee5510a2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1c57da69-7af2-47c8-8bc2-92e49449bd81": {
      "main": [
        [
          {
            "node": "d5ed1aaf-6089-4731-980d-b5c356b22403",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8f035b6b-c3c0-449a-acb4-0c359c309e32": {
      "main": [
        [
          {
            "node": "b826edc5-d97f-498c-bea1-b3f3d1430635",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d8dba80c-597e-470b-852b-6d53363238bc": {
      "ai_languageModel": [
        [
          {
            "node": "f74c0006-15e0-4f48-8c02-b0b765154c5b",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "81c63733-c5c8-4a4d-b634-e3d93d9bb1c6": {
      "main": [
        [
          {
            "node": "1c57da69-7af2-47c8-8bc2-92e49449bd81",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "490c541e-fae8-4965-9840-9e13d562acdd": {
      "main": [
        [
          {
            "node": "76c8df3f-cf64-4848-b077-d04e9de88d12",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d5ed1aaf-6089-4731-980d-b5c356b22403": {
      "main": [
        [
          {
            "node": "0b1c609f-e335-4541-8dae-e3517ec4bb63",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b826edc5-d97f-498c-bea1-b3f3d1430635": {
      "main": [
        [
          {
            "node": "81c63733-c5c8-4a4d-b634-e3d93d9bb1c6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

중급

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
중급
노드 수15
카테고리-
노드 유형10
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34