Email-to-Brain

Gmail messages collected into digest files at raw/email/. Deterministic noise filtering, Gmail link generation, and entity detection.

Design: Code for Data, LLMs for Judgment

The collector handles the mechanical work: pull emails, generate Gmail links, filter noise, detect signature requests. This never fails - links are always correct, timestamps always accurate. The agent handles judgment: who is important, what entities are mentioned, what action items exist. Source: scripts/sync-email.ts; recipes/email-to-brain.md

Usage

npx tsx scripts/sync-email.ts --auth              # first-time OAuth (adds Gmail scope)
npx tsx scripts/sync-email.ts                      # collect since last run
npx tsx scripts/sync-email.ts --days 7             # collect last 7 days

Output

Digest files at raw/email/{YYYY-MM-DD}.md with three sections:

  1. Signatures Pending - DocuSign, HelloSign, etc. needing action
  2. Messages to Triage - real emails from real people with Gmail links
  3. Noise - filtered automated messages (available if needed)

Raw JSON preserved at raw/email/.raw/{YYYY-MM-DD}.json for provenance.

Noise Filtering (Deterministic)

Automatically filtered: noreply, no-reply, notifications, calendar-notification, mailer-daemon, donotreply, automated, alerts, updates, newsletter, marketing, promo.

Generated by code, never by LLM. Format: https://mail.google.com/mail/u/?authuser=ACCOUNT#inbox/MESSAGE_ID

Every email in the digest has a working "Open in Gmail" link.

Dedup

Message IDs tracked in PGlite. Re-running the collector skips already-seen messages.

Cost

$0/mo - Gmail API is within free quota for personal use.


Timeline