Inbox Digest
ivy.agent.inbox-digest · v1.1.0
ivyx
Reads the last day's mail of an inbox, has a model write a digest with one line per message, and mails the digest to the same account.
Steps
In the order the agent's file lists them, each with where its inputs come from and the values the file fixes. A branch or a loop is a step too.
- 01Ivy NodeRead the day's mailivy.node.mail-fetch
Reads the newest messages of a mailbox folder that match a query over IMAP and returns each one's sender, subject, date and plain text, newest first.
- takes
usernamefrom the agent's inputqueryfrom the agent's inputlimitfrom the agent's inputimap_hostfrom the agent's inputimap_portfrom the agent's inputuse_sslfrom the agent's input- set
imap_hostimap.gmail.comimap_port993use_ssltruequerysince:1limit50- secret
mail_passwordthe stored secret mail-password- returns
count
- 02Model turnWrite the digest
Write a digest of these messages in Markdown. Group them under three '## ' headings in this order: Needs action, Money, Everything else; leave a heading out when nothing belongs under it. Under each heading write one line per message: a dash, the subject in bold, the sender's address in parentheses, a colon, then a few words on what it asks or says; for example - **Invoice 42** (billing@acme.com): asks for payment by Friday. Copy the subject and the sender's address from the message. Use every message and say only what the messages say.
- takes
contextfrom step 1,messages- returns
digest
- 03Ivy NodeMail the digestivy.node.email-send
Sends a plain-text or HTML email through an SMTP server in one step and returns the recipients it went to.
- takes
from_addrfrom the agent's input,usernameusernamefrom the agent's inputtofrom the agent's inputbodyfrom step 2,output.digestsmtp_hostfrom the agent's inputsmtp_portfrom the agent's inputuse_tlsfrom the agent's input,smtp_tls- set
smtp_hostsmtp.gmail.comsmtp_port587use_tlstruesubjectInbox digest- secret
passwordthe stored secret mail-password- returns
sent,recipients
Nodes it brings
Adding this agent in IVYX Studio adds these nodes with it. A node your workspace already has is kept as it is, even at another version.
What it touches
Collected from what each of its nodes declares, plus the model call when a step is a model turn. A declaration is the author's statement, and it is what policy rules select on.
What it needs
- A stored secret named
mail-password. The agent's file carries the name, never the value.
Inputs
| Field | Type | Description |
|---|---|---|
| usernamerequired | string | The mailbox address, which is the login name; its password is the stored secret mail-password. |
| query | string | Which mail to digest: since:<days>, unseen, from:<name>, subject:<word>, joined with spaces. |
| limit | integer | At most this many messages, the newest. |
| torequired | string | Where to send the digest; usually the account itself. |
| imap_host | string | The IMAP server; imap.gmail.com when left out. |
| imap_port | integer | The IMAP port; 993 when left out. |
| use_ssl | boolean | Connect to IMAP over SSL; on when left out. |
| smtp_host | string | The SMTP server; smtp.gmail.com when left out. |
| smtp_port | integer | The SMTP port; 587 when left out. |
| smtp_tls | boolean | Upgrade SMTP with STARTTLS; on when left out. |
Outputs
| Field | Type | Description |
|---|---|---|
| digest | string | The digest that was sent. |
| count | integer | How many messages it covers. |
| sent | boolean | True once the server accepted the digest. |
| recipients | array | Who received it. |
Tests
2 of 2 test cases passed on Oct 7, 2026, in the publisher's own environment, before this version was published. The registry keeps that record; it does not run the cases again.
Requires: python:3.9, a mailbox over IMAP (Gmail unless imap_host says otherwise) with its password stored as the secret mail-password, for the cases, GreenMail on 127.0.0.1:3143/3025 (mkdata-mail.py), a model core, the eight [ivyx-test] messages of mkdata-mail.py
- eight-messages
Eight test messages: the digest names the outage and the receipt and lands in the same inbox.
- given
imap_host127.0.0.1imap_port3143use_sslfalsesmtp_host127.0.0.1smtp_port3025smtp_tlsfalseusernameagent@ivyx.testquerysince:3 subject:[ivyx-test]limit50toagent@ivyx.test- expects
countequals 8sentequals truedigestmatches [Cc]heckout[\s\S]*([Rr]eceipt|[Ii]nvoice)|([Rr]eceipt|[Ii]nvoice)[\s\S]*[Cc]heckoutrecipientsmatches @
- two-newest
A limit of two digests only the two newest.
- given
imap_host127.0.0.1imap_port3143use_sslfalsesmtp_host127.0.0.1smtp_port3025smtp_tlsfalseusernameagent@ivyx.testquerysince:3 subject:[ivyx-test]limit2toagent@ivyx.test- expects
countequals 2sentequals true