From d3c8ea1bafdd21a21de24affc8ed3e71ec493a6d Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Oct 2026 21:47:17 +0000 Subject: [PATCH] Explain using Mailbox with AI agents and align example config paths Add an AI agents section covering why a local Markdown archive beats per-app Gmail connectors, which folders agents should and should not read, and how to build a linked knowledge base beside the mail folder. Point config.example.toml at the Mailbox-private layout the setup steps already use. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01378HLePPQnfgJZJebg3MwR --- README.md | 29 +++++++++++++++++++++++++++++ config.example.toml | 4 ++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0efdd8e..a2176d3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ A Gmail reader that runs on your computer and saves your mail as readable text files, original emails, and attachments. Browse a list or a board, organize folders, and send or reply through Gmail. Your saved files remain usable without Mailbox. +Mailbox is built for working with AI agents. Instead of giving each AI app its own Gmail connection, you get one folder of plain text that Codex, Claude Code, opencode, or any agent that reads files can search, summarize, and build on. See [Use with AI agents](#use-with-ai-agents). + This is a **Windows beta**. Real Gmail send/reply, sync, token refresh, reauthorization, and Windows file/folder opening have been checked. Core automated tests also cover Linux and macOS, but native desktop integration on those platforms remains unverified. Mailbox does not upload your archive to a separate hosted service or send usage analytics. ## Start here @@ -155,6 +157,33 @@ Mailbox opens in your browser. If it does not, type `http://localhost:5000` into Google connections left in Testing have [seven-day authorization expiry](https://support.google.com/cloud/answer/15549945?hl=en), so you may need to sign in again. See **Expired/revoked sign-in** under Troubleshooting when this happens. A work/school account may require your administrator's approval. +## Use with AI agents + +Open your agent in the `Mailbox-private` folder and ask it about your mail. Compared with connecting Gmail to each AI app: + +- One archive works with every agent, so you are not tied to one vendor's plugin. +- Agents can search everything at once and follow whole threads. Each Markdown file starts with `from`, `to`, `cc`, `date`, `subject`, `in-reply-to`, and `references`. +- You own the Google connection, and Mailbox sends only when you click Send. +- Synced mail stays readable offline and without Mailbox. + +Let agents read `inbox/`, `sent/`, and your own folders. Keep them away from `client_secret.json` and `mail/.auth/`: the token there can read and send your Gmail. Treat `.state/` and `.originals/` as read-only. If your agent uses a cloud model, the messages it reads are sent to that model's provider; use a local model if mail must stay on your computer. + +### Build a knowledge base from your inbox + +This follows Andrej Karpathy's "LLM wiki" idea: an agent reads raw sources and keeps a set of linked pages about them up to date. Mailbox is the raw source. Keep the agent's pages beside the mail folder, not inside it, so they do not appear as Mailbox folders: + +```text +Mailbox-private/ + mail/ Mailbox data_dir; agents read, never edit + wiki/ Pages the agent writes and maintains + AGENTS.md Your rules: page formats, linking, never edit ../mail + people/ + projects/ + log.md What the agent processed and when +``` + +After each sync, ask the agent to read new messages, update the relevant pages with links back to the source Markdown files, and add an entry to `log.md`. Codex and opencode read `AGENTS.md`; for Claude Code, add a `CLAUDE.md` that points to it. + ## Data and security ```text diff --git a/config.example.toml b/config.example.toml index 502c96e..44fa9b0 100644 --- a/config.example.toml +++ b/config.example.toml @@ -3,11 +3,11 @@ # Where Mailbox stores email data on disk (OUTSIDE the repo). # Created on first run. -data_dir = "~/Mailbox" +data_dir = "~/Mailbox-private/mail" # Path to the OAuth client credentials JSON downloaded from Google Cloud Console. # Create a Desktop OAuth client (see README) and save the JSON anywhere readable. -oauth_client_secrets = "~/Mailbox/.auth/client_secret.json" +oauth_client_secrets = "~/Mailbox-private/client_secret.json" # Rolling lookback for each sync; already completed messages are skipped. backfill_days = 30