Avery.Software — Native Execution Runtime
RuntimeUse casesPricingHelpBlog
← All postsBlog

An agent that watches your inbox: a real walkthrough

2026-05-07 · Avery NXR Team · agents · getting-started

The fastest way to understand the Agents feature is to build one thing it's actually useful for. This post walks you through an agent that watches your inbox, picks out the emails that need attention, and posts a one-line summary to a Slack channel.

You'll do this entirely on your laptop. No server. No separately- hosted automation runtime. The local Small Language Model handles the language work; deterministic plumbing handles everything else.

What you'll build

[ Email trigger: new mail in INBOX ]
              │
              ▼
   [ LLM: classify importance ]
              │
              ▼
   [ Condition: is it important? ]
              │
   ┌──────────┴───────────┐
   │                      │
 (yes)                  (no)
   │                      │
   ▼                      ▼
[ LLM: 1-line summary ]  [ end ]
   │
   ▼
[ Slack: post summary to #triage ]

Five nodes, two branches, one SLM call per email.

Prereqs

You'll connect two providers:

  • Gmail or Outlook for the inbox. OAuth — you'll click "Sign in with Google / Microsoft" and grant Avery NXR read + read-modify scopes for the mailbox you pick.
  • Slack for the destination. Also OAuth — you'll add the bot to the workspace and pick a channel.

Both connections live on your machine in an encrypted local store; the tokens never go to our cloud. If you don't have a Slack workspace handy, swap the last node for Notify (in-app toast) or Send SMS and follow the same shape.

Step 1 — create the agent

Open the desktop. Click Agents in the sidebar. Click New agent. Three quick choices:

  • Name. "Inbox triage" or whatever you'll recognize in the list.
  • Trigger. Email — Avery NXR polls your connected mailbox and fires the agent on each new message. You can scope by folder / label / from-address filters; for a first run, just leave the defaults so every new message triggers.
  • Tone. Free text — affects how the SLM writes the eventual summary. "Concise and slightly formal" is a fine starting tone.

The wizard hands you a blank canvas with the trigger node already pinned to the top. You drag the rest in.

Step 2 — classify importance

From the left rail palette, drag Classify onto the canvas under the trigger. Connect them. Open the node's drawer:

  • Inputs. Wire email.subject + email.from + email.body into the prompt. You can do this with the visual picker — every upstream node's outputs show up as variables.
  • Categories. Three labels: important, noise, unsure.
  • Instruction. "Decide if this email needs the recipient's attention this week. Travel itineraries from booked.com, marketing newsletters, and routine receipts are noise. Anything with a question, a deadline, or a request is important."

When you save, the node displays a "Test on a recent email" button that runs the SLM against your latest inbox message — useful to sanity-check the categories before you let the agent loose.

Step 3 — branch on the result

Drag a Condition node next. The condition reads classify.label. Set the test to equals "important". Two output handles emerge — the true branch carries on to the next node; the false branch goes to a tombstone end node (drag an end from the palette, or just leave the false branch unconnected — agents stop when a path runs out).

The visual structure mirrors the workflow: noise emails dead-end silently; important ones move on.

Step 4 — summarize

Drag an LLM Summarize node into the true branch. Wire email.subject + email.body as inputs. The instruction:

One line, max 25 words. Lead with the sender's intent (asking / informing / scheduling / requesting). End with the deadline or "no deadline" if there isn't one.

The agent's tone setting from Step 1 carries through automatically — you can override per-node if you need to.

Step 5 — post to Slack

Final node: Channel message (under the Messaging category in the palette). The drawer asks:

  • Connector. Pick the Slack connection from the dropdown. If you haven't connected Slack yet, the dropdown has an inline "Add Slack connection" item that walks you through the OAuth consent — you don't have to leave the agent builder.
  • Channel. #triage or whichever channel you want.
  • Message. Free text with summary.text from the previous node interpolated, e.g. "📬 New: {{summary.text}} — {{email.from}}".

Save the agent.

Run it

Two ways:

  1. Manual. Click Run at the top of the canvas. Avery NXR fires the email trigger against the most recent unread message and you watch the run replay live in the Runs tab — every node lights up as it executes, with the inputs/outputs visible inline.
  2. Wait. The trigger is wired into the local nxrd service's email-watch supervisor. Once the agent is enabled (toggle in the Overview tab), every new email runs the graph automatically. Check the Runs tab the next time something important lands in your inbox; you should see a new row with the full execution trace.

If a run fails — say Slack revoked the token, or the SLM produced an empty summary — the node shows a red marker, the run record captures the error, and you click Retry after fixing the cause. Nothing's lost; runs are deterministic and replayable from the recorded inputs.

What you didn't have to do

Compared to wiring this up "the old way" with a Zapier-like SaaS plus a separate hosted Slack bot:

  • No webhook plumbing. Avery NXR polls Gmail / Outlook directly from your machine; the trigger is built in.
  • No third-party automation runtime. The agent runs locally. When your laptop is asleep, the agent is asleep. When you open the laptop, missed emails get processed (modulo the trigger's watermark — every trigger remembers the last message it saw).
  • No data leaving your machine for the language work. The classify + summarize nodes hit your local SLM by default. No per-email cost. The OpenAI / Anthropic models are an opt-in toggle (Consult Mode) for the cases where you want a sharper model — and even then the call goes direct from your desktop to the provider, not via us.
  • No glue code. No service to deploy, no .env to roll, no Docker container, no cron job.

The whole thing is a graph you drew on a canvas, running against a few connectors that live in a local encrypted keystore.

Going further

Once you have the basic shape, the natural extensions are:

  • More categories. Replace the three-label classify with five — add meeting-request and vendor-pitch and route them separately. Each branch can do something different (auto-add to calendar, auto-archive, draft a polite no).
  • A Knowledge Repository step. Drop a KB Lookup node into the important branch — it lets the SLM read across documents you've indexed (a PRD, your company's style guide, prior decisions) before summarizing. Useful for "summarize this email in the context of last quarter's roadmap."
  • A weekly digest. Add a second agent on a schedule trigger that pulls the past week's important-summary records out of Slack (via a search connector) and writes a digest. The agents feature isn't single-purpose; you compose.

If you want a starting point that already has more wired up, the Library tab has agent templates you can install with one click — "Inbox triage" is one of the bundled examples.

That's the loop. One sentence describes the agent; one canvas shows you what it does; one local run proves it works. Build the next one.