8
n8n 한국어amn8n.com

Google Drive를 사용하여 RAG 챗봇을 구축합니다.

고급

이것은Miscellaneous, AI RAG, Multimodal AI분야의자동화 워크플로우로, 20개의 노드를 포함합니다.주로 Set, Supabase, GoogleDrive, SplitInBatches, Agent 등의 노드를 사용하며. OpenAI, Google Drive, Supabase를 사용하여 RAG 지식 챗봇을 구축합니다.

사전 요구사항
  • Supabase URL과 API Key
  • Google Drive API 인증 정보
  • OpenAI API Key
  • PostgreSQL 데이터베이스 연결 정보
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "6naAx0wcjHZbs2pM",
  "meta": {
    "instanceId": "d4f16bea1a8eb4bd7217a4d0fe9a09f643e7227b28772e65da5a86a149783124",
    "templateCredsSetupCompleted": true
  },
  "name": "RAG chatbot using Google Drive",
  "tags": [],
  "nodes": [
    {
      "id": "4191c842-b484-467e-bea5-d2ff44af79e0",
      "name": "완전 설정 가이드",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        -176
      ],
      "parameters": {
        "color": 2,
        "width": 760,
        "height": 908,
        "content": "## 🚀 COMPLETE SETUP GUIDE - READ FIRST!\n\n### Step 1: Required Services\n1. **Google Drive** - For document storage\n2. **OpenAI Account** - For embeddings and chat (API key required)\n3. **Supabase Account** - For vector database (free tier OK)\n4. **PostgreSQL Database** - For chat memory (can use Supabase or separate)\n\n### Step 2: Supabase Vector Database Setup\nRun these SQL commands in Supabase SQL editor:\nhttps://supabase.com/docs/guides/ai/langchain?database-method=sql\n\n### Step 3: Credentials Setup\n1. **Google Drive OAuth2** - Enable Drive API, create OAuth2 credentials\n2. **OpenAI API** - Get API key from OpenAI dashboard\n3. **Supabase API** - Get URL and service role key from project settings\n4. **PostgreSQL** - Use Supabase connection string or separate DB\n\n### Step 4: Configure Workflow\n1. Update Google Drive folder IDs in both trigger nodes\n2. Ensure all credential connections are set\n3. Test with a single PDF file first\n\n### Step 5: Testing\n1. Upload a document to your Google Drive folder\n2. Check Supabase documents table for new entries\n3. Activate workflow and test chat interface\n4. Ask questions about your document content\n\n### 📋 Quick Checklist:\n☐ Supabase database and functions created\n☐ Google Drive folder IDs configured\n☐ All 4 credentials added to n8n\n☐ Test PDF uploaded to Drive folder\n☐ Workflow activated successfully\n☐ Chat interface responding correctly"
      },
      "typeVersion": 1
    },
    {
      "id": "5e8a89f6-ef3c-4691-959f-e1a6870f8b97",
      "name": "스티키 노트1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        -176
      ],
      "parameters": {
        "color": 4,
        "width": 2020,
        "height": 820,
        "content": "## Data Ingestion: Adding Google Drive PDF files to Vector DB"
      },
      "typeVersion": 1
    },
    {
      "id": "e833cbb0-3dde-4d15-bd0d-ee3d53b976c0",
      "name": "파일 업데이트됨",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        976,
        192
      ],
      "parameters": {
        "event": "fileUpdated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID",
          "cachedResultUrl": "https://drive.google.com/drive/folders/YOUR_FOLDER_ID",
          "cachedResultName": "Your Watch Folder"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0b1d7b3b-1840-4f82-b4e8-3f3dd9c22c38",
      "name": "파일 ID 설정",
      "type": "n8n-nodes-base.set",
      "position": [
        1232,
        16
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "79e9c100-c2d0-4fbd-97da-b2559a263eaa",
              "name": "file_id",
              "type": "string",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ed7a80c0-893d-41a5-b5c2-1b7ea5c6c64a",
      "name": "파일에서 추출",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        2352,
        16
      ],
      "parameters": {
        "options": {},
        "operation": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "0f4833f8-ac06-4069-b935-d4c80fcaae97",
      "name": "Supabase 벡터 저장소",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        2576,
        16
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "queryName": "match_documents"
        },
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "documents",
          "cachedResultName": "documents"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e5c920c4-06d4-4ed4-8ab7-e7271c7aa495",
      "name": "기본 데이터 로더",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        2624,
        304
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "file_id",
                "value": "={{ $('Set File ID').item.json.file_id }}"
              }
            ]
          }
        },
        "jsonData": "={{ $json.data }}",
        "jsonMode": "expressionData"
      },
      "typeVersion": 1
    },
    {
      "id": "15b7a747-6c48-4980-b9fe-342ef2695290",
      "name": "재귀 문자 텍스트 분할기",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        2624,
        512
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "0bd90ef9-eadd-40ee-a355-679c25ea00b8",
      "name": "파일 생성됨",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        976,
        -96
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID_2",
          "cachedResultUrl": "https://drive.google.com/drive/folders/YOUR_FOLDER_ID_2",
          "cachedResultName": "Your Second Watch Folder"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b7b355c9-f5b9-4284-8279-4ef65e9fafae",
      "name": "OpenAI 임베딩",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        2432,
        304
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "e9d25ee5-28f0-445d-9fff-4ddb0fdc253f",
      "name": "항목 순환 처리",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1472,
        16
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "4e46f442-6012-4144-924b-4987caee00f1",
      "name": "행 삭제",
      "type": "n8n-nodes-base.supabase",
      "position": [
        1776,
        -16
      ],
      "parameters": {
        "tableId": "documents",
        "operation": "delete",
        "filterType": "string",
        "filterString": "=metadata->>file_id=like.*{{ $json.file_id }}*"
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "32a5b87c-2082-4784-8fda-9d2b216b9692",
      "name": "파일 다운로드",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2096,
        -16
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set File ID').item.json.file_id }}"
        },
        "options": {
          "googleFileConversion": {
            "conversion": {
              "docsToFormat": "text/plain"
            }
          }
        },
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "ce5c5e25-7b29-43ca-ae6c-37478f7311b6",
      "name": "스티키 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        672
      ],
      "parameters": {
        "width": 1160,
        "height": 700,
        "content": "## Conversational RAG AI agent"
      },
      "typeVersion": 1
    },
    {
      "id": "cab8ef92-84f1-40b1-ab48-60be42f2af2a",
      "name": "Postgres 채팅 메모리",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        1488,
        1056
      ],
      "parameters": {
        "sessionKey": "={{ $json.user}}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "a7d2d794-0989-4cb3-bae7-8c3cd8efce94",
      "name": "OpenAI 채팅 모델",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1376,
        1056
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "a43a8218-e3ff-41b3-aa7b-a2a77f565a74",
      "name": "채팅 메시지 수신 시",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        1088,
        816
      ],
      "webhookId": "5ee7ed2e-2827-41c2-9dfc-5490a9a40825",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "d72474db-da71-4ae5-9fbc-ab575842a5e1",
      "name": "RAG 벡터 저장소",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        1696,
        1008
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 6,
        "options": {
          "queryName": "match_documents"
        },
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "documents",
          "cachedResultName": "documents"
        },
        "toolDescription": "Use this knowledge base to answer questions from the user",
        "includeDocumentMetadata": false
      },
      "typeVersion": 1.3
    },
    {
      "id": "af193ff9-dfce-423f-a7b6-28b4be9d3a50",
      "name": "RAG AI 에이전트",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1392,
        816
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are an intelligent AI assistant connected to a dynamic knowledge base stored in a Supabase vector store. The information in this knowledge base can vary depending on the user and the data they have provided.\nInstructions:\nWhenever you receive a question, always search the knowledge base using the connected tool to retrieve relevant information before answering.\nIf a user asks what you can help with, or about your capabilities, query the knowledge base for a summary or list of available topics, documents, or areas of expertise.\nClearly mention that your abilities depend on the information currently available in the knowledge base, and provide specific examples or categories based on the retrieved data.\nIf the knowledge base is empty or does not contain relevant information, politely inform the user that you currently have no data to assist with their request.\nExample Behaviors:\nIf asked, \"What can you help me with?\"\n\n→ Search the knowledge base for available topics or documents and respond with a summary, e.g.,\n\n\"Based on the current knowledge base, I can assist you with topics such as [Topic A], [Topic B], and [Topic C]. Please let me know what you'd like to know more about!\"\nIf asked a specific question,\n\n→ Retrieve relevant information from the knowledge base and answer accordingly, citing the source or context if appropriate.\nIf the knowledge base is empty,\n\n→ \"I currently do not have any information in my knowledge base. Please add some data or let me know how I can assist you further.\"\nAlways ensure your responses are based on the most recent and relevant information from the knowledge base.\n"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "6ce5b725-2692-4dee-8100-72fe32cfacd1",
      "name": "OpenAI1 임베딩",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1680,
        1168
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "7502b182-44d3-4034-b44d-a50ba225cd07",
  "connections": {
    "0b1d7b3b-1840-4f82-b4e8-3f3dd9c22c38": {
      "main": [
        [
          {
            "node": "e9d25ee5-28f0-445d-9fff-4ddb0fdc253f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4e46f442-6012-4144-924b-4987caee00f1": {
      "main": [
        [
          {
            "node": "32a5b87c-2082-4784-8fda-9d2b216b9692",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0bd90ef9-eadd-40ee-a355-679c25ea00b8": {
      "main": [
        [
          {
            "node": "0b1d7b3b-1840-4f82-b4e8-3f3dd9c22c38",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e833cbb0-3dde-4d15-bd0d-ee3d53b976c0": {
      "main": [
        [
          {
            "node": "0b1d7b3b-1840-4f82-b4e8-3f3dd9c22c38",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e9d25ee5-28f0-445d-9fff-4ddb0fdc253f": {
      "main": [
        [],
        [
          {
            "node": "4e46f442-6012-4144-924b-4987caee00f1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d72474db-da71-4ae5-9fbc-ab575842a5e1": {
      "ai_tool": [
        [
          {
            "node": "af193ff9-dfce-423f-a7b6-28b4be9d3a50",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "32a5b87c-2082-4784-8fda-9d2b216b9692": {
      "main": [
        [
          {
            "node": "ed7a80c0-893d-41a5-b5c2-1b7ea5c6c64a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b7b355c9-f5b9-4284-8279-4ef65e9fafae": {
      "ai_embedding": [
        [
          {
            "node": "0f4833f8-ac06-4069-b935-d4c80fcaae97",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "ed7a80c0-893d-41a5-b5c2-1b7ea5c6c64a": {
      "main": [
        [
          {
            "node": "0f4833f8-ac06-4069-b935-d4c80fcaae97",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a7d2d794-0989-4cb3-bae7-8c3cd8efce94": {
      "ai_languageModel": [
        [
          {
            "node": "af193ff9-dfce-423f-a7b6-28b4be9d3a50",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "6ce5b725-2692-4dee-8100-72fe32cfacd1": {
      "ai_embedding": [
        [
          {
            "node": "d72474db-da71-4ae5-9fbc-ab575842a5e1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "e5c920c4-06d4-4ed4-8ab7-e7271c7aa495": {
      "ai_document": [
        [
          {
            "node": "0f4833f8-ac06-4069-b935-d4c80fcaae97",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "cab8ef92-84f1-40b1-ab48-60be42f2af2a": {
      "ai_memory": [
        [
          {
            "node": "af193ff9-dfce-423f-a7b6-28b4be9d3a50",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "0f4833f8-ac06-4069-b935-d4c80fcaae97": {
      "main": [
        [
          {
            "node": "e9d25ee5-28f0-445d-9fff-4ddb0fdc253f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a43a8218-e3ff-41b3-aa7b-a2a77f565a74": {
      "main": [
        [
          {
            "node": "af193ff9-dfce-423f-a7b6-28b4be9d3a50",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "15b7a747-6c48-4980-b9fe-342ef2695290": {
      "ai_textSplitter": [
        [
          {
            "node": "e5c920c4-06d4-4ed4-8ab7-e7271c7aa495",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

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

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

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

고급 - 기타, AI RAG, 멀티모달 AI

유료인가요?

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

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

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

저자
Babish Shrestha

Babish Shrestha

@bbz

I’m currently obsessed with building cool things using AI automation and AI agents — systems that save time, cut manual work, and actually do stuff on their own. If there’s a way to automate it, I’m probably already trying it out (or planning to). Having worked in IT industry for 15 years, I’m combining that background with AI to help businesses move smarter, not just faster.

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34