Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

Library / RAG & Knowledge Bases

RAG & Knowledge Bases

Draft and review grounded support email replies with Gmail, OpenAI and Claude

When you run it, it answers questions from your own knowledge base with OpenAI / ChatGPT and OpenRouter using PGVector, Gmail, Google Drive, Postgres.

What it does

# Support Reply Agent One canvas, three segments, one import. It answers the tickets it can prove an answer for, and escalates the ones it cannot. The idea: a drafting agent writes a grounded answer out of your own docs, then a second model from a different vendor grades that answer before anything is sent. Only drafts that survive the grader go out on their own. Everything else reaches a human with the draft and the grader's objections attached, so reviewing is faster than writing from scratch. Segments - A Knowledge Base Ingest, Drive folder to pgvector, change-detected - B Reply Pipeline, ticket in, cited reply or escalation out - C Weekly Metrics, auto-answer rate, escalations, and the KB gaps behind them Before the first run 1. Run sql/01-schema.sql against your Postgres 2. Put your Drive folder id in *List KB Files*, replacing KB_FOLDER_ID 3. Put your reviewer address in *Request Human Approval*, *Escalate To Human Queue* and *Send Metrics Digest*, replacing SUPPORT_LEAD_EMAIL 4. Run segment A once, so the vector store is not empty 5. Run segment B by hand on one ticket before you activate anything It is deliberately conservative. An empty knowledge base produces zero citations, zero citations fail the gate, and a failed gate escalates. It does not guess when it has nothing to cite.

The steps

  1. Ingest On Demand
  2. Ingest Nightly 02:00
  3. List KB Files
  4. Fetch Ingest Ledger
  5. Select New Or Changed
  6. Download KB File
  7. Purge Old Chunks
  8. Embed Into PGVector
  9. KB Embeddings
  10. KB Loader
  11. KB Splitter
  12. Record In Ledger
  13. Ticket From Gmail
  14. Ticket From Helpdesk

47 steps in total.

Similar automations