AI Reply Drafter Grounded in Your KB
Draft fast, accurate support replies that quote only your team's approved knowledge base and macros - with a citation on every answer and a human approval gate before anything reaches the customer.
An internal tool where an agent picks a ticket, the AI retrieves the relevant approved KB articles and drafts a cited reply, the agent edits and approves it, and the reply is sent via Resend with the cited sources logged on the ticket.
Before you start
- A free Vercel account
- A free Supabase account
- A free Resend account
- Your KB articles and macros in a Google Sheet, CSV, or markdown files
The problem this kills
Your agents are fast or they're accurate - rarely both. The new hire copy-pastes the wrong macro. A senior agent improvises a refund policy that doesn't exist anymore. Someone quotes a KB article that was retired six months ago. Every off-script reply is a future escalation, a chargeback, or a "but your agent told me..." email you have to clean up.
Generic AI chatbots make this worse: they sound confident and make up policy out of thin air. You can't put that in front of a customer.
This tool flips it around. The AI only ever drafts from your approved knowledge base and macros - and it shows you exactly which article each sentence came from. If nothing in your KB matches, it refuses to guess and tells the agent to escalate. A human still reads, edits, and approves every reply before it's sent. Speed without going off-script.
What you'll build
A simple internal web app where:
- An agent pastes or selects a customer ticket.
- The AI searches only your imported KB articles and macros and drafts a reply.
- Every claim in the draft is cited - "from: Refund Policy v3" - so the agent can trust it at a glance.
- If no article confidently matches, the tool says "no confident answer - escalate" instead of inventing an answer.
- The agent edits the draft and explicitly approves it.
- The reply is sent to the customer via Resend, and the cited sources are logged on the ticket for later KB-quality review.
What's inside the Implementation Plan
- It starts by interviewing you about your business. Before any code is written, the plan has the AI agent ask you about your current reply process, where your KB lives, how your articles and macros are named, your ticket volumes, and your real approval rules. It reflects a short tailored spec back to you for a thumbs-up - so you get a tool shaped to your support desk, not a generic template.
- A step-by-step build you paste into Claude Code, one prompt at a time.
- A KB importer for Google Sheets, CSV, or markdown files.
- The retrieval + drafting logic that grounds every answer in your articles and cites the source.
- The "no confident match -> escalate" safety behavior.
- The human approval gate and the Resend send.
- A CSV export fallback so the tool is fully usable today, even before it's wired to your help desk.
The governance it includes (this is the point)
- Login so only your team can use the tool.
- Row-level security so people only ever see their own organization's tickets and KB.
- A complete audit trail - who drafted, who edited, who approved, who sent, and when.
- A hard human-in-the-loop approval gate - the AI drafts, a person reviews and approves, and only then is the reply sent. Nothing goes to a customer unreviewed.
- Duplicate guards - one outbound reply per ticket ID, so the same ticket can't be answered twice by accident.
- Citations logged so you can review which KB articles are pulling their weight and which need rewriting.
Who it's for
Front-line support agents and team leads who want to answer faster without drifting off-script - and the ops/QA people who need every customer-facing reply to be accurate, approved, and traceable back to an approved source.
You've got this - paste the first prompt and let the agent interview you.