콘텐츠로 이동

Create This RAG n8n AI Agent in 30 Minutes (You'll Use This Daily)

원본 영상: Create This RAG n8n AI Agent in 30 Minutes (You’ll Use This Daily)

Google Drive → Pinecone → n8n AI 에이전트 파이프라인으로, 사내 문서에 기반해 질문에 답하고 팀 태스크까지 자동 생성하는 RAG 챗봇을 구축한다.

워크플로 1: 문서 수집 및 벡터 저장

  1. Google Drive 폴더를 트리거로 설정 — 파일 추가 감지 시 워크플로 시작
  2. n8n의 Google Drive 노드로 파일 다운로드
  3. Pinecone Vector Store 노드로 문서를 벡터 DB에 삽입
  4. Document Loader(바이너리 데이터)로 PDF 등 파일을 임베딩 가능한 형태로 변환
  5. Recursive Character Text Splitter로 텍스트를 의미 단위로 분할
  6. OpenAI text-embedding-3-small로 임베딩 생성

워크플로 2: RAG 챗봇 + 태스크 생성

  1. “On Chat Message” 트리거로 n8n 내장 채팅 인터페이스 활성화
  2. AI Agent 노드(Tools Agent 타입) 추가
  3. Chat Model: GPT-4o mini
  4. Memory: Window Buffer (최근 5개 메시지 기억)
  5. Tool 1 — Pinecone Vector Store Q&A: 질문을 임베딩해 관련 문서 청크 검색 후 답변 생성
  6. Tool 2 — Airtable: 고객 요청이 태스크이면 Airtable에 레코드 자동 생성
  7. System Prompt로 “질문은 Pinecone에서, 태스크 요청은 Airtable에” 규칙을 명시
항목설정값 / 기법
Google Drive 폴링 간격30분 (cron: */30 * * * *) — 1분 시 월 1,440×30 = 43,200 executions 초과 위험
Pinecone 임베딩 모델text-embedding-3-small (저장·검색 모두 동일 모델 필수)
Pinecone 네임스페이스용도별 분리 가능 (예: sales, customer-service)
Text Splitter 선택 이유Recursive Character — 문단/문장 경계 우선 분리로 의미 보존. Character Splitter는 문장 중간을 자를 수 있어 부적합
Airtable 필드 입력 방식{{ $fromAI("task_name", "이 태스크의 이름") }} 표현식 — AI가 대화 맥락에서 자동 추론해 채움
System Prompt 핵심 지시”모든 메시지마다 Pinecone 쿼리 필수”, “태스크 요청 시 Airtable 노드 호출 후 처리 중 안내”
  • 계약서 1건 업로드 시 Pinecone에 32개 청크로 분할 저장됨 (본인 실측)
  • n8n 기본 플랜: 월 2,500 executions — 1분 폴링 시 하루 1,440 소진으로 이틀 만에 한도 초과 (본인 계산)
  • 테스트 계약서 질의 예시: “이벤트 날짜” → November 11th, 2032 / “할인율” → 10% (본인 시연)

사용 도구

  • n8n (워크플로 자동화)
  • Google Drive (문서 소스 및 트리거)
  • Pinecone (벡터 DB)
  • OpenAI text-embedding-3-small + gpt-4o-mini
  • Airtable (태스크 관리)
  • 대안 채팅 인터페이스: Telegram 봇, Twilio SMS

Airtable Tool 프롬프트 패턴

{{ $fromAI("task_name", "the name of the task") }}
{{ $fromAI("task_description", "the description of the task") }}

System Prompt 패턴 (최종)

You are a helpful assistant. Please answer any and all questions from the user
to the best of your ability. For every message, please query Pinecone to find
the right solution. If the user has any tasks for you to complete, please call
the Airtable tool and notify the user that we are currently working on the task
and will let them know when it's done.

확장 가능 방향: Airtable 대신 CRM 업데이트, 잔액 청구서 자동 발송, 팀 미팅 자동 예약 등 n8n 연동 앱 수천 개로 교체 가능.