8
n8n 한국어amn8n.com

Gemini 2.5, RAG 및 Cohere 재배열 기반 Gmail 고객 서비스 에이전트

중급

이것은자동화 워크플로우로, 12개의 노드를 포함합니다.주로 Gmail, GmailTrigger, Agent, RerankerCohere, EmbeddingsOpenAi 등의 노드를 사용하며. Gemini 2.5, RAG, Cohere 재순위 기반 Gmail 고객 서비스 에이전트

사전 요구사항
  • Google 계정 및 Gmail API 인증 정보
  • OpenAI API Key
  • Google Gemini API Key
  • PostgreSQL 데이터베이스 연결 정보
  • Pinecone API Key

카테고리

-
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "meta": {
    "instanceId": "3d7eb9567ae690bf8c9bba1cb43396e6e40c18e15eb5889cf9673ed1713da6db",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "113d6fd7-2850-4562-adad-d664ba8dc448",
      "name": "Gmail 트리거",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        3104,
        2080
      ],
      "parameters": {
        "simple": false,
        "filters": {},
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "JpuoplF0PostDvKB",
          "name": "Gmail account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "d1d4a3be-70bc-436b-a7b9-2ee00e426a55",
      "name": "Gemini 2.5",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        3312,
        2288
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "7v8o9EaQkl33woxm",
          "name": "v9"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dd551d6b-adb2-473b-8982-8ac9b3be46b3",
      "name": "Gmail 회신",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3664,
        2080
      ],
      "webhookId": "781b8efc-e90e-4f90-98f1-d92c2a42f088",
      "parameters": {
        "message": "={{ $json.output }}",
        "options": {
          "appendAttribution": false
        },
        "emailType": "text",
        "messageId": "={{ $('Gmail Trigger').item.json.id }}",
        "operation": "reply"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "JpuoplF0PostDvKB",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "32c51c6d-4ba8-45c4-b689-a7906d5a66b6",
      "name": "Cohere Reranker",
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "position": [
        3744,
        2448
      ],
      "parameters": {},
      "credentials": {
        "cohereApi": {
          "id": "5UlwdPGx9tyNlbT4",
          "name": "CohereAI"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5a55a56f-07f0-4da9-b333-be81d39c49c7",
      "name": "Pinecone 검색기",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        3568,
        2288
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 10,
        "options": {},
        "useReranker": true,
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "agency-info",
          "cachedResultName": "agency-info"
        },
        "toolDescription": "Info About <agency> services, owner and general FAQ"
      },
      "credentials": {
        "pineconeApi": {
          "id": "2ZmkLkdFEmSRzqgm",
          "name": "PineconeApi"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "fd1413ab-433f-43f0-9dbf-6726c62fac44",
      "name": "OpenAI 임베딩",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        3568,
        2448
      ],
      "parameters": {
        "model": "text-embedding-3-large",
        "options": {
          "dimensions": 1024
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "ymMvgDroJHalwvRf",
          "name": "OpenAI"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b587ef62-ec9c-4727-ac16-6e5b2862fe78",
      "name": "이메일 지원 에이전트",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3312,
        2080
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "You are an email support agent for the agency. Use the pinecone tool to access its knowledge base."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "11ccc8a7-11fb-4bbc-8593-7d203de1614e",
      "name": "Postgres 메모리",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        3408,
        2384
      ],
      "parameters": {
        "tableName": "email_support_agent_",
        "sessionKey": "={{ $json.id }}",
        "sessionIdType": "customKey"
      },
      "credentials": {
        "postgres": {
          "id": "TDX9l1042HXNo9nB",
          "name": "Neon - n8n chat"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "e2482901-3f58-4adb-817d-cbd48f777f7b",
      "name": "참고: Pinecone",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3856,
        2128
      ],
      "parameters": {
        "color": 2,
        "width": 350,
        "height": 240,
        "content": "## 🗄️ Node: Pinecone Retriever\n\n**Purpose:** RAG tool retrieves top 10 docs from 'agency-info' index.\n\n**Key Settings:**\n- Mode: retrieve-as-tool\n- Embeddings: OpenAI text-embedding-3-large (1024 dims)\n- Reranker: Cohere enabled\n\n**Note:** Pre-populate index with agency knowledge base."
      },
      "typeVersion": 1
    },
    {
      "id": "95398a05-9d35-4913-83ab-62bb9113594b",
      "name": "참고: Cohere",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3472,
        2592
      ],
      "parameters": {
        "color": 3,
        "width": 398,
        "height": 244,
        "content": "## 🔄 Node: Cohere Reranker\n\n**Purpose:** Semantically reorders Pinecone results for better relevance.\n\n**Key Settings:**\n- Connected to vector store\n- Improves RAG accuracy\n\n**Note:** Uses Cohere API; monitor token usage."
      },
      "typeVersion": 1
    },
    {
      "id": "f578bcf8-4019-4c0e-abe3-78dc5b85c026",
      "name": "참고: 에이전트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3088,
        1792
      ],
      "parameters": {
        "color": 5,
        "width": 398,
        "height": 252,
        "content": "## 🤖 Node: Email Support Agent\n\n**Purpose:** AI agent processes email with tools/memory.\n\n**Key Settings:**\n- User Prompt: Email text\n- LLM: Gemini 2.5\n- Memory: Postgres per email ID\n\n**Note:** Outputs reply text for Gmail."
      },
      "typeVersion": 1
    },
    {
      "id": "ab002e7f-180b-439d-a544-a9daae2d68c5",
      "name": "개요 참고1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2256,
        1712
      ],
      "parameters": {
        "color": 4,
        "width": 728,
        "height": 1480,
        "content": "# AI Email Support Agent with RAG & Cohere Reranking\n\n## 📋 What This Template Does\nTriggers on new Gmail emails, uses a LangChain agent with Postgres memory to retrieve from Pinecone (RAG via OpenAI embeddings), reranks with Cohere for relevance, generates replies using Gemini 2.5, and auto-responds.\n\n## 🔧 Prerequisites\n- n8n instance with LangChain nodes\n- Gmail, OpenAI, Cohere, Gemini, Pinecone, Postgres accounts\n\n## 🔑 Required Credentials\n\n### Gmail OAuth2\n1. Enable Gmail API in Google Cloud\n2. Create OAuth2 credential in n8n with scopes: https://www.googleapis.com/auth/gmail.readonly, https://www.googleapis.com/auth/gmail.send\n\n### OpenAI API\n1. Get API key from platform.openai.com\n2. Add as OpenAI credential\n\n### Cohere API\n1. Sign up at cohere.com\n2. Copy API key to n8n Cohere credential\n\n### Google Gemini API\n1. Generate key at https://aistudio.google.com/\n2. Add as Google PaLM credential\n\n### Pinecone API\n1. Create index \"agency-info\" (dimension 1024)\n2. Add API key to n8n Pinecone credential\n\n### Postgres\n1. Set up database (e.g., Neon/Supabase)\n2. Add connection details to n8n Postgres credential\n\n## ⚙️ Configuration Steps\n1. Import JSON into n8n\n2. Assign all credentials\n3. Populate Pinecone with agency docs (use separate upsert workflow)\n4. Set tableName in Memory if needed\n5. Activate and test with a sample email\n\n## 🎯 Use Cases\n- Automate agency support for FAQs/services\n- Handle client inquiries with context-aware replies\n- Scale email responses without human intervention\n\n## ⚠️ Troubleshooting\n- No trigger: Check Gmail scopes/polling\n- Retrieval empty: Verify Pinecone index/docs/dimensions\n- Rerank fails: Ensure Cohere key valid\n- Memory issues: Confirm Postgres connection/sessionKey"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "d1d4a3be-70bc-436b-a7b9-2ee00e426a55": {
      "ai_languageModel": [
        [
          {
            "node": "b587ef62-ec9c-4727-ac16-6e5b2862fe78",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "113d6fd7-2850-4562-adad-d664ba8dc448": {
      "main": [
        [
          {
            "node": "b587ef62-ec9c-4727-ac16-6e5b2862fe78",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "32c51c6d-4ba8-45c4-b689-a7906d5a66b6": {
      "ai_reranker": [
        [
          {
            "node": "5a55a56f-07f0-4da9-b333-be81d39c49c7",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "11ccc8a7-11fb-4bbc-8593-7d203de1614e": {
      "ai_memory": [
        [
          {
            "node": "b587ef62-ec9c-4727-ac16-6e5b2862fe78",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "fd1413ab-433f-43f0-9dbf-6726c62fac44": {
      "ai_embedding": [
        [
          {
            "node": "5a55a56f-07f0-4da9-b333-be81d39c49c7",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "5a55a56f-07f0-4da9-b333-be81d39c49c7": {
      "ai_tool": [
        [
          {
            "node": "b587ef62-ec9c-4727-ac16-6e5b2862fe78",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "b587ef62-ec9c-4727-ac16-6e5b2862fe78": {
      "main": [
        [
          {
            "node": "dd551d6b-adb2-473b-8982-8ac9b3be46b3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

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

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

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

중급

유료인가요?

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

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

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

저자
Daniel Nkencho

Daniel Nkencho

@daniel-automates

AI Automation Consultant | Helping Business Owners Implement AI Systems for growth and lead gen

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34