DEV Community

Arpita Singh
Arpita Singh

Posted on

I built Inbox Sloth: The Local-First AI Ghostwriter for Your Most Stressful Emails

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady 🦥

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

I built Inbox Sloth, a local-first AI ghostwriter that drafts emails in your exact voice.

We all have that one email we've been avoiding. The passive-aggressive client, the boss asking for a weekend update, the vendor asking for a meeting that could have been an email. Writing a reply takes 5 minutes. Avoiding it takes 3 days of low-grade anxiety.

ChatGPT doesn't fix this. It drafts generic corporate fluff that sounds like a robot.

Inbox Sloth fixes this. You paste the incoming email, and it generates three options:

  1. Short: A 1-sentence reply.
  2. Polite: A standard professional response.
  3. Pushback: A firm decline.

But the magic is the Tone Profile. You can paste a past email you wrote. Inbox Sloth saves it to MongoDB Atlas. Next time you generate a reply, it uses MongoDB as a data layer to feed your past writing to the AI, so the drafts actually sound like you—not a customer service bot.

Demo

This app is designed to run 100% locally for privacy. The code is fully runnable via Ollama + MongoDB local.

Code

GITHUB URL

How I Built It

The stack is FastAPI, HTMX, MongoDB Atlas, and Gemma.

I wanted this to be zero-friction. There is no login, no file uploads, no complex UI. You paste text and hit a button. HTMX handles the asynchronous loading states without needing React.

The hardest part was the prompt engineering. To make the AI act as a ghostwriter, I fetch the user's past replies from MongoDB and inject them into the prompt as "Few-Shot Examples". Then, I force the AI to return a strict JSON object with exactly three keys (short, polite, pushback).

Because I used Gemma, I also had to add a custom parser to strip out the AI's "internal thoughts" before parsing the JSON, since Gemma sometimes tries to plan its response out loud.

Why Does Open Innovation Matter?

Emails contain sensitive company data, client names, and sometimes confidential legal discussions. Sending this data to a closed API like OpenAI means sending your company's inbox to a third-party server.

Inbox Sloth is local-first. If you run it with Ollama (gemma3:4b), your emails never leave your laptop. MongoDB can be run locally. The entire app is a private, closed loop.

To make the demo link work (since free hosting can't run a 4GB model), I built a hybrid architecture: it tries the local Ollama server first, and falls back to the Google AI Studio API only if needed. The app remains 100% open-source and can be run completely offline.

Prize Categories

  • Best Use of MongoDB Atlas — Used as the persistent data layer to store and retrieve the user's Tone Profile for few-shot prompting.
  • Best Use of Gemma — Gemma 3 4B via local Ollama, with a Google AI Studio Gemma fallback.
  • Best Use of Render — FastAPI app designed for Render deployment using the cloud inference fallback.

Top comments (0)