Dev shares how weighted regex email classifier misrouted refund requests as receipts

kumard3 · reddit · 2026-11-28

A developer building an email API for agents shares a real misclassification: his weighted-regex inbound classifier (no model calls) tagged "my order hasn't arrived, can you check / refund?" emails as transactional in June, since refund and tracking are also receipt words.

Fix: a support rule keyed on request-style phrasing ("can you", "has not arrived", "problem with"), weighted 8 per match vs transactional's 7, so one match each lets support win. Tests cover the reverse direction — shipping receipts and refund-processed notices still come out transactional.

The tag matters downstream: routing rules dispatch threads by category, and the OTP endpoint only reads verification-tagged mail. He asks whether others tag inbound mail before agents see it.

Original post →

More from coding & agent

coding & agent channel →