Real-time Email RAG Assistant: Gmail, OpenAI & PGVector
Monitors Gmail inbox in real-time, embeds emails with OpenAI, stores in PGVector, and enables semantic search via conversational AI for fast, context-aware responses.
This workflow creates a powerful real-time Retrieval-Augmented Generation (RAG) assistant for Gmail users. It continuously watches for new emails, extracts key content like subject, body, sender, and date, then generates vector embeddings using OpenAI's models. These embeddings are stored in a PostgreSQL database enhanced with the PGVector extension, enabling efficient semantic search across your email history.
When you query the system with natural language, the AI agent performs vector similarity searches to retrieve relevant emails, augments the context, and generates intelligent, time-sensitive responses using OpenAI's Chat model. This setup is perfect for professionals, project managers, sales, and support teams handling high email volumes, turning chaotic inboxes into searchable knowledge bases.
Benefits include lightning-fast searches without manual digging, context-aware answers that consider dates and senders, and scalability for enterprise use. Customize filtering by labels/senders, text chunking, or search depth to fit your needs. Requires n8n, Gmail API, OpenAI key, and PGVector-enabled Postgres.
New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.
Related bundle
YouTube Creator Pipeline
8 hand-picked workflows for $39.00.
That is $4.88 each, vs $24.99 for this one alone.
View bundleSecure checkout powered by Stripe
Tags
Support
How to import this workflow into n8n
- 1Purchase or download the workflow to get the n8n workflow JSON file.
- 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
- 3Open each node marked with a credential warning and connect your own accounts and API keys.
- 4Run the workflow once manually to verify the data flow, then toggle it to Active.
Related Enterprise workflows
- WhatsApp AI Chatbot for Restaurant Bookings & Service$22.99
- Automate Sports Betting Data with TheOddsAPI$12.99
- AI Video Generator: 4x Cheaper than Veo3 via Google Sheets & Fal.AI$24.99
- AI Meeting Management Agent for Telegram & Google Calendar$24.99
- js-yaml YAML Parser & Serializer Package Workflow$8.99
- Clearbit Tool MCP Server for AI Agents$24.99
More from Leandro Rossi
Need this deployed? We'll set it up for you.
Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.