GuidesAI Inbox Brief

AI Inbox Brief

Reads your work email each morning. Sends a short brief before standup.

30 min · Google Apps Script · ~$1.50/month (Claude Haiku 4.5) · Gmail · runs on a 6 AM trigger

Built by James — 20+ years in ops, 3 at Meta. More →

A small assistant that reads your email every morning and sends you a one-screen brief of only the things that need you. You set it up once, you own it, and it runs on your own Google account. No platform, no subscription, nothing to cancel later.

What you’ll need

  • A Gmail / Google Workspace account.
  • An Anthropic API key (this is what powers the reading). You add a few dollars of credit once; the running cost is in the table further down.
  • A spare half hour and the willingness to copy and paste.

Step 1 — Get your AI key

Go to console.anthropic.com, sign in, open API Keys, and click Create Key. Copy the key it gives you (starts with sk-ant-) and keep it somewhere for a minute. Add a small amount of billing credit while you’re there. If you’ve never made an Anthropic account before, this step is most of the build time.

Step 2 — Open the script editor

Go to script.google.com, click New project. Delete the few lines of placeholder code that are already in the box, so it’s empty.

Step 3 — Paste this in

Paste the whole block below into the empty editor.

// ============================================================
// AI INBOX BRIEF  -  by autohmate
// Reads your Gmail each morning, emails you a short brief.
// ============================================================
// 1) PASTE YOUR ANTHROPIC API KEY BETWEEN THE QUOTES:
const API_KEY = "PASTE-YOUR-KEY-HERE";
// 2) IN PLAIN ENGLISH, TELL IT WHAT TO WATCH FOR:
const WATCH_FOR = `
You are reading my work email. Flag anything that matches:
- a deadline, court date, or filing date
- a settlement offer or a money decision
- a new client enquiry
Ignore newsletters, receipts, and automated alerts.
`;
// 3) HOURS TO LOOK BACK EACH RUN (24 = since yesterday):
const LOOKBACK_HOURS = 24;
// ----- leave everything below this line alone -----
function sendDailyBrief() {
  var cutoff = new Date(Date.now() - LOOKBACK_HOURS * 3600 * 1000);
  var query  = "in:inbox after:" + Math.floor(cutoff.getTime() / 1000);
  var threads = GmailApp.search(query, 0, 50);
  var me = Session.getActiveUser().getEmail();
  var emails = [];
  threads.forEach(function (t) {
    t.getMessages().forEach(function (m) {
      if (m.getDate() >= cutoff) {
        emails.push(
          "FROM: " + m.getFrom() +
          "\nSUBJECT: " + m.getSubject() +
          "\nBODY: " + m.getPlainBody().slice(0, 1200)
        );
      }
    });
  });
  if (emails.length === 0) {
    GmailApp.sendEmail(me, "AI Inbox Brief - nothing new",
      "No emails matched your criteria today.");
    return;
  }
  var prompt =
    WATCH_FOR +
    "\n\nHere are today's emails. List only the ones that match, " +
    "newest first. One line each: who it's from, why it matters, " +
    "and what it needs from me.\n\n" +
    emails.join("\n\n---\n\n");
  var res = UrlFetchApp.fetch("https://api.anthropic.com/v1/messages", {
    method: "post",
    contentType: "application/json",
    headers: { "x-api-key": API_KEY, "anthropic-version": "2023-06-01" },
    muteHttpExceptions: true,
    payload: JSON.stringify({
      model: "claude-haiku-4-5-20251001",
      max_tokens: 1000,
      messages: [{ role: "user", content: prompt }]
    })
  });
  var data = JSON.parse(res.getContentText());
  var brief = (data.content && data.content[0])
    ? data.content[0].text
    : "Couldn't generate a brief - check your API key.";
  GmailApp.sendEmail(me, "AI Inbox Brief - " + new Date().toDateString(), brief);
}

Step 4 — Tell it what to watch for

This is the only part that’s really yours. Near the top, edit the WATCH_FOR text and describe, in plain English, what matters to you. A lawyer’s is shown above. A builder doing enquiry intake would write something like:

You are reading enquiries that come into my building firm.
For each new enquiry, pull out: the job type, the address or
area, the rough scope, the timeline, and any budget signal.
Flag anything missing that I'd need before I could quote.
Ignore supplier mail, invoices, and newsletters.

Write it the way you’d brief a new assistant on their first day. That’s the whole skill.

Step 5 — Paste your key and run it once

Put the key from Step 1 between the quotes on the API_KEY line. Click Save, then Run. Google will ask for permission to read and send your mail. Click through Allow (it’s your own account giving your own script access). Check your inbox: you should have a brief.

Step 6 — Make it run every morning

On the left, click the clock icon (Triggers) Add Trigger. Choose function sendDailyBrief, event source Time-driven, type Day timer, and a time like 6–7am. Save. That’s it. It now runs on its own.

What this version doesn’t do

This is the demo, on purpose. It reads and briefs you, and that’s genuinely useful. Here’s where an off-the-shelf script stops:

  • It reads, it doesn’t act. It won’t reply, file, schedule, or update your case system or CRM. It hands you a brief; you do the rest.
  • It only sees plain text. Attachments, PDFs, and scanned documents (the coffee-stained receipt, the signed contract) go past it.
  • It doesn’t learn. It can’t tell which flags you found useful, so it won’t get sharper over six months. No feedback loop.
  • One inbox, one set of rules. It isn’t wired into the tools you actually run the business on.

Closing that gap is most of what I mean by applied AI — making it act safely, plugging into your systems, staying accurate as your business changes. If this little version is useful, the real one built around your operation is worth a conversation.

The real one goes the way every build goes: I learn your week, we agree the target, I ship it, and I check it stuck.

Same deal as everything I build: if it doesn’t land, you don’t pay for it.

Talk to me →