Import Email History into AI Memory via IMAP
Your inbox holds years of context -- conversations with clients, vendor negotiations, project updates, decisions made over email. REM Labs imports email threads via standard IMAP so your AI can search across your entire communication history semantically, regardless of email provider.
What Gets Imported
The IMAP integration extracts structured content from email messages:
- Message body -- plain text and HTML content, cleaned of signatures and boilerplate
- Thread grouping -- replies are grouped into conversation threads using In-Reply-To and References headers
- Metadata -- from, to, cc, subject, date, and folder/label stored as filterable fields
- Attachments -- text extracted from attached documents, PDFs, and spreadsheets
- Labels/Folders -- Gmail labels and IMAP folder paths preserved for namespace scoping
Gmail OAuth (Recommended)
For Gmail users, the easiest path is OAuth. In the REM Labs Console, go to Integrations and click Connect Gmail. Authorize read-only access and select which labels to sync.
IMAP Import (Any Provider)
For Outlook, Fastmail, ProtonMail Bridge, or any IMAP-compatible provider, use the IMAP import endpoint.
The since parameter limits the import to emails after a given date. The folders array lets you target specific IMAP folders or Gmail labels. Incremental mode uses message UIDs to only fetch new messages since the last sync.
Thread Intelligence
Individual emails are often fragments of a larger conversation. The integration groups related messages into threads using standard email headers (In-Reply-To, References, and subject-based threading). A 12-message thread about a partnership negotiation becomes one searchable memory with the complete context.
Search Your Email History
Semantic search finds the email thread titled "Re: Q2 Engagement Scope" that discusses rates and deliverables, and the follow-up thread about contract amendments -- without needing the word "pricing" to appear in any of them.
Signature and Boilerplate Removal
Email bodies are cleaned before indexing. Signatures, legal disclaimers, forwarded message headers, and quoted reply chains are stripped to keep the knowledge base focused on actual content rather than repeated boilerplate.
API Endpoints Reference
| Endpoint | Method | Description |
|---|---|---|
/v1/memory/sync/email/import | POST | Import emails via IMAP or Gmail OAuth |
/v1/integrations/email/status | GET | Check sync status and message count |
/v1/integrations/email/search | POST | Search within the email namespace |
/v1/integrations/email/folders | GET | List available IMAP folders |
Security: IMAP credentials are encrypted at rest and used only during sync operations. For Gmail, OAuth tokens provide read-only access with no ability to send or modify messages. You can revoke access anytime from your Google Account settings. See Email integration docs.
Make your email searchable by meaning
Free tier. Years of conversations, queryable by AI.
Get started free →