Recipe

Let an agent sort your inbox

For anyone whose inbox has outgrown them: write your sorting rules once, and an agent files new mail and drafts replies for you to send.

Apps
Topics

Your inbox is a mix of newsletters, receipts, notifications and the handful of messages from people that actually need you. In this recipe you write down how you would sort it, once, and an agent does that sorting as new mail arrives — filing, starring and drafting replies for you to send. It never sends anything itself.

What you need

  • XataWorks, open, with the agent answering. If it is not yet, Getting started covers the one decision to make first.
  • A mail account: Gmail, or any provider that offers IMAP or POP3 for incoming mail and SMTP for sending. For Gmail you need an app password, which Google makes for you once 2-Step Verification is on.

1. Add your mail account

Choose View ▸ Mail ▸ All Mail. The first time, Mail opens straight onto Add a mail account. Type a Gmail address and the server settings fill themselves in; for any other provider, type in what your provider publishes. You can also ask in a chat to set up your Gmail, and a built-in skill walks you through Google’s side. Either way, you type the password into the form yourself; the agent never asks for it.

2. Make an agent for your mail

Choose Agents ▸ New Agent…. Give it a Name: such as Inbox sorter, and write how you sort mail into Instructions (system prompt):. There is no separate rule editor; these instructions are the rules. Be concrete, and include the exceptions:

Move newsletters and marketing mail to a folder called Reading. Move receipts and order confirmations to Receipts. Star anything from my accountant. Leave mail from people I know in the Inbox. When someone asks to meet, save a draft reply that suggests two times next week. Do nothing else with mail you are unsure about.

On its Tools tab, choose Selected tools and allow only the mail tools. The account form gives the same advice: give it only the mail tools, so nothing in a message can lead it anywhere else.

3. Hand new mail to it

In Mail, open the account’s ⋯ button in the sidebar and choose Edit…. Under Mail agent, tick Hand new mail to an agent, choose your agent as the Agent, and leave Chat at New chat: Mail — …. The sidebar then shows Mail agent: and its name under the account.

4. Watch it work, then adjust

Each batch of new mail goes to the agent in its own chat, where you can see everything it does. Its drafts land in your Drafts folder; read them, change what you like and press Send yourself, or discard them. When it files something the wrong way, add the exception to its instructions.

5. Sort what was already there

The agent is handed mail that arrives after you switch it on, not what was already waiting. For that, tick the conversations you want sorted, press ✨ Ask agent, type “Sort these the way your instructions say” and press Run.

Where this recipe stops

  • No agent can send, delete for good or empty a folder. Those tools do not exist, in the mail chat or any other. Moving a message to Trash is not deleting it; you can move it back.
  • It works while XataWorks is open. The mail agent runs while the application is open, the account is online and its chat is idle, and it never interrupts a turn already under way. For anything it missed, use ✨ Ask agent as in step 5.
  • Mail is information, not instructions. Each batch reaches the agent marked as mail from other people, to be treated as information and never as instructions — one more reason to give it only the mail tools.

Read more

  • Mail — accounts, reading and writing, the mail agent, and what no agent can do with your mail.
  • Agents — what an agent is made of, and what its Tools and Skills tabs decide.

More recipes like this

Back to all recipes.