AutomationMart
Home/Browse/Automated Gmail support agent with Gemini 2.5, RAG & Cohere reranking
n8n

Automated Gmail support agent with Gemini 2.5, RAG & Cohere reranking

n8nn8n8 modulesv1.0
agentembeddingsOpenAigmailgmailTriggerlmChatGoogleGeminimemoryPostgresChatrerankerCoherevectorStorePinecone

AI Email Support Agent with RAG & Cohere Reranking Transform your inbox into an intelligent support system: automatically detect new emails, retrieve relevant knowledge from Pinecone, rerank with Cohere for precision, generate contextual replies using Gemini AI, and respond—all while maintaining conversation history. What It Does This workflow triggers on incoming Gmail messages, leverages a LangChain agent with PostgreSQL memory for context, queries a Pinecone vector store (RAG) enhanced by Coh

At a glance

Automated Gmail support agent with Gemini 2.5, RAG & Cohere reranking is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects agent, embeddingsOpenAi, gmail, gmailTrigger. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
agent, embeddingsOpenAi, gmail, gmailTrigger, lmChatGoogleGemini, memoryPostgresChat
Modules
8
Price
Free
Version
v1.0
Automated Gmail support agent with Gemini 2.5, RAG & Cohere reranking workflow diagram

About this workflow

AI Email Support Agent with RAG & Cohere Reranking Transform your inbox into an intelligent support system: automatically detect new emails, retrieve relevant knowledge from Pinecone, rerank with Cohere for precision, generate contextual replies using Gemini AI, and respond—all while maintaining conversation history. What It Does This workflow triggers on incoming Gmail messages, leverages a LangChain agent with PostgreSQL memory for context, queries a Pinecone vector store (RAG) enhanced by Cohere reranking and OpenAI embeddings, crafts personalized responses via Gemini 2.5, and auto-replies to keep support flowing. Key Features - Gmail Integration - Real-time polling for new emails every minute - RAG with Pinecone - Retrieves top 10 relevant docs from "agency-info" index as agent tool - Cohere Reranking - Boosts retrieval accuracy by reordering results semantically - Persistent Memory - Postgres chat history keyed by email ID for ongoing threads - Gemini-Powered Agent - Handles queries with custom system prompt for agency support - Seamless Auto-Reply - Sends formatted text responses directly in Gmail Perfect For - Agencies: Automate client FAQs on services, pricing, and ownership - Support Teams: Scale responses without losing conversation context - Small Businesses: Handle inquiries 24/7 with AI-driven accuracy - Developers: Prototype RAG agents with vector stores and rerankers - Marketers: Personalize outreach replies based on knowledge base - Consultants: Quick, informed answers from internal docs Technical Highlights Built on n8n's LangChain ecosystem, this workflow highlights: - Trigger-to-response pipeline with polling and webhooks - Hybrid retrieval: Embeddings + vector search + semantic reranking - Stateful agents with database-backed memory for multi-turn chats - Multi-provider setup: OpenAI (embeddings), Cohere (rerank), Google (LLM) - Scalable for production with configurable topK and session keys Setup Instructions Prerequisites - n8n instance with LangChain nodes enabled - Accounts for: Gmail (OAuth2), OpenAI (API key), Cohere (API key), Google Gemini (API key), Pinecone (API key and index), Postgres (database connection, e.g., Neon or Supabase) Required Credentials Gmail OAuth2 1. Enable Gmail API in Google Cloud Console 2. Create OAuth2 credential in n8n with scopes: OpenAI API 1. Get API key from platform.openai.com 2. Add as OpenAI credential in n8n Cohere API 1. Sign up at cohere.com 2. Copy API key to n8n Cohere credential Google Gemini API 1. Generate key at 2. Add as Google PaLM credential in n8n (compatible with Gemini) Pinecone API 1. Create index "agency-info" with dimension 1024 2. Add API key to n8n Pinecone credential Postgres 1. Set up database (e.g., Neon/Supabase) with a table for chat history 2. Add connection details (host, database, user, password) to n8n Postgres credential Configuration Steps 1. Import the workflow JSON into your n8n instance 2. Assign all required credentials to the respective nodes 3. Populate the Pinecone "agency-info" index with your knowledge base documents (use a separate upsert workflow or Pinecone dashboard) 4. Customize the tableName in the Postgres Memory node if needed (default: "emailsupportagent") 5. Adjust the agent's system prompt or topK retrieval if required for your use case 6. Activate the workflow and test by sending a sample email to trigger it Troubleshooting - No trigger firing: Verify Gmail scopes and polling interval - Empty retrieval: Check Pinecone index population, dimensions (must be 1024), and document embeddings - Rerank errors: Ensure Cohere API key is valid and has sufficient quota - Memory issues: Confirm Postgres connection and that sessionKey uses email ID Perfect for deploying hands-off email automation. Import, connect credentials, and activate!

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Interactive recruitment customer service with WhatsApp, Google Sheets CRM

Recruitment Office WhatsApp Automation Automate WhatsApp communication for recruitment agencies with an interactive, structured customer experience. This workflow handles pricing inquiries, request submissions, tracking, complaints, and human escalation while maintaining full session tracking and media support. Good to know - Uses WhatsApp Interactive List Messages for user selection and navigation. - Includes session-state logic and memory across messages. - Includes a 5-minute cooldown to avoi

Free

Create an automated customer support assistant with GPT-4o and GoHighLevel SMS

AI Agent via GoHighLevel SMS with Website-Based Knowledgebase This n8n workflow enables an AI agent to interact with users through GoHighLevel SMS, leveraging a knowledgebase dynamically built by scraping the company's website. --- ❓ Problem It Solves Traditional customer support systems often require manual data entry and lack real-time updates from the company's website. This workflow automates the process by: - Scraping the company's website at set intervals to update the knowledgebase. - Int

Free

Create stunning AI images directly from WhatsApp with Gemini

Create Stunning AI Images Directly from WhatsApp with Gemini This workflow transforms your WhatsApp into a personal AI image generation studio. Simply send a text message with your idea, and this bot will use the advanced prompt engineering capabilities of Gemini 2.5 Pro to craft a detailed, artistic prompt. It then uses Gemini 2.0 Flash to generate a high-quality image from that prompt and sends it right back to your chat. It's a powerful yet simple way to bring your creative ideas to l

Free

Automate newsletter creation & client delivery with GPT-4O, Google Sheets

How it Works This workflow automates the complete newsletter management process from content creation to client delivery, using Google Sheets, AI content generation, Google Drive, and Gmail. Whether you're a content creator, marketing agency, or small business owner, this workflow helps you automate newsletter creation and manage client communications with built-in approval workflows — all triggered from a simple spreadsheet. 🎯 Use Case Ideal for: - Market

Free

Fetch Threads analytics for your latest posts and email an HTML report

Fetch up to 100 of your latest Threads posts along with their insights (views, likes, replies, reposts, quotes), build a formatted HTML summary table, and send it to your inbox automatically. Supports both manual runs and scheduled execution (every 2 days by default). --- 💡 Want to auto-publish Threads posts from Notion too? Check out the Content Automation Bundle — includes Threads Publisher, LinkedIn Publisher, Facebook Publisher, AI Content Rewriter and more: 👉

Free

Create a context-aware Slack assistant with Google Sheets, Pinecone & GPT-4o

This advanced n8n automation template empowers your Slack bot to act as an intelligent assistant: when a user asks a question or requests a suggestion (by mentioning the bot), it automatically retrieves the user’s historical data and previous interactions from both Google Sheets and Pinecone. Using GPT-4o, the bot analyzes past updates, status reports, and context to generate a personalized, context-aware response—directly in Slack. Perfect for teams seeking instant, data-driven support, this wo

Free

Jarvis: productivity AI agent for tasks, calendar, email & expense using MCPs

Who’s it for This template is designed for anyone who wants to use Telegram as a personal AI assistant hub. If you often juggle tasks, emails, calendars, and expenses across multiple tools, this workflow consolidates everything into one seamless AI-powered agent. What it does Jarvis listens to your Telegram messages (text or audio) and processes them with OpenAI. Based on your request, it can: - ✅ Manage tasks (create, complete, or delete) - 📅 Handle calendar events (schedule, r

Free

Generate Images with OpenAI new GPT-Image-1 Model via User-Friendly Form

Welcome to my Simple OpenAI Image Generator Workflow! This workflow creates an image with the new OpenAI image model "GPT-Image-1" based on a form input. This workflow has the following sequence: 1. Form trigger (image prompt and image size input) 2. Generate the Image via OpenAI API. 3. Return the image to the input form for download. The following accesses are required for the workflow: - OpenAI API access: Documentation Instructions - Link your OpenAI Platform account in the “OpenAI Image Gen

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free