Personal Google Apps Script collection for keeping a Gmail inbox tidy.
- Hot. Inbox is important mail that's either unread or younger than a day. New senders land in Hot or Meh by your first call: mark important to let them in, unimportant to filter them out. The LLM learns from each call.
- Meh. Pretrash is a browsing space for newsletters and low-priority mail. Salvage means "keep this kind." Auto deletes after 20 days if untouched.
- Ping. Read mail two or three days old with no reply gets resurfaced to Hot. Remove the marker and it's archived for good. Resurfaced at most once per thread.
- Bunch. Per domain labels for one click access to all conversations with a sender.
- Stash. Important threads carrying an attachment get a label for easy retrieval.
If this approach resonates, check out Posta, my opinionated take on a mail client.
- Gmail's importance flag is the single source of truth.
- The LLM is a corrective layer over Gmail, not a parallel system.
- Salvage, promote, and demote are training signals.
- Reversible by default: pretrash before trash, classifier acts only when confident enough.
cleanUp.gs. Schedules low-priority mail for deletion, keeps pinned/important state consistent, and trains a Gemini Flash classifier (shadow mode) on what you actually salvage or discard so the rules improve over time. See Classifier setup below.
public.gs. Publishes Gmail threads labeled 🌎 Public as a web page. Deploy as "Execute as: me" with access "Anyone with the link" at most; never "Anyone, even anonymous."
riff.gs. Apply 🦾 to any thread to add some AI muscle. Riff uses recent sent emails labeled 🫵 to match your voice.
bunch.gs. Groups important untagged threads under per-domain labels.
burndown.gs. The threads you didn't get to yesterday, all in one mail. Reply once. Drafts land on each thread.
- Add
GEMINI_API_KEYto Script Properties (get one). - Run
install()from the editor. It creates the spreadsheet, sets up the triggers, and confirms Gmail's Advanced Service is enabled. - Flip
CLASSIFIER_SHADOW_MODEtofalsein_config.gswhen you want the LLM to act on its verdicts.
The classifier abstains until ~5 keep and ~5 trash examples accumulate in Training from your salvage/demote behavior.