Skip to content
← all work

2026 · Solo

Zoho Mail AI Triage

A hybrid rule-engine + LLM that auto-classifies and routes a Zoho inbox.

Problem

Inbox triage is repetitive: most mail (rejections, OA invites, OTPs, newsletters) follows obvious patterns, yet running every email through an LLM is slow and expensive.

Approach

  • Hybrid pipeline: a deterministic rule engine handles obvious cases instantly; only ambiguous emails are sent to the LLM.
  • Priority-ordered decision-tree prompt with 9 annotated few-shot examples for consistent edge-case classification (confirmations, rejections, OTP codes).
  • First-match-wins routing into purpose-built Zoho folders — OTPs auto-deleted, uncertain mail flagged for manual review, nothing left stranded.
  • OAuth2 with automatic token refresh on 401; first-run full backfill then incremental fetch via a known-ids optimization.

Architecture

  • Multi-provider LLM behind one interface (DeepSeek, OpenAI, Groq, Claude, local Ollama), switchable with one line in .env.
  • Rule engine + LLM classifier feed a deterministic routing table applied via the Zoho Mail API.

Impact

  • Cuts LLM API cost ~60–70% by resolving obvious cases with the rule engine before involving the LLM.

Stack

PythonLLM (DeepSeek / OpenAI / Groq / Claude / Ollama)Zoho Mail APIOAuth2