Semantic / AI Search for Mailspring

mailspring-ai-search

:warning: 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)

  1. Download the latest mailspring-ai-search-*.zip from Releases

  2. Extract the zip to a folder

  3. Open a terminal in that folder and run:

    npm install --omit=dev
    node scripts/patch-arrow-csp.js
    
  4. In Mailspring: Edit → Developer → Install a Plugin… → select the extracted folder

  5. 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:

  1. Embedding provider — choose your embedding backend and enter credentials
  2. 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:

  1. Set AWS_BEARER_TOKEN_BEDROCK environment variable, or
  2. 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