case study 08 · reply handling
Sorting campaign replies with rules and a local AI model
reply handlingAI classificationOllamaPythonEnglish + Arabic
The problem
Every campaign gets a pile of replies: real interest, questions, polite no's, opt-outs, auto-replies, bounces, "I'm not the right person", and the occasional upset or suspicious one. Someone has to read all of it, fast, because a missed opt-out is a compliance problem and a slow answer loses the interested ones.
What we built
- Rules first for bounces, auto-replies and opt-outs. They're cheap, certain, and the ones that must never be wrong
- A local model (qwen3.5 4B on Ollama) for the rest: interested, question, not interested, wrong person, escalate
- Questions get a draft answer from the FAQ only. If the FAQ doesn't cover it, it goes to a human
- Anything upset, legal, privacy or "call me" is escalated, never auto-answered
- Replies in Arabic get answered in Arabic
- Runs on our own machine: no API costs, and reply text never leaves it
The test
40 made-up replies to an invitation for a free student art competition, written to cover every type, in English and Arabic. Then 15 more it had never seen, to check we hadn't just tuned it to the first 40.
first run, 40 replies 35/40 87%
all 5 misses: "we want in, how do we sign up?" called a question
after 2 prompt fixes 39/40 97% (tuned on these 40)
15 unseen replies 13/15 86% the honest number
12 of 40 handled by rules, the rest by the model
under a second per reply, $0
What the misses taught us
- "Please take me off this mailing list" was called a polite no instead of an opt-out. The rules didn't have that phrase. Fixed by adding it, and the safety net held anyway: a "not interested" also stops the sequence, so that person would never have been emailed again.
- "Our IT department flagged this" was called a question. It should go to a human. Fixed with a rule: anything mentioning spam, IT, legal or "who gave you my email" now goes straight to a human.
- The drafts were the real risk. Of 14 draft answers, 3 got a fact wrong even with the FAQ right there. One said "no age limit, ages 6 to 18". One told a school they don't pay shipping, when they do. One said groups can submit together. So drafts go into a queue for a person to approve, and nothing is sent automatically.
✓ 86% right on replies it had never seen, 97% on the tuned set
✓ Opt-outs, bounces and auto-replies caught by rules, not guesses
✓ FAQ answers drafted in the reply's language, approved by a person before sending
✓ Free to run and private: the model runs locally
# the replies are made up. the sorting, scores and mistakes are real.