mailspring-ai-search
Early Development — Proof of Concept
This plugin is in early development and has received limited testing. APIs, configuration formats, and behaviour are subject to change without notice. It is published to demonstrate the approach and invite collaboration — not for production use. Expect rough edges, bugs, and breaking changes.
Contributions, issues, and feedback are welcome.
AI-powered semantic search for Mailspring — bringing vector embeddings, LLM query understanding, and conversational email search directly into your mail client.
Features
- Semantic search — find emails by meaning, not just keywords (“what did the team say about the budget?” works)
- LLM query understanding — natural language queries are parsed into precise database filters + semantic search
- Structured answers — get a synthesised answer with citations rather than just a list of emails
- Configurable providers — bring your own embedding and LLM provider (OpenAI, Anthropic, AWS Bedrock, Ollama, or local ONNX)
- Privacy-first — all data stays local in LanceDB; only text sent to your configured provider
- Zero re-fetching — reads directly from Mailspring’s local database, no IMAP needed
Installation
From a release zip (recommended)
-
Download the latest
mailspring-ai-search-*.zipfrom Releases -
Extract the zip to a folder
-
Open a terminal in that folder and run:
npm install --omit=dev node scripts/patch-arrow-csp.js -
In Mailspring: Edit → Developer → Install a Plugin… → select the extracted folder
-
Open Preferences → AI Search to configure your providers
From source (for development)
git clone https://github.com/tott/mailspring-ai-search
cd mailspring-ai-search
npm install
npm run build:dev # compiles and syncs to ~/.config/Mailspring/packages/
Then reload in Mailspring: Edit → Developer → Reload Package.
Configuration
Open Mailspring → Preferences → AI Search to configure:
- Embedding provider — choose your embedding backend and enter credentials
- LLM provider — choose your LLM backend and enter credentials
Credentials are stored in Mailspring’s config store (~/.config/Mailspring/config.json), separate from general plugin settings. This file is only readable by the local user. Environment variables (OPENAI_API_KEY, etc.) take precedence and are recommended for shared/CI environments.
AWS Bedrock (bearer token)
If your organization uses AWS SSO with bearer tokens:
- Set
AWS_BEARER_TOKEN_BEDROCKenvironment variable, or - Enter the token in Preferences → AI Search
Environment variables (development)
| Variable | Purpose |
|---|---|
OPENAI_API_KEY |
OpenAI API key |
ANTHROPIC_API_KEY |
Anthropic API key |
AWS_BEARER_TOKEN_BEDROCK |
AWS Bedrock bearer token |
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY |
AWS IAM credentials |
Development
npm install
npm run watch # TypeScript watch mode
Load from Mailspring: Edit menu → Install a Plugin → select this directory.
License
MIT