Memo

Mail

Import Gmail or IMAP mail read-only through Himalaya, beside your notes and messages.

This page helps you bring your email into Memo, so mail sits beside your notes and messages in search, in a person's context and in the sources your agent reads. Memo reads mail through Himalaya, a mail program you set up first. Your mailbox is opened read-only: Memo never sends, moves or deletes mail, and does not mark it as read.

Before you start

Set up your mail account in Himalaya. For Gmail, use an IMAP account with a Gmail app password (a separate password for one program, which you can revoke at any time). Check that Himalaya lists your mail before you continue.

Request
Help me set up Himalaya for my Gmail account with an app password, and check that it lists my inbox.
Then add the account to Memo's config and import the last 30 days of mail.

Add the account to Memo

Name the account in Memo's config file, ~/.config/cli-memo/config.json. name is the account's name in Himalaya; address is your email address:

{ "mail": { "accounts": [{ "name": "work", "address": "[email protected]" }] } }

Gmail is the default. For another provider, add "mode": "imap" and the folders to read:

{ "mail": { "accounts": [{ "name": "home", "address": "[email protected]", "mode": "imap", "folders": ["INBOX", "Archive"] }] } }

Import mail

memo mail work import --since 2026-09-01

work is the account's name from the config. Name it every time, even with one account: Memo never picks an account for you, and lists the accounts it knows when the name is missing or wrong.

  • Without --since, Memo reads the last 30 days.
  • Each run reads up to 200 new emails (--max changes this). Run it again and it continues where it stopped; emails already stored are skipped.
  • memo import and the timer import every account in the config.

Find your mail

memo search mail 'invoice'
memo search mail 'from:kai subject:budget'
memo search mail 'mailbox:starred' --account [email protected]
memo search all 'budget'

Gmail labels such as Inbox, Important, Starred and your own labels become mail folders, so mailbox:important finds them. See Search.

What is kept

  • The sender, the recipients (To, CC and BCC), the subject, the date and the text of each email.
  • Whether an email is read or starred, as your mailbox shows it.
  • The text of readable attachments, searched with the email. PDF and Word attachments need the optional readers. After you install them, run memo mail work import --retry-attachments to read attachments that were skipped.
  • Up to 1,000,000 characters of each email and 200,000 of each attachment (change the limits).

Mail is prepared for search by meaning when the search model is on your computer; --no-embed skips this.

When mail is deleted

When you delete an email in your mailbox, its text leaves the local store on the next import. Mail moved to Spam counts as deleted. To protect you from mistakes:

  • the first two days of the period are not checked for deletions;
  • if a run finds an unusually large part of your mail missing, it deletes nothing and tells you.

Mail and people

To include a person's email in their context, link the address to them in tg or max: tg contacts link 'Kai Sample' email:[email protected].

Next: keep mail and notes up to date on a timer.