Real-time Email Tag Assistant with Gmail, OpenAI GPT, and PGVector
# Email real-time RAG Assistant with Gmail, OpenAI & PGVector ## Who's it for This workflow is ideal for: - Professionals - Project managers - Sales and support teams - Anyone managing high volumes of Gmail messages It enables fast and intelligent search through your email inbox using **natural language queries**. --- ## How it works / What it does - Continuously monitors your **Gmail inbox** for new emails. - Extracts **email content and metadata** (subject, body, sender, date). - Converts email content into **vector embeddings** using OpenAI. - Stores embeddings in a **PostgreSQL database with PGVector**. - A **conversational AI agent** performs **semantic search** on your stored email history. - Supports **time-sensitive** and **context-aware** responses via OpenAI Chat model. --- ## How to set up 1. **Connect your Gmail account** to the Gmail trigger node (with API access enabled). 2. **Configure OpenAI credentials** for the Embedding and Chat nodes. 3. **Set up a PostgreSQL database** with the **PGVector extension** enabled. 4. **Import the workflow** into your n8n instance (Cloud or Self-hosted). 5. **Customize parameters** like polling frequency, embedding settings, or vector query depth. --- ## Requirements - An n8n instance (Self-hosted or Cloud) - A Gmail account with API access - An OpenAI API Key - A PostgreSQL database with PGVector extension installed --- ## How to customize the workflow - **Email Filtering**: Change filters in the Gmail trigger to watch specific labels or senders. - **Text Splitting Granularity**: Adjust `chunkSize` and `chunkOverlap` in the text splitter node. - **Query Depth**: Modify `topK` in the vector search node to retrieve more or fewer similar results. - **Prompt Tuning**: Customize the system message or agent instructions in the RAG node. - **Workflow Extensions**: Add notifications, error logging, Slack/Telegram alerts, or data exports.
Email real-time RAG Assistant with Gmail, OpenAI & PGVector
Who's it for
This workflow is ideal for:
- Professionals
- Project managers
- Sales and support teams
- Anyone managing high volumes of Gmail messages
It enables fast and intelligent search through your email inbox using natural language queries.
How it works / What it does
- Continuously monitors your Gmail inbox for new emails.
- Extracts email content and metadata (subject, body, sender, date).
- Converts email content into vector embeddings using OpenAI.
- Stores embeddings in a PostgreSQL database with PGVector.
- A conversational AI agent performs semantic search on your stored email history.
- Supports time-sensitive and context-aware responses via OpenAI Chat model.
How to set up
- Connect your Gmail account to the Gmail trigger node (with API access enabled).
- Configure OpenAI credentials for the Embedding and Chat nodes.
- Set up a PostgreSQL database with the PGVector extension enabled.
- Import the workflow into your n8n instance (Cloud or Self-hosted).
- Customize parameters like polling frequency, embedding settings, or vector query depth.
Requirements
- An n8n instance (Self-hosted or Cloud)
- A Gmail account with API access
- An OpenAI API Key
- A PostgreSQL database with PGVector extension installed
How to customize the workflow
- Email Filtering: Change filters in the Gmail trigger to watch specific labels or senders.
- Text Splitting Granularity: Adjust
chunkSizeandchunkOverlapin the text splitter node. - Query Depth: Modify
topKin the vector search node to retrieve more or fewer similar results. - Prompt Tuning: Customize the system message or agent instructions in the RAG node.
- Workflow Extensions: Add notifications, error logging, Slack/Telegram alerts, or data exports.
New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.
Related bundle
Customer Support Automation Suite
8 hand-picked workflows for $39.00.
That is $4.88 each, vs $9.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 Communication workflows
- Automate Outbound Calls with Ultravox AI and Twilio$4.99
- Automate Intelligent Email Classification with AI in Gmail$4.99
- Generate AI videos and carousels with Blotato for Instagram and TikTok$9.99
- Automating WhatsApp Replies Using GoHighLevel with Redis and Anthropic$24.99
- Automate Gmail Email Labeling with AI for Enhanced Organization$14.99
- Automate Email Summarization and Logging with AI and Google Sheets$9.99
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.