Customer support,
automated.
A premium e-commerce brand with two storefronts was answering every support email by hand. We built an AI pipeline that reads the inbox, sorts every message, clears what is already handled and drafts replies for the team to approve. It runs every day, in production.
Live in productionA busy inbox,
two stores, one team.
Order questions, warranty claims, returns and address changes arrived mixed in with supplier mail, marketing, shop notices and spam. A first version handled sorting on an outside platform, but the brand wanted to own the whole system, and as volume grew, a single long run kept failing halfway through with nothing to show.
The brief: take full control, make it dependable, keep it secure, and go further than sorting, all the way to ready-to-send replies.
From inbox
to approved reply.
Each cycle runs on a schedule throughout the day. Here is what happens to every email.
- 01Security scan
Every incoming email is checked against 28 known attack patterns across 11 categories before any AI reads it. Anything suspicious is quarantined, and if the inbox cannot be read safely, the run stops rather than guessing.
- 02Rule-based pre-filter
Fast, plain rules handle the obvious cases first: shop system notices, suppliers, marketing, postal updates and payment disputes. This sorts 80 to 90% of email without calling an AI model at all.
- 03Triage
What remains is classified by AI into precise categories per storefront: where is my order, warranty, returns, shipping, out of stock, address change, order changes, chargebacks and general questions, plus product, compatibility and pre-order enquiries.
- 04Cleanup
Threads the team has already answered or attended to are cleared from the review queue, so people only see what still needs them.
- 05Fixed-answer order tracking
"Where is my order?" emails skip the AI entirely. The tracking details come straight from the store and drop into a fixed, approved reply, so there is nothing to guess and nothing to invent.
- 06Draft
For each open case, the system reads the last five messages in the thread, looks up the live order in the store, pulls the matching help article, gauges the customer's mood and urgency, and writes a reply in the brand's own voice.
- 07Human review
Nothing is sent automatically. Every draft lands in the inbox labelled for review, and a person approves, edits or discards it.
- 08Accuracy check
After the team sends a reply, the system compares it with its own draft, word by word, and scores how much was changed. Every result is stored, so accuracy is measured, never assumed.
The inbox, the records,
the real results.
Screenshots from the running pipeline: message sorting in Gmail, draft and accuracy records in BigQuery, and the weekly report.
The support inbox
Processed messages and reply drafts are labelled in Gmail for the team to review.
Sorting before drafting
Business and system messages are filtered out of the customer support queue.
Every draft recorded
BigQuery stores the draft history. Private message content and customer records are obscured.
Draft versus sent reply
Edit distance, percentage changed and review grades are recorded alongside each reconciled reply.
The weekly accuracy report
A dated snapshot of pipeline health and category-level results, including replies that needed substantial rewriting.
Engineered for
the real world.
Built to survive failure
- The work is split into independent stages, each with its own time limit and only the connections it needs.
- A store outage only affects drafting; sorting keeps running.
- Stalled processes are shut down cleanly so nothing piles up.
No passwords in plain sight
- Store access keys moved out of configuration files into the operating system's encrypted credential vault.
- Keys are injected only at run time and rotated with a single command.
Protected against manipulation
- Emails are scanned for prompt-injection and data-extraction tricks before the AI sees them.
- The system fails closed: if it cannot check, it does not proceed.
Fast and economical
- Labels are applied in two or three batch calls instead of one per email.
- Help content is cached for 24 hours, so drafting makes no repeat lookups.
- One query change removed over 200 wasted calls per cycle.
Replies that sound human
- Tone adapts to the customer: empathy first for frustrated customers, the answer first for urgent ones.
- Approved and forbidden wording is enforced, drawn from a 705-entry question and answer index traceable to the brand's own documents.
Measured, not assumed
- Every draft is logged, then matched against what the team actually sent.
- A weekly accuracy dashboard shows which categories are reliable enough to trust more, and which need work.
Automatic only
once it is proven.
Every reply is graded against what the team actually sent. A type of email can only move to sending on its own after it reaches at least 95% accuracy across more than 100 real emails. Until then, a person approves every single one, and today every reply is still reviewed by the team.
| Grade | What it means |
|---|---|
| Perfect | Sent exactly as drafted |
| Minor edit | Less than 5% changed |
| Major edit | 5 to 50% changed |
| Rewrite | More than half rewritten |
Facts and tone are handled differently. Order details, policies and product specifications are locked and never reworded creatively. Only the phrasing around them is allowed to flex to suit the customer.
| Phase | What it adds | Status |
|---|---|---|
| 1 | Store and data foundations | Complete |
| 2 | Fixed-answer order tracking | Complete |
| 3 | Draft versus sent accuracy tracking | Complete |
| 3.5 | Understanding intent, search by meaning | In progress |
| 4 | Automatic replies for proven categories | Collecting data |
| 5 | Marketplace inbox connection | Planned |
Insight the brand
did not have before.
Weekly issue trends
Every Monday the system reports which problems customers raise most, which ones are rising week on week, and which conversations carry a high risk of escalation, so the brand can fix causes before they turn into emails.
Marketing link checker
After a welcome email went out with a link that worked for nobody, we built a read-only checker that tests every link in the brand's marketing emails and flags broken or unsafe ones.
Packaging feedback review
On request, eight months of customer emails were pulled and sorted to surface every comment about packaging, answered or not, for the product team.
Search by meaning
In progress: help content is being indexed by meaning, not just keywords, so drafts find the right answer even when a customer words the question in an unexpected way.
Before and
after.
| Measure | Before | Now |
|---|---|---|
| Scope | Sorting only, on an outside platform | Full pipeline: security, sorting, cleanup, drafting, measurement |
| Full cycle time | Not applicable | About 15 to 20 minutes |
| Draft backlog | 42 waiting | 6 at steady state |
| Emails needing AI to sort | All of them | 10 to 20% |
| Label calls per run | One per email | 2 to 3 in total |
| Hours covered | 8am to 6pm, weekdays | 6am to 11pm |
| Access keys | Plain text in config files | Encrypted credential vault |
How we
build.
When a run timed out, we fixed the query that wasted the time instead of simply allowing more time.
Stages are divided by the services they depend on, so one outage never takes everything down.
AI does the heavy lifting; a person approves every reply before a customer sees it.
Have a process
worth automating?
Tell us what takes up your team's time. We will tell you honestly what can be automated.
Start a conversation