Skip to content
Optima docs
Guides

Get a weekly digest from an agent

Build an agent that emails you a summary of last week's campaigns every Friday, test it in dry run, then switch it live.

By the end you will have an agent that reads your campaign results every Friday at 15:00 and emails you a short summary.

Before you start

  • An active text model under Settings → Integrations → AI models; see AI models.
  • The Agents licence package, which requires AI assistants. The Agents entry appears under Analyze.
  • The agents_editor role, to build and start agents. To read the run log you also need agents_auditor or an administrator role.
  • Read access, as the instance owner, to the data the tools you pick read. list_campaigns works with agents_editor alone, but get_campaign_performance reads campaign results, which agents_editor alone cannot do, so you also need a role that reads campaign statistics, such as campaign_editor or an administrator role. The Tools list shows which tools you may use and why a tool is switched off.
  • Your own email address on your user, since the digest goes to the instance owner, which is you.

Steps

  1. Create the definition. Open Agents, choose the Definitions tab and New definition. Name it Weekly digest. In Prompt, write: "Look at the campaigns that sent in the last seven days and email me a short summary of their results, best performer first." See definitions.
  2. Add a schedule trigger. Under Triggers choose Add schedule trigger and set it to 0 15 * * 5, every Friday at 15:00.
  3. Pick the tools. Under Tools tick list_campaigns and get_campaign_performance. A tool that is switched off shows why in its chip; if get_campaign_performance is, you lack the campaign read access above.
  4. Allow the email. Under Actions tick Send emails. Leave events and attributes empty.
  5. Save with Save definition. This is version 1.
  6. Create an instance. Back on Agents, choose New instance. Name it Weekly digest (dry run), pick the definition and your model, and leave the budget at its defaults or lower it. Choose Create instance. See instances.
  7. Start in dry run. On the instance, choose Start dry run. Nothing is emailed yet.
  8. Read the log. After the next Friday tick, open Run log and find the Would have entry with Would send to your address. The entry shows the recipients, and Show email reveals the subject and the full body, and the explanation tells you what the agent based the email on. See the run log.
  9. Go live. When the recipient, subject, body and explanation look right, choose Switch to live and confirm. From the next Friday it is emailed to you, plain text, ending with a line marking it as AI-generated.

Check that it worked

The next Friday the run shows Done and the log entry says Queued for your address. Watch the Budget card on the Overview to see what each digest costs.

If something goes wrong

  • No log tab. Ask for agents_auditor.
  • The run is Failed. Open it and read its entries; an unreachable model or an action your access does not allow are the usual causes (a used-up budget shows as Budget used up, not Failed).
  • You want a different day. Instances cannot be edited: save a new version of the definition with a new schedule and create a new instance.

On this page