The AI reads. The script decides. You send.
One command turns a CSV of messages into a review page and a CSV. Here is who does what.
Export
Save your messages as a CSV with three columns: sender, subject, message.
Read
Gemini reads each message, with your policy and sample replies as instructions, and returns category, priority, mood, quantity, company and a draft.
Check
The script verifies the quantity and company, scores leads by your rules, and tests every draft against your policy rules.
Review
Open review_page.html. Read, copy a draft, and send it yourself. Everything is also in triage_output.csv.
The AI never gets the last word
The AI reads and writes
- Picks one of your 6 categories
- Suggests high, normal or low priority
- Notes how the customer sounds
- Finds the quantity and company named
- Drafts a reply in your tone, from your policy
The script decides
- Applies your hot / warm / cold thresholds
- Ignores a quantity or company not written in the message
- Raises complaints and hot leads to high priority
- Decides which drafts say "check before sending"
- Tests every draft against your policy rules
What gets flagged, and why
Refunds, angry customers, complaints
If the category is complaint, the customer sounds angry, or the message mentions a refund, money back or chargeback, the draft gets a red banner. You decide what happens, because the policy says refunds are the owner's call.
Order status drafts that claim a status
The tool can't see your orders. Drafts say you are checking and will reply. If a draft says "has shipped", "in transit" or "delivered", it's flagged so you can fix it.
Promises and prices
A draft that promises a refund or replacement, or quotes a wholesale price, is flagged. Wholesale drafts ask for company, products, quantities and timeline instead.
Quantities and companies must be real
If the AI reports 300 units but the message never says so, the number is ignored and the lead is scored on what is actually written. Numbers in words ("two hundred") and totals ("250 cases and 120 chargers") are understood.
Three plain files you can edit
policy.txt: shipping, returns, warranty, tone and what drafts must never saystyle_samples.txt: your own replies; the drafts copy this tonescoring_rules.json: categories, hot / warm thresholds, flag words
Tone too stiff? Add a reply you like to style_samples.txt and run again. Those edits are what the four revisions are for.
"wholesale_scoring": { "hot": { "min_units": 100, "company_required": true }, "warm": { "min_units": 20 } } // 100+ units, no company named: warm // under 20 units, or no quantity: cold
What it will not do
It can misread
An unusual or sarcastic message may be sorted wrongly or get a stiff draft. That is why every draft is a draft: read it first.
It can't see your shop
No Shopify, Gmail or WhatsApp connection, so no real order status and no automatic sending. This keeps the first version small and safe.
You pay the AI directly
It uses your own Google AI Studio key. The cost depends on how many messages you process, so set a monthly spending limit. Message text is sent to Google.