Gmail to Vector Embeddings with PGVector and Ollama
detail.loadingPreview
Process emails from Gmail, generate vector embeddings, and store them alongside metadata in a PostgreSQL database.
🚀Ready to Deploy This Workflow?
About This Workflow
Overview
This workflow automates the process of ingesting emails from Gmail, extracting relevant information, generating vector embeddings using Ollama's 'nomic-embed-text' model, and storing both the structured email data and their embeddings in a PostgreSQL database with PGVector extension. It enables efficient similarity searches on email content.
Key Features
- Trigger-based Gmail email fetching.
- Extraction and structuring of email fields (ID, thread ID, sender, recipient, subject, date, body).
- Generation of vector embeddings for email content using Ollama.
- Storage of email metadata in a structured table.
- Storage of vector embeddings linked to email IDs in a vector-aware table.
How To Use
- Import: Import this workflow into your n8n instance.
- Configure Credentials: Set up your Gmail credentials in n8n.
- Configure Ollama: Ensure Ollama is running and the 'nomic-embed-text' model is available.
- Configure PostgreSQL: Set up your PostgreSQL database with the PGVector extension enabled and configure the connection details in n8n.
- Activate: Run the workflow manually to start processing emails or activate the Gmail trigger for continuous processing.
Apps Used
Workflow JSON
{
"id": "a044e671-c5a8-43e2-be7c-a5097ef62517",
"name": "Gmail to Vector Embeddings with PGVector and Ollama",
"nodes": 0,
"category": "Email Automation",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: a044e671-c5a8...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Verification Info
Related Workflows
Discover more workflows you might like
Save Gmail Attachments to Google Drive
Automatically saves attachments from new emails with specific criteria to Google Drive.
Send Specific PDF Attachments from Gmail to Google Drive Using OpenAI
Automate filtering and uploading of specific PDF attachments from Gmail to Google Drive using OpenAI for text analysis.
Mails2notion V2
Processes incoming emails and creates entries in Notion.
Gmail Invoice To Google Drive
Automatically downloads invoices from Gmail and saves them to Google Drive.
Gmail Attachment To Google Drive (Split Out)
Receives emails via Gmail, splits out binary attachments, and saves them to Google Drive based on file size.
Gmail to Telegram Audio Podcast Bot
Converts 'CATEGORY_PROMOTIONS' emails into an audio podcast sent to Telegram.