RAG Customer Support Agent — Gmail support with Pinecone RAG — auto-send normal mail, draft critical cases.

RAG Customer Support Agent

Gmail support with Pinecone RAG — auto-send normal mail, draft critical cases.

n8nOpenAIPineconeGmailGoogle DriveLangChain

Overview

A customer support agent for an e-commerce florist: company docs live in Pinecone via a Google Drive ingestion pipeline, and incoming Gmail is classified for urgency, answered from the knowledge base, auto-sent when confidence is high, or drafted with manager alerts when critical.

Problem

Support inboxes fill with pricing, delivery, and complaint emails. Agents repeat the same answers, and urgent cases need escalation without slowing routine replies.

Solution

Indexed product, FAQ, and delivery content from Google Drive into Pinecone. The Gmail agent retrieves answers via RAG, returns structured urgency and confidence scores, sends normal replies automatically, creates drafts for critical threads, and notifies managers on low-confidence or angry customers.

Architecture

Separate ingestion workflow: Drive folder scan, download, chunk, embed with OpenAI, upsert to Pinecone. Main workflow: Gmail trigger, LangChain agent with Pinecone retrieve-as-tool, structured JSON output, branching on urgency and confidence, Gmail send or draft plus alert paths.

Workflow

  1. 01 Sync knowledge files from Google Drive to Pinecone
  2. 02 New Gmail triggers the support agent
  3. 03 Agent retrieves florist data and drafts structured reply
  4. 04 Normal + high confidence → auto-send
  5. 05 Critical or low confidence → draft + manager alert

Results

  • · Routine support answered from an owned knowledge base
  • · Critical orders and complaints escalated instead of auto-sent
  • · Confidence scoring reduces wrong automatic replies
  • · Knowledge stays updatable by re-running ingestion

Want something similar?

Let's talk about your project.

Start a project