Gmail RAG Assistant: Full Email History with OpenAI & Qdrant

Builds a RAG system for querying full Gmail history in real-time. Processes new emails, generates OpenAI embeddings, stores in Qdrant, and powers an AI agent for conversational email search.

n8n
Gmail RAG Assistant: Full Email History with OpenAI & Qdrant

This advanced n8n workflow creates a Retrieval-Augmented Generation (RAG) assistant for your entire Gmail history. It triggers on new emails every minute via Gmail Trigger, fetches full message data, cleans and normalizes content with a Code node (removing line breaks and extra spaces), generates embeddings using OpenAI, and stores them with metadata in a Qdrant vector database collection named 'emails_history'. Batch processing via SplitInBatches handles large inboxes efficiently in chunks of 50.

For interaction, it sets up a RAG Agent that retrieves relevant email snippets from Qdrant using a chat message trigger. The agent, enhanced with Simple Memory for context retention, answers queries conversationally, making past emails instantly searchable. This ensures real-time updates as new emails arrive.

Ideal for support teams surfacing customer histories in chatbots, sales ops needing quick email summaries, or developers building email-powered AI agents. Benefits include time savings on manual searches, improved accuracy via embeddings, scalability for large inboxes, and seamless integration without custom coding. Setup requires n8n instance, Gmail OAuth2 credentials, OpenAI API key, and Qdrant connection.

$24.99
Last updated August 29, 2026
30-day money-back guarantee
Instant download
Lifetime updates included

New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.

Secure checkout powered by Stripe

Support

How to import this workflow into n8n

  1. 1Purchase or download the workflow to get the n8n workflow JSON file.
  2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
  3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
  4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

Related Other - Miscellaneous workflows

More from Jordi Faber

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.