Mail Memex banner
queelius queelius

Mail Memex

AI community

Description

Personal email archive with SQLite+FTS5 full-text search and MCP server for LLM access. Part of the *-memex ecosystem.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

mail-memex

Personal email archive with SQLite+FTS5 full-text search and an MCP server for LLM access.

Part of the [`*-memex` ecosystem](../memex) of co-located personal archives: `llm-memex` (AI conversations), `bookmark-memex`, `photo-memex`, `book-memex`, `hugo-memex`, and `health-memex`.

What It Does

  • Ingests email from Gmail Takeout, mbox files, .eml files, or IMAP (Gmail OAuth2 or any IMAP server).
  • Indexes every message with SQLite FTS5 for ranked full-text search (Porter stemming, BM25 weighting).
  • Rebuilds threads from In-Reply-To / References headers.
  • Exposes the archive as an MCP server so LLMs can query it with SQL or Gmail-style operators.
  • Exports to JSON, mbox, markdown, a single-file HTML SPA (embedded SQLite via sql.js), or arkiv JSONL for cross-archive ingestion.
  • Marginalia: attach free-form notes to any email, thread, or marginalia itself, addressable by durable URIs that survive re-imports.
  • Soft-deletes: archived emails and threads stay queryable but are filtered from default results, so MCP trails and marginalia references don't break.

mail-memex is **not an email client**. It does not send or reply to mail. It's a long-term archive and an LLM-queryable surface on top of your mail history.

Install

pip install -e ".[mcp,imap,imap-oauth]"

Optional extras: `mcp` (MCP server), `imap` (IMAP pull with keyring), `imap-oauth` (Gmail OAuth2).

Quick Start

# 1. Initialize
mail-memex init

# 2. Import from Gmail Takeout, mbox, or eml
mail-memex import gmail ~/takeout/"All mail Including Spam and Trash.mbox"
mail-memex import mbox archive.mbox
mail-memex import eml ~/Mail/

# 3. Search
mail-memex search "project proposal"
mail-memex search "from:alice after:2024-01-01 has:attachment"

# 4. Start MCP server (LLM-facing)
mail-memex mcp

CLI Commands

Command Purpose
mail-memex init Create the database
`mail-memex import {mbox,eml,gma