~/work/chatbot-migration⎇ main✓❯cat case-study.md
AI Copilot for Customer Support
Moved Dewaweb's 24/7 support desk off a decade-old platform onto a customized Chatwoot, then built an AI copilot on top: a human-in-the-loop RAG system that drafts replies, flags angry customers, and has handled 250,000+ customer messages across 30,000+ conversations since going live in March 2026.
- AI Engineer Intern
- Feb 2026 – present
- Dewaweb
- shipping
Context
Dewaweb sells itself on Ninja Support, a 24-hour customer service team. When I joined, that team was running on a support platform more than ten years old. The brief arrived on day two of the internship: migrate support to a self-hosted Chatwoot and put an AI layer on top of it, all while the 24/7 desk kept running. We rolled it out incrementally and tested every n8n flow on staging first.
The bar was assist, don’t replace. The copilot never answers a customer on its own. It drafts, the agent decides.
What I built
A two-person effort with one teammate. I led the architecture and the workflow design; the knowledge-base document format was a joint call. The whole system lives in five n8n workflows, a customized Chatwoot, prompts, and a PostgreSQL database, which is why none of it shows up in a git log.
- Draft on every incoming message. A Chatwoot webhook triggers retrieval against Gemini File Search, and the draft lands in a side panel next to the conversation. History is trimmed to the last 20 messages, private notes are stripped, and output is capped at 1,200 characters to keep token cost in check.
- Six knowledge bases, one workflow. Routing by inbox serves four brands plus two test lanes. Store IDs are read from a config table at request time, so knowledge bases change without touching the workflow.
- KB Manager, shipped 30 October 2026. Senior agents keep the knowledge base current from one page, without an engineer. Retrieval stays on Gemini File Search (a managed service, not a vector pipeline of my own); the page manages what goes into it.
- Versioned rebuilds. Every rebuild creates a fresh, timestamped store instead of editing the live one. Before switching, it runs a retrieval smoke test against the new store, and the switch happens in a single step that also records the previous version. A failed build never replaces the live store.
- One-click rollback to the previous version.
- Test questions per brand, with live and previous answers compared side by side and a history.
- Section-level edits to the knowledge-base documents from the page.
- Weekly agent-FAQ suggestions. Every Monday morning an n8n flow drafts FAQ entries from the week’s agent answers, checks them against the existing documents, and queues them for a senior agent to review on the same page.
/AIrevisions. Agents type/AI <instruction>in a private note and get a revised draft back. Revision history is rebuilt from the private notes themselves, so there’s no extra state store to keep in sync.- Angry-customer escalation. A narrow sentiment prompt (
ANGRYorNEUTRAL, and frustration with a task doesn’t count as anger at the service) pings Mattermost and Telegram at once, with a deep link into the conversation. Alerts originally went to the support manager and now go to the whole on-duty group, so escalation doesn’t depend on one person being online. - Operations. A daily 08:00 report to Mattermost, a global error-trigger workflow that posts the failing node and execution link, and retries on every Gemini call.
- A fine-tuning experiment, not shipped. I prepared a Vertex AI supervised fine-tuning dataset from the best agent’s past replies and tuned Gemini toward their tone. The tuned model was never deployed; production stays on retrieval plus few-shot examples.
- Upstream bug report. Customers could reopen an auto-resolved conversation through the chat widget’s retry button on a failed message, bypassing the resolve lock. I reported it to Chatwoot with a reproduction and a suggested fix (#14563), and the maintainers fixed it server-side. The fix is live in Chatwoot v4.17.0.
The metric that lied
From March to July, the daily report said the copilot “succeeded” about 2% of the time. Agents were telling us the drafts helped. Both couldn’t be true.
The metric was normalized Levenshtein similarity between the AI draft and the agent’s actual reply. Drafts averaged 460 characters, replies 97. Edit distance can’t be smaller than the length gap, so the best possible score was 97 / 460 = 0.211. The pass threshold was 0.80, almost four times higher than anything the system could reach. The metric was measuring length ratio, not usefulness.
The same flaw had also quietly broken the feedback loop. The copilot injects three past agent replies as few-shot examples, and the design was to pick cases where the AI missed worst (similarity < 0.85). Since 97.9% of rows sat below that line, the filter excluded almost nothing and the loop just replayed the three most recent conversations.
I replaced it with a word-coverage metric (what share of the agent’s words already appear in the draft, counted only for replies of 40+ characters, passing at 0.70) and fixed the example filter in the same change. Both went live on 27 July 2026. I then re-checked the new metric for NULL handling bugs; the check came back clean. First three days: weighted coverage of 0.31, with 9.7% of substantive replies clearing the 70% bar. That’s a short baseline, and an honest one.
Outcome
Live across all Dewaweb websites since 14 March 2026, with 250,000+ customer messages across 30,000+ conversations handled as of November 2026.
These are Chatwoot’s own figures, comparing the project’s first month (late February to late March, still partly testing) with late June to July. They cover the migration and the copilot together, not the copilot alone:
- Resolution time −93%
- First response time −72%
- Customer wait time −59%
- Customer satisfaction +3.67 points, rising in all five monthly periods
- “Excellent” ratings +10.44 points
Satisfaction dipped in the first full month after the migration, then recovered. It now sits level with the last month on the old platform. That comparison needs my own mapping from Chatwoot’s 5-point scale to the old platform’s good/bad ratings, so I treat it as “no worse than before”, not as a win.
In informal conversations, every agent said the copilot helps, and some put the gain in answer quality and speed at 80–90%.
Stack
Chatwoot · n8n · Gemini Flash Lite · Gemini File Search · PostgreSQL · Google Drive · Mattermost · Telegram