Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Email Automation

Email Automation

Diagnose RAG chunk strategies from Google Drive PDFs with Gemini and Google Sheets

When you run it, it handles email with Google Gemini using Gmail, Google Drive, Google Sheets.

What it does

## RAG Chunk-Quality Diagnostics Harness (100% free stack) Everyone building RAG hits the same wall: answers are bad and nobody knows why. Is it the chunking, the retrieval, or the model? This workflow answers that question scientifically. It takes your PDFs, chunks them three different ways (fixed-size, semantic, parent-document), runs your test questions against each strategy, has an LLM judge score every answer for groundedness and recall, and tells you which chunking strategy to ship for YOUR documents. ### Why this is different Most RAG templates show the happy path: one chunker, one chatbot, fingers crossed. This is a diagnostics harness. It runs a controlled bake-off, scores every answer with a strict rubric, and outputs a decision: which strategy wins, by how much, and which questions fail under each strategy. The vector retrieval is hand-rolled with cosine similarity in plain Code nodes, so you can see exactly what happens. No black boxes. ### Cost Zero. Embeddings and judging run on the Gemini free tier (1,500 requests/day). Google Drive, Sheets, and Gmail are free. The only credential you need is a free Gemini API key from aistudio.google.com. ### Setup 1. Put your PDFs in a Google Drive folder. Paste the folder ID into the Workflow Configuration node, along with your free Gemini API key. 2. Replace the four sample questions in the Test Question Set node with questions your users actually ask, plus the keywords a good answer must contain. 3. Connect Google Drive, Google Sheets, and Gmail. Run with the manual trigger. 4. Read the emailed report: it names the winning strategy and lists every question's scores under each strategy. ### Honest notes - This is a diagnostics harness, not a production chatbot. Once you know the winner, rebuild your production RAG with that chunking strategy and a persistent vector store (Qdrant, Supabase, Pinecone). - The LLM judge is non-deterministic. Scores use temperature 0 and a fixed rubric, and per-question scores are shown so flakiness is visible. - Semantic chunking embeds every sentence once. For very large document sets, watch the free-tier quota; the maxCharsPerDoc setting caps input size.

The steps

  1. Manual Diagnostics Run
  2. New PDFs In Drive
  3. Workflow Configuration
  4. Test Question Set
  5. List PDFs
  6. Download PDFs
  7. Extract PDF Text
  8. Fixed-Size Chunker
  9. Embed Chunks A
  10. Questions A
  11. Loop Questions A
  12. Retrieve TopK A
  13. Answer And Judge A
  14. Semantic Chunker

31 steps in total.

Similar automations