John Jomi
All Projects
Completed/Case Study

Email AI Classifier

An email classification system that uses Google Apps Script and Gemini batch inference to apply hierarchical labels to Gmail automatically, surfaced through a companion Safari extension.

The Problem

Gmail's own filters are rule-based, so they need a rule written in advance for every category that matters. A language model can classify a message on meaning instead, which handles the mail no one thought to write a rule for.

Pipeline

Google Apps Script acts as the backend orchestrator, retrieving mail from Gmail and batching it to the Gemini API for classification. Results come back as hierarchical categories, which are applied to the mailbox as labels and rendered in a Safari extension.

  • Gmail integration through Apps Script for retrieval and label application
  • Batch classification to keep API calls efficient across large mailboxes
  • Hierarchical label taxonomy rather than flat categories
  • Safari extension with its own content scripts, background logic and manifest

Structure

The repository separates the two halves cleanly: apps-script holds the Google Apps Script project and source, and safari-extension holds the browser extension implementation.