I built Automatr, a local-first email assistant that automatically categorizes, archives, and summarizes my Microsoft Outlook inbox using multi-layer AI classification.

How It Works

Automatr processes emails through four classification layers:

1. Learned Rules - User corrections are stored and applied first. If I correct a misclassification, future emails from that sender or matching that pattern go directly to the corrected category.

2. Hardcoded Rules - Pattern matching for obvious cases. Emails with List-Unsubscribe headers go to Marketing, receipts go to Finance, etc.

3. Semantic Embeddings - Uses OpenAI’s text-embedding-3-small to compare emails semantically to known examples from each category.

4. LLM Adjudication - For ambiguous cases (confidence < 0.6), GPT-4o-mini makes the final classification decision.

Most emails are classified through the first two layers in milliseconds. Only genuinely ambiguous emails require the more expensive LLM call.

Auto-Archive Logic

Not all categorized emails get archived. The system considers:

  • Category rules (Marketing, Finance, Product Updates = archive; Clients, Ops = stay in inbox)
  • Classification confidence (must be >0.6 to auto-archive)
  • Email source (company domain emails never auto-archive)
  • Thread context (recently replied threads stay in inbox)

Email Summaries

Each category has customized prompts for summarization:

  • Clients: Highlights client name, questions asked, deadlines, and actions needed
  • Ops: Shows affected system/service, severity, and required actions
  • Projects: Notes task assignments, questions, and blockers

Summaries are cached locally for fast digest generation.

Integration with Automation Ecosystem

In my Obsidian vault automation post I described how I automate a daily note from tasks that I should make sure I look at today. Either they are urgent or important for myself; someone on my team asked me a question, someone is waiting for my review or decision, or a project deadline is approaching for one of my subordinates, that I need to act on - or at least be aware of.

I added email into this mix (as well as Omnifocus for personal tasks and projects). The automation runs every 90 minutes and this means that I just need to look at this document whenever I am stuck, have some free time, or want to review my progress.

It also allows me to correlate incomming mails with projects that are waiting for feedback; and the ai agent doing these reviews of my tasks and mails are doing a great job of making sure I am aware of any correlation between mails and tasks.

Developer Tool Reality

This was built rapidly with AI assistance, and it shows. There’s quirky terminology, features I never use, and names that don’t quite make sense. It’s tailored to my specific use case.

If you’re comfortable with Go and can adapt code to your needs, the architecture is solid. If you want a polished end-user product, this isn’t it yet. A more user-friendly v2 might happen eventually, but for now this is a developer tool; or at least a tool for developers.

Usage

# Build
go build -o automatr ./cmd/automatr

# Authenticate with Microsoft
./automatr -auth

# Sync emails (fetch, classify, archive, summarize)
./automatr -sync -sync-timespan 48h

The sync command fetches recent emails, classifies them through all layers, auto-archives based on rules, generates AI summaries, and outputs a markdown digest. I always run the 48h sync command - even though that makes emails reappear the next day in my daily note even if I already read them - but sometimes the context is good for me to have. So the positives outweigh the negatives here.

Why Local-First

Everything runs on my machine. Email metadata and classifications live in local SQLite. The only external calls are to Microsoft Graph for email operations and OpenAI for AI features. Email content never goes to third-party storage. This also allows me to not think too much about security and privacy; and I don’t need multitennancy. It is just my own email; nothing more.


The project is public at github.com/clauswitt/automatr. It requires:

  • Azure App Registration with Mail.ReadWrite permissions
  • OpenAI API key
  • Go 1.24.0+
  • Comfort with Go code

Setup instructions are in the README.