How we run Kaizen

How we triage email with rules, AI and checks in code

Even when you check email all day, the unread messages pile up, and most of them do not matter much. Going through them is a slog, and the few that do matter wait behind the rest. Kai, our internal operations platform, now sorts our email so a person sees the right messages first. The AI does not read every message. Its main job is to find the rules that sort the rest.

By Ashish Tonse 9 min read

Inbox that was automated mail
54%
Mail sorted by a rule, with no AI call
90%
Agreeing AI verdicts before a new rule
2

We check our email through the day, and we still come back to dozens of unread messages. Most of them are low impact: a receipt, a password reset, a newsletter, a notice that a report is ready. Each one takes only a few seconds, but opening them one by one is a slog, and it happens several times a day. Worse, the message that matters, such as a client asking for a call, sits in the same list and waits its turn.

We looked at two years of our company email to see how big the problem was. More than half of it, 54%, was automated mail: receipts, alerts, newsletters and account notices.

So we built email triage into Kai, our internal operations platform. It sorts new mail every five minutes on weekdays, from 8:30 am to 6:30 pm.

The AI's job is to find the rules

The obvious design is to send every message to an AI model and let it decide. We did not do that. Most of our mail comes from the same senders again and again, and a receipt from a vendor looks the same every month. Asking a model about it every time is slow, costs money and gives a slightly different answer each time.

So the AI's main job is to look at mail that no rule covers yet, and work out which rule would handle it next time. Once a rule exists, messages from that sender never reach the AI again. We now have about 750 rules. In the last 30 days, rules sorted about 90% of our mail, and the AI saw the rest.

What happens to each message

Every message gets one of four outcomes:

  • Archive. Low-value mail: marketing, sales pitches from vendors, surveys, product announcements and plain notifications. The message leaves the inbox, is marked read and gets a label, such as Newsletter, so it is easy to find later. Nothing is deleted. Archived receipts still show up in the daily briefing as one short line, with each vendor and amount.
  • Summarize (read, kept). Mail you want to know about but do not need to open: receipts you keep for records, payment confirmations, delivery notices, appointment confirmations and statements. The message stays in the inbox, marked read, so it does not add to the unread count, and it appears in the daily briefing summary.
  • Leave alone. Anything that asks us to do or decide something, and anything a real person wrote to us, including every client. The message stays in the inbox, unread, for a person to see.
  • Urgent. Words such as "action required" or "please review and sign" in the subject. The message stays in the inbox and is flagged as urgent.

In the last 30 days, that came to about 780 messages archived, 310 summarized, 525 left for a person and 15 flagged as urgent.

The hard part is not sorting the easy mail. It is making sure the system never hides a message a person needed to see. Our rule for that: decide which mistakes you could not undo, and put those decisions in code, not in a prompt.

Written rules decide first

A rule matches a sender's address, a sender's domain or words in the subject line, and it names one of the outcomes. When several rules match, the most specific one wins. A person can read, change or turn off any rule.

A message goes to the AI model only when no rule covers it. The model reads the sender, subject and body, and returns an outcome, a confidence score from 0 to 1 and a one-sentence reason.

The model is set up to fail safely:

  • Below a confidence of 0.6, it changes nothing. The message is left alone.
  • If the call to the model fails, the message is left alone.
  • Its instructions say that when in doubt, it should keep the message in front of a person. Archiving something important is far worse than one extra unread message.
Each new message meets the written rules first, and the AI second Five new messages are checked in order. A receipt from a software vendor matches a written rule, so the AI is not asked and the receipt is archived. A question from a new contact matches no rule, and the AI is unsure at a confidence of 0.41, so the message is left alone in the inbox. A shipping notice matches no rule, and the AI is sure at 0.92, so it is marked read and kept in the inbox. An invoice from a contractor matches a written rule that keeps it in the inbox, unread, so the AI is not asked. A product announcement matches no rule, and the AI is sure at 0.88, so it is archived. Archived means out of the inbox and marked read. Read and kept means it stays in the inbox, marked read. Below a confidence of 0.6, the AI changes nothing. NEW MAIL 1. WRITTEN RULES 2. AI, IF NO RULE RESULT A receipt from a software vendor A question from a new contact A shipping notice An invoice from a contractor A product announcement MATCHED NOT ASKED ARCHIVED NO RULE UNSURE, 0.41 LEFT ALONE NO RULE SURE, 0.92 READ, KEPT MATCHED NOT ASKED INBOX, UNREAD NO RULE SURE, 0.88 ARCHIVED ARCHIVED: OUT OF THE INBOX, MARKED READ. READ, KEPT: STAYS IN THE INBOX, MARKED READ. BELOW 0.6 CONFIDENCE, THE AI CHANGES NOTHING.
Written rules decide first. The AI model reads only what no rule covers, and when it is unsure, the message stays where it is.

If you are automating an inbox, start with rules. They cost nothing to run, and anyone on the team can read them. Then tell the model which way to fail: when it is unsure, it changes nothing.

The AI writes a rule only with evidence

When the model is very sure about a message (0.85 or higher), its verdict can become a new rule, so the next message from that sender skips the model. Two limits apply.

One address, never a whole domain. A large company can send automated receipts and a real person's support reply from the same domain. So a learned rule covers one exact sender address. Only a person writes a rule for a whole domain.

Two separate messages must agree. The rule is written only when a second message from the same address gets the same verdict. One email, however it is worded, cannot write a permanent rule about itself.

The AI writes a rule only after two agreeing verdicts Three messages arrive from the same sender address. The AI reads the first, is sure it should be archived, and archives it, but writes no rule, because one verdict is not a pattern. The AI reads the second message and reaches the same verdict, so a rule is written: archive mail from this one address. The rule is written by the AI and covers that address only; a rule for a whole domain needs a person. The third message matches the new rule, is archived, and the AI is not asked. A fourth message comes from a different address at the same company. The rule does not apply to it, so the AI reads it on its own. One verdict on one message can be undone, while a rule applies to every later message. ONE SENDER ADDRESS, IN THE ORDER IT ARRIVED SAME COMPANY APPLIES First message AI: ARCHIVE, 0.90 ARCHIVED NO RULE YET Second message AI: ARCHIVE, 0.91 SAME VERDICT AGAIN RULE WRITTEN Third message MATCHED BY THE RULE ARCHIVED AI NOT ASKED Another address SAME DOMAIN RULE DOES NOT APPLY THE AI READS IT Rule: archive mail from this address WRITTEN BY THE AI. A WHOLE DOMAIN NEEDS A PERSON. ONE VERDICT ON ONE MESSAGE CAN BE UNDONE. A RULE APPLIES TO EVERY LATER MESSAGE.
One confident verdict archives one message. A second agreeing verdict writes a rule, and that rule covers one address and nothing else on the domain.

A decision about one message is easy to undo. A rule applies to every message after it, so it needs more evidence.

Checks in code protect people's mail

The model judges a message by its text, and text is where a personal note and a marketing email look most alike. A note from an event organizer to three named panelists can read like a promotion.

So a few checks run after the model, in code. They can only keep a message in front of a person. They never archive anything.

  • Someone we have written to. The message is kept, marked read. If the lookup fails, we treat the sender as known.
  • A note to two or more people with no sign of bulk mail, such as an unsubscribe link. The message is kept, marked read.
  • A client contact as the sender or on copy. The message is never archived or marked read, whatever a rule or the model says.
  • Urgent words in the subject, such as "action required" or "please review and sign". The message stays in the inbox, flagged as urgent.

When a check overrules the model, that message is never used to write a rule. The model got it wrong, so its verdict says nothing reliable about the sender.

Checks in code can only move mail toward a person Five messages that the AI or a written rule would archive, and the check in code that runs after the verdict. Mail from a past correspondent: the AI says archive, but we have written to this sender before, so it is kept in the inbox and marked read. A note addressed to three people with no unsubscribe link: the AI says archive, but mail addressed to several people without bulk-mail markers is kept and marked read. A thread with a client copied: the AI says archive, but a client contact is on it, so it stays in the inbox, unread. A notice whose subject says action required: a written rule for that sender says archive, but urgent words in the subject keep it in the inbox, flagged urgent. A mailing-list offer: the AI says archive, no check applies, and it is archived. The checks can only keep mail in front of a person; they never archive anything, and a message a check kept is never used to write a rule. MESSAGE VERDICT THEN A CHECK IN CODE RESULT Mail from a past correspondent A note to three people A thread with a client copied A notice: action required A mailing-list offer AI: ARCHIVE WE HAVE WRITTEN TO THIS SENDER KEPT, MARKED READ AI: ARCHIVE ADDRESSED TO 3, NO UNSUBSCRIBE LINK KEPT, MARKED READ AI: ARCHIVE A CLIENT CONTACT IS ON IT INBOX, UNREAD RULE: ARCHIVE URGENT WORDS IN THE SUBJECT INBOX, URGENT AI: ARCHIVE NO CHECK APPLIES ARCHIVED THE CHECKS CAN ONLY KEEP MAIL IN FRONT OF A PERSON. THEY NEVER ARCHIVE ANYTHING. A MESSAGE A CHECK KEPT IS NEVER USED TO WRITE A RULE.
Each check runs after the model and can only keep a message in front of a person. Mail that no check applies to is archived as usual.

Make your own list of the mistakes you could not recover from, such as a client's email disappearing into an archive. Write each one as a check that can only raise a message's priority. You can test checks like these, and they stay the same when you change the model.

A client's meeting request goes straight to a phone

A client asking for a call is the message we most need to see quickly, because the times they offer run out. So this path is plain code, with no AI step. When a client contact is on a message, the system looks for a scheduling request:

  • Some phrases are enough on their own, such as "can we schedule" or "find a time".
  • Weaker phrases, such as "your availability", count only next to a meeting word like "call" or "Zoom".
  • Calendar invitations, acceptances and "please hold this time" notices do not count.

A match creates a top-priority work item and sends a phone alert that opens it. A follow-up on the same thread is added to that work item. Once we have replied, no more alerts go out, and a repeat alert waits at least six hours.

A client's request for a meeting goes straight to a phone Three messages, each with a contact at an active client on it, checked in code with no AI step. The first, from a client contact, asks whether we can find a time for a call this week. It reads as a scheduling request, so a top-priority work item is created and a phone alert goes out that opens it. The second, also from a client contact, is a calendar invitation for a project review. It is a calendar notice, not a request, so it stays in the inbox. The third, with a client contact copied, asks for our availability on a budget question. A phrase about availability counts only next to a meeting word such as call or Zoom, and there is none, so it stays in the inbox. A follow-up on the same thread adds to the same work item. No alert goes out once we have replied, and a repeat alert waits six hours. A CLIENT CONTACT IS ON EACH MESSAGE CHECK IN CODE, NO AI Can we find a time for a call this week? FROM A CLIENT CONTACT Invitation: project review, Thursday FROM A CLIENT CONTACT Let me know your availability on the budget CLIENT CONTACT ON COPY SCHEDULING ASK FIND A TIME, CALL CALENDAR NOTICE NOT AN ASK NO MEETING WORD NOT AN ASK WORK ITEM + ALERT STAYS IN THE INBOX STAYS IN THE INBOX Meeting request CLIENT CONTACT OPENS WORK ITEM TOP PRIORITY A FOLLOW-UP ON THE SAME THREAD ADDS TO THE SAME WORK ITEM. NO ALERT ONCE WE HAVE REPLIED. A REPEAT ALERT WAITS SIX HOURS.
A client asking for time reaches a phone on the next triage run, with no model in the path. Calendar notices and questions without a meeting word stay in the inbox.

When a rule is clear and a miss is expensive, do not leave it to judgment. Write it as code, test it against real messages, and keep the model for the cases that need judgment.

A person presses Send

Every decision goes into a triage log, with the rule or model result behind it. Every fifteen minutes, our operations agent reads the messages that were not archived. It interrupts someone only for a short written list of reasons, such as a person waiting on a same-day decision. Everything else waits for the next briefing.

For a routine message it can answer with confidence, such as a request to confirm a meeting time, the agent drafts a reply. The draft appears on a card with a Send button. The agent has no tool that sends email, so nothing leaves until a person taps Send. It never drafts on legal, pricing or personnel threads, and when it is unsure, it does not draft at all.

One rule sits under all of this. Anyone can send us an email, so the text of every message is treated as data, not as instructions. The model is told so. Before a subject line or preview is saved to the log, the system removes any text made to look like it came from our system instead of the sender.

The agent drafts a routine reply, and a person sends it Three emails that stayed in the inbox reach the operations agent. The first asks us to confirm that Thursday still works, a routine scheduling confirmation, so the agent drafts a reply. The draft becomes a card marked waiting for review, with the reply text and two buttons: Send, and Send to myself. Nothing sends until a person taps Send. The second is a request to renegotiate a rate, and the third is a contract change to review. Pricing and legal threads are never drafted, so both are queued for the briefing instead. The agent has no tool that sends email, so a draft is the only way out, and it is never used for legal, pricing or personnel threads, or for anything the agent is unsure of. MAIL LEFT IN THE INBOX A CARD IN THE APP Can you confirm Thursday still works? SCHEDULING CONFIRMATION A request to renegotiate a rate PRICING A contract change to review LEGAL DRAFTED Reply to a client WAITING FOR REVIEW Thursday still works on our side. Talk then. Send Send to myself NOTHING SENDS UNTIL A PERSON TAPS SEND NOT DRAFTED, QUEUED NOT DRAFTED, QUEUED THE AGENT HAS NO TOOL THAT SENDS EMAIL. A DRAFT IS THE ONLY WAY OUT. NEVER DRAFTED: LEGAL, PRICING, PERSONNEL, OR ANYTHING THE AGENT IS UNSURE OF.
A routine reply is drafted and waits on a card until a person taps Send. Legal and pricing threads are never drafted, and go to the briefing instead.

Keep sorting, deciding to interrupt and replying as three separate steps, each with its own written rules. Then make a person's tap the only way out.

Start with three lists

If your team also comes back to dozens of unread messages, most of the design starts before you choose a model. Write down three lists: the mail that written rules can handle, the mistakes you could never recover from, and who presses Send. Those lists are where our AI Workflow Review starts.

For how our agent decides what reaches a person at all, read How we cut ten alerting agents down to one. For the same approach applied to deadlines, read How to automate follow-up when deadlines slip. Everything else our agent does, and the rules it follows, is on How we run Kaizen on AI.

Want the same for your company?

Bring us two or three workflows that take up your team's week. We will tell you which one to automate first.

How we implement AI

Book a 30-minute call