Gmail knowledge base support agent

Classifies Gmail support mail, answers from a vector knowledge base, replies. This n8n template starts when a new email arrives in Gmail. A text classifier decides whether the email is customer support-related, and anything else is ignored. An AI agent then queries a knowledge base, a vector database with OpenAI embeddings built from FAQ, documentation or past tickets, and drafts a reply. The workflow labels the email in Gmail and sends a reply automatically. It needs an OpenAI or Google Gemini account for the model and embeddings, plus Google Drive access to update the vector database. It is aimed at SaaS founders, freelancers and companies that receive repetitive customer queries.

n8nRead on 2026-11-167 steps

Steps

  1. Trigger: A new email arrives in GmailGmail
  2. Text classifier decides if it is support
    If not, it's ignored.
  3. AI agent queries the knowledge baseOpenAI
    Vector database with OpenAI embeddings.
  4. Retrieves the most relevant answer
  5. Drafts a reply using AIOpenAI
    OpenAI or Google Gemini model.
  6. Labels the email in GmailGmail
  7. Output: Sends a reply automaticallyGmail

Limits

  • Sends a reply automatically.
  • Your own FAQ, documentation or ticket data must be loaded into the vector database.

What it does well

  • Answers come from a knowledge base you supply.

Before you import

You need: Gmail with API access, OpenAI or Gemini, Google Drive with API access to update the vector database.

Similar templates