Shortwave is a front end for Gmail, so a one-person copy is a local cache of your mailbox with search, threads and a language model on top: summaries, drafts in your tone and questions answered from years of mail. An agent wires that up over a weekend. The weekend goes on mail correctness: incremental sync that never loses or duplicates a message, rendering other people's HTML safely, sending from the right address, and Google's rules, since a project in Testing status issues refresh tokens that expire after 7 days. IMAP with an app password sidesteps that. Phone apps, team comments and shared threads stay behind.
Before you buildCheck Shortwave Free first: basic AI with a limited quota and 90 days of search history cost nothing, with a 'Sent with Shortwave' line added to your mail. You outgrow it when you need to search older mail with AI.
Build me a personal AI email client for Gmail to replace Shortwave. Requirements: - Node.js 22 + TypeScript: a Fastify server and a React front end built with Vite. `npm start` serves http://localhost:4790, bound to localhost only. - Mail source behind a MailProvider interface: the Gmail API (`googleapis`, OAuth client from GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET in .env, read, modify and send scopes only) or `imapflow` with an app password; MAIL_MODE in .env picks one. - Storage: better-sqlite3 in ./data/mail.db with threads, messages (headers, text body, sanitized HTML, labels), attachment metadata fetched on demand, an FTS5 index and `sqlite-vec` embeddings per message. The first sync pulls 12 months; later syncs use Gmail history IDs (or IMAP UIDs) and never duplicate or drop a message. Add a test that replays a sync twice. - Inbox: splits defined in splits.yaml (a Gmail search query each), a bundle row per newsletter sender per day, keyboard control (j/k, e archive, # trash, r reply, s snooze) and snooze that returns the thread at the chosen time. - Reading: render HTML with `dompurify` inside a sandboxed iframe and block remote images until you click. - AI through an OpenAI-compatible endpoint (LLM_BASE_URL, LLM_API_KEY, LLM_MODEL in .env): a cached thread summary on demand, a Draft reply button that copies your tone from 20 of your sent messages, and an Ask box that answers over the whole mailbox using FTS5 and vector search and links the messages it used. - Compose: send through the Gmail API or SMTP, save drafts after each pause and allow undo for 10 seconds. - Single user. No accounts, no telemetry, local-first. Outbound calls: Gmail or IMAP, SMTP and the model endpoint; the README lists exactly which email text goes to the model. - Out of scope: several accounts, team features and shared threads, calendar, read receipts and link tracking, mobile apps, Outlook and Exchange. - README: creating the Google Cloud OAuth client, with a warning that a project left in Testing status issues refresh tokens that expire after 7 days, the IMAP app-password route, and how to back up ./data.
Opens your agent with the prompt filled in, you press enter. Or copy it and paste it into an empty folder.
The first prompt builds the core. Run these one at a time in the same folder to grow it into your own Shortwave.
Add follow-up reminders to the email client in this folder. Requirements: - A checkbox in the composer: "Remind me if no reply in N days" (default 3), stored with the thread. - A background job every 15 minutes that finds threads where my message is the latest and the due date has passed, and returns them to the inbox with a "No reply" label. - A reply from anyone, or me marking the thread done, cancels the reminder. - List pending reminders on a page with a button to cancel each. - Update the README.
Add a daily newsletter digest to the email client in this folder. Requirements: - Collect messages bundled as newsletters in the last 24 hours and ask the model for one line per message and a short summary of the day, each linking back to the original. - Write the digest as one pseudo-thread at the top of the inbox at 07:00 local time, and make it skippable with a single key. - Never send the body of a message marked sensitive in splits.yaml to the model. - Update the README with the cost per day at 50 newsletters.
Add multi-account support to the email client in this folder. Requirements: - Store accounts in a table with their own provider settings and sync state; credentials stay in .env under ACCOUNT_1_*, ACCOUNT_2_* names. - A unified inbox and per-account views; replies send from the account the thread arrived on, with a picker for new messages. - Search and Ask cover every account by default, with a filter for one. - Update the README with the changed .env keys and a migration for the existing database.
Make the email client in this folder work without an outside model. Requirements: - Support Ollama for completions and embeddings (OLLAMA_URL, CHAT_MODEL and EMBED_MODEL in .env) next to the OpenAI-compatible option, chosen by one setting. - Re-embed the mailbox when the embedding model changes, and refuse to mix vectors from two models. - Show in the UI which endpoint is active and whether any email text leaves the machine. - Update the README with a model suggestion for a 16 GB laptop.
Email is where AI helps at once: a question like what the landlord said about the deposit answered from years of mail, a long thread summarised before you open it, a reply drafted in your voice. Shortwave packs that into a fast Gmail client, so nobody has to bolt an assistant onto their own inbox. People who rely on it also rely on someone else running the sync, the apps and the model quota.
Estimate · Gmail API calls at one mailbox's volume are free. Summaries and answers cost a few cents a day through a hosted model, and nothing through Ollama. The build is token usage on your agent plan.
| Plan | Monthly | Annual, per month | What you get |
|---|---|---|---|
| Free | $0 | — | Basic intelligence, limited AI usage quota, 90 days of standard and AI search history, up to 15 threads per AI search, basic inbox settings. |
| Pro | $18 | — | Standard intelligence and quota, full standard search history, 3 years of AI search history, up to 50 threads per AI search, AI web browsing, personalized AI writing, AI autocomplete and instant summaries. |
| Business | $30 | — | More AI usage, 5 years of AI search history, 3 AI-powered filters, AI integrations, attachment analysis, read statuses, link tracking and snippets. |
| Premier | $45 | — | Advanced intelligence, twice the AI usage, unlimited AI search history, up to 100 threads per search, 10 AI filters, double the context. |
| Max | $120 | — | Expert intelligence, six times the AI usage, up to 150 threads per search, 50 AI filters, triple the context. |
Free has basic AI with a limited quota, 90 days of search history and a 'Sent with Shortwave' signature on your mail.
Kinda. The core is a weekend build with the prompt on this page, but real gaps remain: Desktop and phone apps with push notifications, Team features: shared threads, comments, assignees and shared labels.
About $18 a month on the Pro plan per seat, $216 a year (checked 2026-10-19).
Desktop and phone apps with push notifications; Team features: shared threads, comments, assignees and shared labels; Automation beyond your own filters, through the Tasklet link to 3,000+ apps; Read statuses, link tracking and snippets on the Business plan and up; A vendor that keeps up with Gmail changes while you do something else. If any of those matter to you, keep paying.
Yes: Zero (Mail-0) (open source), Inbox Zero (open source), Mailspring (open source).