- Zemail is a free, open-source Claude Code plugin that gives Claude semantic search over your Gmail inbox.
- Gmail search is keyword-matched. Claude’s default Gmail connector is keyword-matched, paginated, and usually gives up before finding what you meant.
- Zemail embeds your inbox locally with zembed-1 and reranks with zerank-2. The index lives on your machine, not ours.
- Install:
/plugin marketplace add zeroentropy-ai/claude-plugins→/plugin install zemail@zeroentropy - Source: github.com/zeroentropy-ai/zemail
Zemail
Semantic Gmail Search for Claude Code
Gmail’s search box is older than many of its users, and that is reflected in the efficacy of its search. It matches keywords. If the email you’re thinking of doesn’t contain the exact word you typed, then as far as Gmail is concerned, it simply does not exist.
Claude’s built-in Gmail connector inherits this. Ask Claude to find an email, and it issues a keyword query, reads the first page of results, shrugs, and tells you it couldn’t find anything. The email is there; it just doesn’t share any vocabulary with the question you asked.
Your inbox is a retrieval problem, and Gmail’s keyword search is a retrieval system from 2004.
Zemail is a Claude Code plugin that solves this problem. Embed every email, cosine-search by meaning, rerank the top candidates, hand the ten best to Claude. The same two-stage pipeline every serious RAG system converges on, pointed at your own mailbox.
The Emails Gmail Can’t Find
- “the refund email from the airline about the cancelled flight last spring” — the actual subject line is Your booking PQR-48X2 has been updated. The word refund appears nowhere.
- “the Stripe receipt for the domain I bought” — Stripe calls it a payment, the registrar calls it an order, the word domain is in the body of neither.
- “who was the dentist my dad recommended” — your dad’s email said “you should see Dr. Chen”. It did not say dentist.
- “that newsletter with the sourdough recipe” — the issue is titled Issue #47: Spring Breads. Sourdough is one ingredient among six.
- Any query against an inbox that mixes languages. Gmail’s tokenizer does not know that facture and invoice are the same word.
None of these examples are exotic. They’re the median thing you actually want to find in your own email, and Gmail loses every one of them. A keyword index cannot match concepts; the model on the other side of a keyword index cannot find what the index didn’t return.
How It Works
Zemail is a local MCP server that Claude Code runs as a plugin. When Claude needs to search your email, it calls Zemail instead of Gmail’s keyword search.
Sync
Zemail pulls messages through the Gmail API (read-only, incremental), sends each subject + body to zembed-1, and writes the returned vectors to a float32 file on your disk. First sync takes a few minutes; subsequent syncs only process new mail.
Query
Claude asks a natural-language question. Zemail embeds the query, runs brute-force cosine similarity over the in-memory matrix, and takes the top 50 candidates. Even a few hundred thousand 2560-dim vectors is a couple hundred milliseconds on a laptop.
Rerank
The top 50 go to zerank-2, which actually reads the query against each document and returns a calibrated relevance score. The top 10 come back to Claude, which can call get_email on any ID to pull the full body.
The tools Zemail hands Claude:
| Tool | Purpose |
|---|---|
sync_emails | Fetch from Gmail, embed, write the local index. |
search_emails_tool | Embed the query, cosine top-50, rerank with zerank-2, return top 10. |
get_email | Fetch the full body of a message by ID. |
index_status | Report index size and last sync time. |
authorize_gmail | Paste-in OAuth flow for SSH / headless setups. |
Claude decides when to call each; you just ask questions.
Scope and Data
Zemail requests a single Gmail scope, gmail.readonly, which is the minimum required to read message bodies for indexing. Claude away with ease of mind: Zemail can’t send, edit, or delete any of your emails.
Your OAuth token, message metadata, and embedding index are stored locally in ~/.zemail/. Email text is sent to the ZeroEntropy embedding and rerank APIs only as part of each request, and is not retained. All your search happens locally and securely. Source: github.com/zeroentropy-ai/zemail.
Install
Add the marketplace
In Claude Code:
/plugin marketplace add zeroentropy-ai/claude-plugins
/plugin install zemail@zeroentropyClaude will prompt for a ZeroEntropy API key at install. Paste a key from dashboard.zeroentropy.dev/api-keys — free, no credit card, keys start with ze-.
Authorize Gmail
The first time Claude uses Zemail, it’ll print a Google OAuth URL. Open it, pick your account, approve the read-only scope, paste the code back. The refresh token is saved locally so you only do this once.
Sync and ask
Tell Claude to run sync_emails. Once the index is built, ask: “find the airline refund from last spring”, “who did my dad recommend for a dentist”, “pull the Stripe receipt for that domain”. Claude calls search_emails_tool, reads the top few hits, and answers.
Why We Built This
We train the best embedding and reranker models available, and the hardest part of trying them on your own data is usually the plumbing. Zemail is a way to skip the plumbing. Install a plugin, authorize a scope, watch a two-stage retrieval pipeline find the email you gave up on finding a year ago.
If it works on your inbox, it will work on your company’s documents.
Get Zemail
Free, open-source, and runs locally. The ZeroEntropy API key is free too.
ze- key → Discord Tell us what it surfaced in your inbox Install in Claude Code:
/plugin marketplace add zeroentropy-ai/claude-plugins
/plugin install zemail@zeroentropy
