How It Works

How do I clean up my Gmail inbox automatically?

The full HealthInbox pipeline, in plain English. Total setup time: about two minutes.

Step 1: Install the extension and connect Gmail

Install HealthInbox from the Chrome Web Store, click the toolbar icon, and press Connect Gmail. You sign in through Google's official OAuth page, so HealthInbox never sees your password. The permission requested is gmail.metadata, the narrowest Gmail scope: it shows message headers and labels, never the body, and cannot delete, send, or modify anything in your account.

Step 2: Scan headers only, never the content

The scan fetches your inbox through the official Gmail API in pages of 500, reading only the headers of each email: sender, subject, date, and technical headers like List-Unsubscribe. The body of your emails is never requested. This is enforced by the API call itself, not just a promise. A 15,000-email inbox scans in a few minutes.

Step 3: AI classification, on your device

Every email is classified into newsletter, spam, subscription, or personal using a two-pass system:

Nothing is uploaded anywhere. There is no server analyzing your email. The AI lives in the browser tab.

Step 4: Clean up from the dashboard

The dashboard turns the classification into actions:

You can try every view on a sample inbox in the demo, without Gmail.

The model and the numbers

Pass 2 uses nli-deberta-v3-xsmall, Microsoft’s DeBERTa-v3 xsmall fine-tuned for natural language inference (about 22 million parameters), in the ONNX build published for Transformers.js. It classifies zero-shot: each email’s sender and subject are tested against the four category descriptions, so no email was ever used to train it. Microsoft reports 88.1% accuracy on MNLI for this model.

A larger base variant (about 184 million parameters) was tested on a real inbox of 7,900 emails. It did not classify better, its confidences were lower, and it cost 12 times the download and 2 to 3 times the latency, so the small model stayed. The lesson: on email headers, the rules carry the accuracy and the model handles the tail.

MeasureResult
Pass 1 rules on the labeled header test set82 / 82
Emails decided by the rules alone (demo inbox)97%
Rules throughputabout 200,000 emails per second
Account inventory for 6,700 emailsabout 20 ms
Question classifiers on the labeled question set (EN/FR)40 / 40
Model download, cached after the first scanabout 25 MB

Timings are from pnpm benchmark on a laptop-class CPU. The labeled sets are the project’s regression tests, written alongside the rules, so they show that known cases stay right, not how a new inbox will score.

Ask your inbox

The Ask view answers questions like “how much do I spend on subscriptions?” or “comptes oubliés”. The question is translated into a small JSON query, validated against a schema, then executed on the data in your browser. Every count and amount in the answer is computed, not generated: a model cannot invent a subscription you do not have. The dashboard shows the query it ran under each answer.

To pick the translator, a dataset was built for the task: 6,000 English and French questions generated from templates, each paired with its query and checked by the extension’s own validator, plus a held-out set of 134 questions written by hand, with phrasings and brand names that never appear in training. Four engines were scored on that held-out set, counting a query as right only when every field matches.

Engine (held-out set, 134 questions)Exact query
Qwen2.5 0.5B Instruct, prompted with the schema and five examples3.7%
Hand-written rule parser59.7%
Linear classifiers trained on the dataset (shipped, 600 KB, 0.07 ms)69.4%
Qwen2.5 0.5B fine-tuned with LoRA on the dataset (one Colab T4)81.3%

The extension ships the trained classifiers: averaged perceptrons over word and character n-grams, one per query field, with service names and time spans read from the text. They run instantly with no download. The fine-tuned model is the most accurate, 84.7% in English and 77.4% in French with valid JSON 99% of the time, but weighs about 500 MB; it stays an experiment for now. In Chrome versions that ship Gemini Nano, the built-in on-device model is used instead, with the query schema as a response constraint.

The lesson: a general model of half a billion parameters barely does the task, the same model fine-tuned on a few thousand targeted examples does it best, and a few hundred kilobytes of trained weights beat the rules people would write by hand.

Step 5: Stay clean

Subsequent scans are incremental: only emails newer than your last scan are fetched, so keeping the dashboard fresh takes seconds. Unsubscribed senders are remembered, and the health score tracks your progress over time.

Two minutes to a readable inbox. Free, with no account.

Add HealthInbox to Chrome, free

Common questions

What happens to my data if I uninstall?

Everything HealthInbox stores lives in your browser's local extension storage. Uninstalling removes it. You can also click Disconnect in Settings at any time, which revokes the Google access token and erases all local data.

Why does the first scan download a model?

The AI classifier is an open-source model fetched once from Hugging Face (~25 MB) and cached by the browser. That download is the only reason the first scan takes slightly longer than the following ones.

Which browsers are supported?

Google Chrome. Classification can use your GPU through WebGPU for extra speed; on machines without GPU support it falls back to CPU automatically.

Related reading