8
n8n 한국어amn8n.com

Weaviate와 OpenAI를 기반으로 한 RAG 문서 질문 응답

고급

이것은Document Extraction, Multimodal AI분야의자동화 워크플로우로, 17개의 노드를 포함합니다.주로 Set, FormTrigger, ExtractFromFile, ChatTrigger, LmChatOpenAi 등의 노드를 사용하며. 기반 RAG의 문서 질문 답변: Weaviate와 OpenAI를 사용한 PDF 내용 검색

사전 요구사항
  • OpenAI API Key
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "hWxVTNvDEcGofp5O",
  "meta": {
    "instanceId": "be3e0177f1eeda5879f300082f54531dfa9819a5d7441e94ea64b32f8b1fd49c",
    "templateCredsSetupCompleted": true
  },
  "name": "rag-with-weaviate",
  "tags": [],
  "nodes": [
    {
      "id": "4cfa559c-9cec-4a74-84d5-9cf4a2d7915a",
      "name": "Weaviate 벡터 저장소",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreWeaviate",
      "position": [
        432,
        288
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "textKey": "text"
        },
        "weaviateCollection": {
          "__rl": true,
          "mode": "id",
          "value": "FileUpload"
        }
      },
      "credentials": {
        "weaviateApi": {
          "id": "qiTSL6FfsPCZLyUv",
          "name": "Weaviate Credentials account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c87c8fe2-56bf-405f-a91a-3b1af7cf2e8c",
      "name": "기본 데이터 로더",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        512,
        496
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {}
            ]
          }
        },
        "jsonData": "={{ $json.text }}",
        "jsonMode": "expressionData"
      },
      "typeVersion": 1
    },
    {
      "id": "ac0c796a-3b1d-4ba6-83e5-23a673e4628d",
      "name": "임베딩 OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        384,
        496
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "v6dOwJXW6XXHxHQw",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d89bd8be-a275-4a57-a1a6-6006302ba3dd",
      "name": "재귀적 문자 텍스트 분할기1",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        544,
        656
      ],
      "parameters": {
        "options": {},
        "chunkSize": 500
      },
      "typeVersion": 1
    },
    {
      "id": "dcabfdff-749b-4442-933d-409b1479d2c8",
      "name": "파일에서 추출",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -48,
        288
      ],
      "parameters": {
        "options": {
          "maxPages": 99
        },
        "operation": "pdf",
        "binaryPropertyName": "PDF_File"
      },
      "typeVersion": 1
    },
    {
      "id": "779add5c-4770-472a-a2e9-934e1e2e4569",
      "name": "필드 편집",
      "type": "n8n-nodes-base.set",
      "position": [
        128,
        288
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d719d94d-6597-402c-8958-dd270de82ce6",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "eda536c5-d88f-45e4-9505-d3b1e6c5fa27",
      "name": "채팅 메시지 수신 시",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        992,
        288
      ],
      "webhookId": "683bf7e6-5f6f-43e0-afef-eb854d52ebed",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "94ed5f2b-fb86-42e8-a778-ab51d7a49d42",
      "name": "Weaviate 벡터 저장소1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreWeaviate",
      "position": [
        1280,
        624
      ],
      "parameters": {
        "options": {},
        "weaviateCollection": {
          "__rl": true,
          "mode": "list",
          "value": "FileUpload",
          "cachedResultName": "FileUpload"
        }
      },
      "credentials": {
        "weaviateApi": {
          "id": "qiTSL6FfsPCZLyUv",
          "name": "Weaviate Credentials account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "ae3a9b66-a5c8-4108-980c-1c3ace05e528",
      "name": "질문 및 응답 체인",
      "type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
      "position": [
        1168,
        288
      ],
      "parameters": {
        "text": "=Using only the attached Weaviate vector store collection (and no external knowledge), answer the following query:\n{{ $json.chatInput }}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "d9110fef-f3ae-4c3a-bfc0-b3bfe0f6fcb0",
      "name": "벡터 저장소 검색기",
      "type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
      "position": [
        1280,
        480
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "79aaa15c-f0d6-4c88-bd15-ff7835131b2b",
      "name": "OpenAI 채팅 모델",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1152,
        480
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "v6dOwJXW6XXHxHQw",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9f961ef2-5466-475d-9ccb-1436469dee00",
      "name": "임베딩 OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1360,
        768
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "v6dOwJXW6XXHxHQw",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d46d3a49-ec16-40aa-928e-291fc90b9f2d",
      "name": "스티커 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        176
      ],
      "parameters": {
        "color": 5,
        "width": 544,
        "height": 336,
        "content": "## Part 1: Manually upload data \nIn this example, we manually upload a 100+ page article from arXiv called [\"A Survey of Large Language Models\"](https://arxiv.org/pdf/2303.18223).\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n_**Note: This is a simple implementation of loading data. You can replace this block with your own (more advanced) data pipeline!**_"
      },
      "typeVersion": 1
    },
    {
      "id": "9b192882-6d54-43c5-9ccb-cca0bcf456f4",
      "name": "스티커 노트1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        176
      ],
      "parameters": {
        "color": 6,
        "width": 640,
        "height": 736,
        "content": "## Part 3: Perform RAG over PDF file with Weaviate\nEnter your query by running the Chat Node and get a RAG response grounded in context."
      },
      "typeVersion": 1
    },
    {
      "id": "431f55e3-9599-4de7-a363-2e82e6581101",
      "name": "스티커 노트3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -128
      ],
      "parameters": {
        "color": 4,
        "width": 992,
        "height": 288,
        "content": "# RAG over a PDF file with Weaviate\nThis workflow allows you to upload a PDF file and ask questions about it using the Question and Answer Chain and the Weaviate Vector Store nodes. \n\n## Prerequisites\n1.  **An existing Weaviate cluster.** You can view instructions for setting up a **local cluster** with Docker [here](https://weaviate.io/developers/weaviate/installation/docker-compose#starter-docker-compose-file) or a **Weaviate Cloud** cluster [here](https://weaviate.io/developers/wcs/quickstart).\n2.  **API keys** to generate embeddings and power chat models. We use [OpenAI](https://openai.com/), but feel free to switch out the models as you like.\n3.  **Self-hosted n8n instance.** See this [video](https://www.youtube.com/watch?v=kq5bmrjPPAY&t=108s) for how to get set up in just three minutes.\n\n\n💚  Sign up [here](https://console.weaviate.cloud/?utm_source=recipe&utm_campaign=n8n&utm_content=n8n_arxiv_template) for a 14-day free trial of Weaviate Cloud (no credit card required)."
      },
      "typeVersion": 1
    },
    {
      "id": "588d9eee-f769-4c6b-9b16-2b1790118a4d",
      "name": "PDF 업로드",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -224,
        288
      ],
      "webhookId": "8499e732-aff6-4e0f-85ac-4c0591012616",
      "parameters": {
        "options": {},
        "formTitle": "Upload your file here",
        "formFields": {
          "values": [
            {
              "fieldType": "file",
              "fieldLabel": "PDF File",
              "multipleFiles": false,
              "requiredField": true,
              "acceptFileTypes": ".pdf"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4d4244ef-c4af-4eb1-8389-6bd95cc5613e",
      "name": "스티커 노트2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        176
      ],
      "parameters": {
        "color": 3,
        "width": 624,
        "height": 688,
        "content": "## Part 2: Embed and load data into Weaviate collection\nWe generate embeddings for the full-text of the article and store them in Weaviate.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n_**Note: We don't add any metadata to Weaviate in this example. To add metadata, click on the Default Data Loader node → `Add Option` → `Metadata`.**_"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "61bb6430-21b1-4443-8924-34a83eab6965",
  "connections": {
    "588d9eee-f769-4c6b-9b16-2b1790118a4d": {
      "main": [
        [
          {
            "node": "dcabfdff-749b-4442-933d-409b1479d2c8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "779add5c-4770-472a-a2e9-934e1e2e4569": {
      "main": [
        [
          {
            "node": "4cfa559c-9cec-4a74-84d5-9cf4a2d7915a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ac0c796a-3b1d-4ba6-83e5-23a673e4628d": {
      "ai_embedding": [
        [
          {
            "node": "4cfa559c-9cec-4a74-84d5-9cf4a2d7915a",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "dcabfdff-749b-4442-933d-409b1479d2c8": {
      "main": [
        [
          {
            "node": "779add5c-4770-472a-a2e9-934e1e2e4569",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "79aaa15c-f0d6-4c88-bd15-ff7835131b2b": {
      "ai_languageModel": [
        [
          {
            "node": "ae3a9b66-a5c8-4108-980c-1c3ace05e528",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "9f961ef2-5466-475d-9ccb-1436469dee00": {
      "ai_embedding": [
        [
          {
            "node": "94ed5f2b-fb86-42e8-a778-ab51d7a49d42",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "c87c8fe2-56bf-405f-a91a-3b1af7cf2e8c": {
      "ai_document": [
        [
          {
            "node": "4cfa559c-9cec-4a74-84d5-9cf4a2d7915a",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "4cfa559c-9cec-4a74-84d5-9cf4a2d7915a": {
      "main": [
        []
      ]
    },
    "d9110fef-f3ae-4c3a-bfc0-b3bfe0f6fcb0": {
      "ai_retriever": [
        [
          {
            "node": "ae3a9b66-a5c8-4108-980c-1c3ace05e528",
            "type": "ai_retriever",
            "index": 0
          }
        ]
      ]
    },
    "94ed5f2b-fb86-42e8-a778-ab51d7a49d42": {
      "ai_vectorStore": [
        [
          {
            "node": "d9110fef-f3ae-4c3a-bfc0-b3bfe0f6fcb0",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "eda536c5-d88f-45e4-9505-d3b1e6c5fa27": {
      "main": [
        [
          {
            "node": "ae3a9b66-a5c8-4108-980c-1c3ace05e528",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d89bd8be-a275-4a57-a1a6-6006302ba3dd": {
      "ai_textSplitter": [
        [
          {
            "node": "c87c8fe2-56bf-405f-a91a-3b1af7cf2e8c",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

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

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

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

고급 - 문서 추출, 멀티모달 AI

유료인가요?

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

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

고급 사용자를 위한 16+개 노드의 복잡한 워크플로우

저자
Mary Newhauser

Mary Newhauser

@maryn

Machine Learning Engineer at Weaviate.

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34