workflows.fit
Back to n8n workflows
n8n templateFreeBy Daniel Nkencho

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

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,...

CommunicationHITLAILangchainCore NodesGmail TriggerLm Chat Google GeminiGmail
Loading interactive preview...

Template notes

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