Dev.to · 6 min read

The Sloth Inbox: I Built an AI That Dreads My Inbox So I Don't Have To 🦥

The Sloth Inbox: I Built an AI That Dreads My Inbox So I Don't Have To 🦥

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady What I Built Tomorrow is International Sloth Day, and I have decided the sloths are right about everything. A sloth's whole philosophy is: move slowly, conserve energy, and let the world come to you. My inbox is the opposite of that philosophy. It arrives overnight, all urgency and exclamation points, and demands I become a different animal — a twitchy meerkat, scanning the horizon at 7 AM for bills, permission slips, and "FINAL NOTICE" subject lines. So I built The Sloth Inbox: a local overnight triager that reads the pile while I sleep and hands me a two-to-three-line morning brief. That's it. That's the whole product. It does the dreading so I don't have to. Here's what a morning looks like now: The inbox did the overnight shift. You just woke up. 14 messages arrived overnight: 4 need you, 2 newsletters filed for later, 2 promos quarantined, 2 receipts archived, 2 social pings, 2 low-priority drift. Worth your energy: Payment due: your electric bill; Permission slip needed for field trip; Reminder: dentist appointment tomorrow at 9. Sloth take: 4 of 14 need you; the rest can marinate. Handle the few, ignore the many. Three lines. I know exactly what deserves my energy and exactly what can marinate. The sloth take at the end is generated by a local open-weight model (more on that below) — or, when no model is installed, by a clearly-labeled mock, because a sloth would never pretend to be something it isn't. Demo No deployed link — this one is proudly, deliberately local-first, which is the entire point (see "Why Does Open Innovation Matter?" below). Here's a real run against a synthetic 14-message overnight inbox: ============================================================ 🦥 THE SLOTH INBOX — morning brief ============================================================ The inbox did the overnight shift. You just woke up. 14 messages arrived overnight: 4 need you, 2 newsletters filed for later, 2 promos quarantined, 2 receipts archived, 2 social pings, 2 low-priority drift. Worth your energy: Payment due: your electric bill; Permission slip needed for field trip; Reminder: dentist appointment tomorrow at 9. Sloth take [mock:mock-canned-take-v1]: 4 of 14 need you; the rest can marinate. Handle the few, ignore the many. [mock take] ------------------------------------------------------------ adapter : mock:mock-canned-take-v1 ledger : out/ledger.json (14 messages classified) brief : out/brief.json Alongside the brief it writes a full audit ledger — every message, its bucket, its confidence score, and the exact reasons it landed there: { "message_id": "m01", "category": "needs-you", "confidence": 1.0, "reasons": ["subject hit: 'payment due' (+10) -> needs-you", "subject hit: 'bill' (+6) -> needs-you"], "sender": "billing@citypower.example", "subject": "Payment due: your electric bill" } No black box. If it files your electric bill under "low-priority drift," you can see exactly which rule betrayed you. Code The project is pure Python, standard library only — no dependencies to install, no API keys, no accounts: slothinbox/classifier.py — deterministic rule+heuristic triage: six buckets (needs-you, newsletter, promo, receipt, social, low), keyword scoring with subject hits weighted 2×, structural signals (like List-Unsubscribe), and a bulk-sender nudge. Same inbox in, same triage out, every time. slothinbox/models.py — the pluggable model layer: a MockModelAdapter for offline testing and an OllamaAdapter that talks to a local Ollama server (default model: Gemma 3). slothinbox/brief.py — the template-based morning-brief builder plus brief.json / ledger.json output. run_sloth.py — the CLI. python3 run_sloth.py --demo and you're triaging. test_flow.py — 15 checks, 15/15 passing, all against the mock adapter. Repo: https://github.com/midnightmichigan/sloth-inbox (public, MIT — the complete project above, 15/15 checks green) How I Built It The architecture has one non-negotiable principle: the model never sees your email. Triage — the part that actually touches private messages — is the deterministic classifier. It's fast, explainable, testable, and it runs anywhere Python runs, including a laptop with the Wi-Fi off. The open-weight model has exactly one job: read the aggregate stats (counts per bucket, nothing more) and write the one-line "sloth take" at the end of the brief. Stats in, one sentence out. There is no prompt on earth that can leak an email the model was never given. The model layer is a two-line swap: adapter = MockModelAdapter() # tests, offline, CI adapter = OllamaAdapter(model="gemma3") # the real thing, localhost only OllamaAdapter speaks to localhost:11434 with the standard /api/generate endpoint — stdlib urllib, no SDK needed. If Ollama isn't running, it raises a clear error and the brief falls back to a labeled template take; classification is never affected. I developed and tested the full pipeline against the mock adapter (15/15 green, including a graceful-degradation test with no server present); the Gemma path is implemented and waiting for a machine with Ollama installed. Why Does Open Innovation Matter? This project only works because the AI is open. A closed API would break it in four places: Privacy. The whole premise is "your email never leaves your machine." The moment triage requires sending your inbox to someone else's server, the product is a surveillance device with a cute sloth mascot. Local open-weight inference is what makes the privacy claim true instead of marketing. Cost. A sloth runs this every single morning, forever. Per-token billing turns "free morning brief" into a subscription for the privilege of reading your own mail. Local inference costs $0 per run, $0 per month, $0 forever — which is exactly the sloth budget. Offline. It triages overnight. The laptop is closed, maybe the Wi-Fi is off, maybe you're on a cabin weekend. A cloud model can't run at 3 AM on a laptop with no connection. A local one can. Swap-ability. Don't like Gemma? Point the adapter at any Ollama-served open-weight model. Want a smaller model for a Raspberry Pi that lives next to the router? Same two lines. Open weights mean the project belongs to whoever runs it, not whoever bills them. Closed AI would make this a SaaS signup form. Open AI makes it a script you own. The Lazy Payoff I ran it this week on a synthetic 14-message overnight inbox — bills, a school permission slip, newsletters, flash sales, shipping confirmations, social pings, and one forwarded sloth video from an uncle. Triage took well under a second; the brief is three lines; the ledger explains every decision. The manual equivalent is opening 14 messages, skimming each, and mentally sorting them before coffee — roughly ten minutes of meerkat-mode every morning, or about 60 hours a year of pre-coffee triage. The Sloth Inbox compresses that to the time it takes to read three lines. Energy conserved. Leaves eaten slowly. This is the way. Prize Categories Overall — the sloth competes for the crown, obviously. Best Use of Gemma (candidate) — the model layer is built around local open-weight inference with Gemma 3 via Ollama as the default target: no cloud, no keys, no per-token cost. Flagging as a candidate rather than a certainty: the pipeline is fully verified against the mock adapter, and the Gemma path is implemented and ready for a local Ollama install.

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More AI & Machine Learning News