Gmail to Vector Embeddings with PGVector and Ollama
    100%
    Automation
    0(0 reviews)
    344 downloads

    Gmail to Vector Embeddings with PGVector and Ollama

    NM

    Curated by n8n Markets team

    Last updated: March 8, 2026

    Gmail to Vector Embeddings with PGVector and Ollama # Who is this for? Everyone! Did you dream of asking an AI "*what hotel did I stay in for holidays last summer?*" or "*what were my marks last semester like?*". Dream no more, as [vector similarity searches](https://www.pinecone.io/learn/vector-embeddings/) and this workflow are the foundations to make it possible (as long as the information appears in your e-mails πŸ˜…). ## 100% local This workflow is designed to use locally-hosted open source. Ollama as LLM provider, `nomic-embed-text` as the embeddings model, and pgvector as the vector database engine, on top of Postgres. ## But.. how?! Firstly, specify the date you created your Gmail account on, then manually run the workflow in order to bulk read all your e-mail in monthly batches. Your database is now populated! Now it's the task for other workflows to query the vector database. Activate the workflow so that new e-mail is continuously added by the `Gmail Trigger` upon receiving it. ### Structured AND Vectorized This workflow stores your e-mail activity in two ways: - In a structured table - In a vector embeddings table And the information in both of them can be correlated by Gmail's messages `id`, which is stored in the vectors table as metadata property `emails_metadata.id`. That way consumers can benefit from both worlds! ✨ Vector similarity searches enable semantic searches, while structured queries can retrieve more factual data like the message `id`, its *date* or who it came *from*. ### Other useful templates My template [Chat with Your Email History using Telegram, Mistral and Pgvector for RAG](https://n8n.io/workflows/3763-chat-with-your-email-history-using-telegram-mistral-and-pgvector-for-rag/) is a ready-made solution to consume this workflow. You may also pair this workflow with my other template to [Email Assistant: Convert Natural Language to SQL Queries with Phi4-mini and PostgreSQL](https://n8n.io/workflows/3761-email-assistant-convert-natural-language-to-sql-queries-with-phi4-mini-and-postgresql/) and you'll enable RAG workflows that use both structured and vectorized databases. ## Customizations I suppose the e-mail provider could be changed, but then you'd have to identify an alternative `id` field. `Message-ID` would be a more standard option. There are a few opinionated choices as to what metadata to store, but those shouldn't need adjustments.

    What's Included

    • Complete n8n workflow template with 0 nodes. Ready to import and customize.

    Requirements

    n8n instance (self-hosted or cloud). credentials.

    How to Use

    1. Download the workflow JSON 2. Import into your n8n instance 3. Configure credentials for 4. Activate and enjoy automation

    Apps in this n8n workflow

    How to import this template into n8n

    1. Download the workflow JSON file from this page.
    2. In n8n, open Workflows, create a new workflow and choose Import from File.
    3. Open each node that shows a warning and connect your own credentials.
    4. Run the workflow once manually to check the output before you activate it.
    Included in Pro
    • Importable n8n workflow JSON file
    • Download with Builder Pro or Agency Unlimited
    • Built for n8n v1.0++
    • Setup time: 5-15 min

    Included in Builder Pro β€” $19/mo, 4,177 premium workflows

    Before you activate

    Templates are reviewed before they are listed. Test with your own credentials and data before running it in production.

    Updated Mar 2026
    v1.0
    SSL
    Secure
    GDPR

    100% Secure Checkout

    Refund requests within 7 days of a new subscription

    Dependencies & Requirements

    Gmail
    Communication
    HTTP Request
    Integration

    ⚠️ 2 services require credentials. Make sure you have accounts set up before importing.

    Reviews

    0

    No reviews yet

    See all 0 reviews ↓
    β€”

    0 reviews

    5β˜…
    0
    4β˜…
    0
    3β˜…
    0
    2β˜…
    0
    1β˜…
    0

    No reviews yet.

    Questions & Answers

    0

    Log in to ask a question.

    No questions yet. Be the first to ask!

    People Also Bought