Skip to content
← All AI workflows

Build a support knowledge base from Gmail threads

This n8n template turns past support email threads into records for a knowledge base. It separates customer questions from human replies, classifies resolved questions and checks for duplicates. This entry covers knowledge preparation, not reply drafting.

From the source

Public documentation page from Vivekanand M / n8n
Vivekanand M / n8n · Captured 2026-10-14Read the original

How it works

  • The inspected export has 20 nodes. Its Gmail node limits retrieval to 500 INBOX messages with a fixed receivedBefore cutoff. The page describes a default batch of 100, which is a setting, not a result.
  • Assemble Thread emits one customer message, an empty latestSupportReply and supportReplyCount 0, while setting hasSupportReply true. Quoted replies may exist in the message body, but this does not establish full-thread reconstruction or verified resolution.
  • The page advertises 92% embedding-similarity deduplication. The exported KB duplicate query compares LOWER(TRIM(question)) exactly. The similarity figure is not a validated precision score.
  • The exported model prompt contains domain-specific assumptions. Review the prompt, source replies, redaction and database writes before reuse. No customer reply was sent.

Workflow guide

  1. Obtain the support data owner's approval for a fixed historical email sample and its access limits.

  2. Import that sample from the approved Gmail mailbox with a manual trigger. Remove automated messages and reconstruct full threads.

  3. Separate customer questions from human replies. Extract resolved question-and-answer pairs with thread references and redact personal data.

  4. Generate embeddings, numeric representations of text. Review possible duplicates before preparing records for PostgreSQL with pgvector, its similarity-search extension.

  5. Ask the support owner to check answers, redaction and source references. Insert only approved records. Do not send customer replies.

  6. Compare retrieval on fixed test questions with existing search. Count accepted pairs, duplicates, personal-data leaks and correct retrieved answers before allowing draft assistance.

Sources and downloads

Discuss this workflow →

Book a call

A free 30 minute call. Tell us where you are with AI, what your IT allows, and what management needs to see. We'll tell you honestly what we would do first.