← All ivy-agents
IVYXSTUDIO · IVY AGENT
I

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.

  1. 01
    Read the day's mail
    ivy.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
    username from the agent's input
    query from the agent's input
    limit from the agent's input
    imap_host from the agent's input
    imap_port from the agent's input
    use_ssl from the agent's input
    set
    imap_host imap.gmail.com
    imap_port 993
    use_ssl true
    query since:1
    limit 50
    secret
    mail_password the stored secret mail-password
    returns
    count
    Ivy Node
  2. 02
    Write 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
    context from step 1, messages
    returns
    digest
    Model turn
  3. 03
    Mail the digest
    ivy.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_addr from the agent's input, username
    username from the agent's input
    to from the agent's input
    body from step 2, output.digest
    smtp_host from the agent's input
    smtp_port from the agent's input
    use_tls from the agent's input, smtp_tls
    set
    smtp_host smtp.gmail.com
    smtp_port 587
    use_tls true
    subject Inbox digest
    secret
    password the stored secret mail-password
    returns
    sent, recipients
    Ivy Node

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.

Calls a modelmessage-readmessage-sendNetwork

What it needs

  • A stored secret named mail-password. The agent's file carries the name, never the value.

Inputs

FieldTypeDescription
usernamerequiredstringThe mailbox address, which is the login name; its password is the stored secret mail-password.
querystringWhich mail to digest: since:<days>, unseen, from:<name>, subject:<word>, joined with spaces.
limitintegerAt most this many messages, the newest.
torequiredstringWhere to send the digest; usually the account itself.
imap_hoststringThe IMAP server; imap.gmail.com when left out.
imap_portintegerThe IMAP port; 993 when left out.
use_sslbooleanConnect to IMAP over SSL; on when left out.
smtp_hoststringThe SMTP server; smtp.gmail.com when left out.
smtp_portintegerThe SMTP port; 587 when left out.
smtp_tlsbooleanUpgrade SMTP with STARTTLS; on when left out.

Outputs

FieldTypeDescription
digeststringThe digest that was sent.
countintegerHow many messages it covers.
sentbooleanTrue once the server accepted the digest.
recipientsarrayWho 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_host 127.0.0.1
    imap_port 3143
    use_ssl false
    smtp_host 127.0.0.1
    smtp_port 3025
    smtp_tls false
    username agent@ivyx.test
    query since:3 subject:[ivyx-test]
    limit 50
    to agent@ivyx.test
    expects
    count equals 8
    sent equals true
    digest matches [Cc]heckout[\s\S]*([Rr]eceipt|[Ii]nvoice)|([Rr]eceipt|[Ii]nvoice)[\s\S]*[Cc]heckout
    recipients matches @
  • two-newest

    A limit of two digests only the two newest.

    given
    imap_host 127.0.0.1
    imap_port 3143
    use_ssl false
    smtp_host 127.0.0.1
    smtp_port 3025
    smtp_tls false
    username agent@ivyx.test
    query since:3 subject:[ivyx-test]
    limit 2
    to agent@ivyx.test
    expects
    count equals 2
    sent equals true