8
n8n 한국어amn8n.com

OpenAI, RAG, MongoDB 벡터 임베딩을 사용하여 지식庫 챗봇을 구축합니다.

중급

이것은Support, AI분야의자동화 워크플로우로, 15개의 노드를 포함합니다.주로 GoogleDocs, ManualTrigger, Agent, ChatTrigger, LmChatOpenAi 등의 노드를 사용하며인공지능 기술을 결합하여 스마트 자동화를 구현합니다. OpenAI, RAG, MongoDB 벡터 임베딩을 사용하여 지식庫 챗봇을 구축합니다.

사전 요구사항
  • OpenAI API Key
  • MongoDB 연결 문자열

카테고리

워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "meta": {
    "instanceId": "074f90e2bb5206c5f405a8aac6551497c72005283a5405fb08207b1b3a78c2b8",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "5cb0a836-f9a1-4f92-9326-cd82a392d0da",
      "name": "지식 베이스 에이전트",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        220,
        0
      ],
      "parameters": {
        "text": "={{ $json.chatInput }}",
        "options": {
          "systemMessage": "You are the AI assistant for an internal support team at a technology company specializing in advanced software solutions. Your task is to assist internal users by consulting the official product documentation stored in the company’s knowledge base.\n\nAvailable references:\n\nproductDocs: Step-by-step guides, technical configurations, and official manuals extracted from the product’s documentation.\n\nBehavior rules for answering questions:\nAlways consult the official product documentation first using the productDocs tool.\n\nRespond clearly and directly, explaining how to do what is requested.\n\nDo not filter by category unless explicitly asked by the user.\n\nDetect the language of each incoming message individually and respond in that language. Do not use prior conversation language or history to decide the response language.\n\nNever provide links, even if requested. If a user asks for a link, reply:\n“I cannot provide links. If you need specific information, please let me know and I will help with the details.”\n\nUse a professional, direct, and human tone.\n\nKeep answers between 2 and 4 lines unless the user requests more detail.\n\nDo not invent information that is not in the knowledge base.\n\nIf you give numbered steps or lists, number them sequentially (1, 2, 3...) without skipping or repeating numbers, even if the source content uses different numbering."
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "56e6fb75-6a97-4466-9e7f-70710c2740d7",
      "name": "OpenAI 채팅 모델",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        60,
        240
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "cJRah9hGPQ7eX4jd",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e352c32e-7108-4a0d-b081-b2532d96d092",
      "name": "임베딩 OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        680,
        380
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "cJRah9hGPQ7eX4jd",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "74bbfb00-1a00-4131-a291-bce5b79628b4",
      "name": "워크플로 실행 시",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -60,
        -420
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f720a4b0-6239-4a0b-bb61-1e43f78f8e40",
      "name": "심플 메모리",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        320,
        220
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "94561d61-4a01-48b6-b114-dc4d47546ff3",
      "name": "MongoDB 벡터 검색",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas",
      "position": [
        560,
        220
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "toolName": "productDocs",
        "mongoCollection": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-template",
          "cachedResultName": "n8n-template"
        },
        "toolDescription": "retreive documentation",
        "vectorIndexName": "data_index"
      },
      "credentials": {
        "mongoDb": {
          "id": "7riubYENUDZsmjyK",
          "name": "MongoDB account 2"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "c473c33d-5681-4f3a-ac36-0d3012e7251f",
      "name": "문서 섹션 로더",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        740,
        -260
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "doc_id",
                "value": "={{ $json.documentId }}"
              }
            ]
          }
        },
        "jsonData": "={{ $json.content }}",
        "jsonMode": "expressionData"
      },
      "typeVersion": 1
    },
    {
      "id": "321222cb-1daf-4be2-a6ca-1a03d24f670f",
      "name": "문서 청커",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        860,
        -100
      ],
      "parameters": {
        "options": {
          "splitCode": "markdown"
        },
        "chunkSize": 3000,
        "chunkOverlap": 200
      },
      "typeVersion": 1
    },
    {
      "id": "716519f5-cec1-4bfe-afbe-614fc23e74b5",
      "name": "MongoDB 벡터 스토어 인서터",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas",
      "position": [
        540,
        -420
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "mongoCollection": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-template",
          "cachedResultName": "n8n-template"
        },
        "vectorIndexName": "data_index"
      },
      "credentials": {
        "mongoDb": {
          "id": "7riubYENUDZsmjyK",
          "name": "MongoDB account 2"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "a49c19fc-f5f5-4381-b6ba-1bfc12b96135",
      "name": "OpenAI 임베딩 생성기",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        480,
        -180
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "cJRah9hGPQ7eX4jd",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6de724d5-2941-4e72-af8b-302ca2cf2ca0",
      "name": "Google 문서 임포터",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        200,
        -420
      ],
      "parameters": {
        "operation": "get",
        "documentURL": "https://docs.google.com/document/d/1gvgp71e9edob8WLqFIYCdzC7kUq3pLO37VKb-a-vVW4/edit?tab=t.0"
      },
      "credentials": {
        "googleDocsOAuth2Api": {
          "id": "FNXMwqMf7vl1WUFj",
          "name": "Google Docs account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "4f30bb21-72f0-4d13-b610-2ec218ad31b1",
      "name": "스티키 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        -440
      ],
      "parameters": {
        "color": 5,
        "content": "Run this workflow manually to import and index Google Docs product documentation into MongoDB with vector embeddings for fast search."
      },
      "typeVersion": 1
    },
    {
      "id": "25fd33d5-041b-4f01-a46b-1bacabd88376",
      "name": "채팅 메시지 수신 시",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        40,
        0
      ],
      "webhookId": "427ead97-647d-49c7-82d7-e76b40664fd1",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "f1f3fadd-d5e6-45df-b810-1616531dffcb",
      "name": "스티키 노트1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        40
      ],
      "parameters": {
        "color": 4,
        "content": "This workflow uses retrieval-augmented generation (RAG) to answer user questions by searching the MongoDB vector store and generating AI responses with context."
      },
      "typeVersion": 1
    },
    {
      "id": "39eee95c-b332-4ae4-bde9-aaf0fe5e0546",
      "name": "스티키 노트2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1060,
        -380
      ],
      "parameters": {
        "height": 520,
        "content": "Search Index Example \n\n{\n  \"mappings\": {\n    \"dynamic\": false,\n    \"fields\": {\n      \"_id\": {\n        \"type\": \"string\"\n      },\n      \"text\": {\n        \"type\": \"string\"\n      },\n      \"embedding\": {\n        \"type\": \"knnVector\",\n        \"dimensions\": 1536,\n        \"similarity\": \"cosine\"\n      },\n      \"source\": {\n        \"type\": \"string\"\n      },\n      \"doc_id\": {\n        \"type\": \"string\"\n      }\n    }\n  }\n}\n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "f720a4b0-6239-4a0b-bb61-1e43f78f8e40": {
      "ai_memory": [
        [
          {
            "node": "5cb0a836-f9a1-4f92-9326-cd82a392d0da",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "321222cb-1daf-4be2-a6ca-1a03d24f670f": {
      "ai_textSplitter": [
        [
          {
            "node": "c473c33d-5681-4f3a-ac36-0d3012e7251f",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "e352c32e-7108-4a0d-b081-b2532d96d092": {
      "ai_embedding": [
        [
          {
            "node": "94561d61-4a01-48b6-b114-dc4d47546ff3",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "56e6fb75-6a97-4466-9e7f-70710c2740d7": {
      "ai_languageModel": [
        [
          {
            "node": "5cb0a836-f9a1-4f92-9326-cd82a392d0da",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "6de724d5-2941-4e72-af8b-302ca2cf2ca0": {
      "main": [
        [
          {
            "node": "716519f5-cec1-4bfe-afbe-614fc23e74b5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5cb0a836-f9a1-4f92-9326-cd82a392d0da": {
      "main": [
        []
      ]
    },
    "94561d61-4a01-48b6-b114-dc4d47546ff3": {
      "ai_tool": [
        [
          {
            "node": "5cb0a836-f9a1-4f92-9326-cd82a392d0da",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "c473c33d-5681-4f3a-ac36-0d3012e7251f": {
      "ai_document": [
        [
          {
            "node": "716519f5-cec1-4bfe-afbe-614fc23e74b5",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "25fd33d5-041b-4f01-a46b-1bacabd88376": {
      "main": [
        [
          {
            "node": "5cb0a836-f9a1-4f92-9326-cd82a392d0da",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a49c19fc-f5f5-4381-b6ba-1bfc12b96135": {
      "ai_embedding": [
        [
          {
            "node": "716519f5-cec1-4bfe-afbe-614fc23e74b5",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "74bbfb00-1a00-4131-a291-bce5b79628b4": {
      "main": [
        [
          {
            "node": "6de724d5-2941-4e72-af8b-302ca2cf2ca0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

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

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

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

중급 - 지원, 인공지능

유료인가요?

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

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

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

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34