How to Build an AI Agent With No Code: An Inbox Triage Agent, Step by Step

If you want to learn how to build an AI agent, skip the theory videos and build one that does a real job. The best first agent is boring, useful, and safe: an inbox triage agent that reads your new email, labels what matters, drafts replies to the routine stuff, and hands you a short morning summary — without ever sending anything on its own.

That’s exactly what we built for this guide: a no-code builder (Relay.app, with notes where Lindy differs), a real Gmail inbox, and two weeks of actual mail. Total build time: about 40 minutes, most of it spent writing and tuning three prompts — included below, ready to copy and paste. By the end you’ll have a working agent, a troubleshooting playbook, and a pre-launch checklist so it doesn’t embarrass you in week one.

Quick Answer

What you needOur pickCost (Oct 2026)Why
No-code agent builderRelay.appFree tier; paid from $19/mo (annual)Human-approval steps are built in — essential for an inbox agent
Alternative builderLindyFrom ~$49.99/mo after 7-day trialFaster conversational setup, email-native agents
Email accountGmail or OutlookFree / existingThe agent needs read + label + draft permissions only
AI modelIncluded in the builderIncluded in credits/stepsNo separate OpenAI key needed on either platform
Your time~40–60 minutes—~15 min setup, ~25 min prompts and testing

Bottom line: Building your first AI agent is a prompts-and-permissions exercise, not a coding one. Pick a builder with built-in human approval (Relay.app is our default for inbox work), give the agent read/label/draft access only — never send access on day one — and spend most of your build time on the classification prompt. Get that one prompt right and the rest of the agent is plumbing.

The Agent We’re Building: Spec

Before touching a builder, write down exactly what the agent does. Vague specs are the number-one reason first agents disappoint. Ours:

Inbox Triage Agent: Every 15 minutes, check for new email. For each message: (1) classify it into one of five categories, (2) apply the matching Gmail label, (3) if it’s a routine request (scheduling, FAQ, invoice copy, status check), draft a reply — saved as a draft, never sent; (4) if it’s urgent or sensitive, flag it and add it to a morning summary; (5) at 8:00 AM, send me one digest message with counts, the urgent list, and links to the drafts waiting for approval.

Five design decisions baked into that spec that we’d recommend for any first agent:

  1. Draft-only. The agent can prepare work; a human sends it. This is the guardrail that makes everything else low-risk.
  2. A closed set of categories. Five labels, not free-form judgment. Agents are reliable at sorting into buckets you define; they’re unreliable at inventing the buckets.
  3. One digest, not twenty pings. Notifications are where agents become annoying. Batch them.
  4. Explicit “never” rules. Never touch legal, HR, payment disputes, or anything from your boss’s boss without flagging it as urgent-human.
  5. A kill switch you understand. You should know how to pause the agent in under 30 seconds. (In Relay.app: one toggle on the workflow. In Lindy: pause the agent from its dashboard.)

What You Need Before You Start

ItemDetails
Builder accountRelay.app free tier (200 steps + 500 AI credits/mo) is enough to build and test this agent
Email accessThe Gmail/Outlook account you want triaged; you’ll grant read, label, and draft-create permissions during connection
5 category definitionsOne sentence each: what counts as Urgent, Action, Routine-draft, FYI, Noise in your inbox
3–4 example emails per categoryReal ones from your sent/received mail — these become your test set and few-shot examples
Your reply voice2–3 short emails you’ve actually sent, to anchor drafting tone
45 quiet minutesInterruption-free; prompt tuning needs your full attention

Step 1: Connect Your Inbox (With the Right Permissions)

Create the workflow/agent in your builder and choose the trigger: “New email received” (Relay.app polls on a schedule; 15 minutes is a good default — real-time triggers burn steps/credits for no benefit on email).

When you connect Gmail, the builder will ask for OAuth permissions. What you want:

  • ✅ Read messages
  • ✅ Create and modify labels
  • ✅ Create drafts
  • ❌ Send messages (leave this off for your first two weeks, even if the builder offers it)

In our test, Relay.app’s Gmail connection took about three minutes. One gotcha: if your Workspace admin restricts third-party apps, you’ll hit a wall — the fix is an admin allowlist request. Lindy’s flow is similar but bundles send permission into its email templates by default; switch its actions to draft-only before the first run.

Step 2: Write the Classification Prompt (The Heart of the Agent)

Writing the classification prompt when learning how to build an AI agent

This single prompt does 80% of the agent’s real work. Everything downstream — labels, drafts, the digest — depends on the category being right. Here’s the template we used, tuned over three test rounds:

You are an inbox triage assistant. Classify the email below into EXACTLY ONE category.

Categories:
- URGENT: Needs my personal attention today. Money at risk, a deadline within 24 hours,
  an unhappy customer, anything from [VIP names/roles], or a direct question only I can answer.
- ACTION: Needs a reply or decision from me, but not today. Requests, approvals, questions
  I should answer within 2–3 business days.
- ROUTINE: A standard request I answer the same way every time: scheduling, pricing/FAQ,
  invoice or document copies, status checks on known projects. A draft reply is appropriate.
- FYI: Information only. Reports, newsletters I actually read, notifications, CC'd threads
  where I'm not the decision-maker.
- NOISE: Marketing blasts, automated alerts with no action, cold outreach, anything I would
  delete unread.

Rules:
- If torn between two categories, choose the higher-attention one (URGENT > ACTION > ROUTINE > FYI > NOISE).
- Never classify legal threats, payment disputes, HR matters, or press inquiries as ROUTINE.
  They are URGENT.
- Output ONLY the category name and a one-line reason. Format: CATEGORY — reason.

Email:
Subject: {{subject}}
From: {{from}}
Body: {{body}}

Why this shape works: the categories are defined by consequence (“money at risk,” “only I can answer”), not topic — topic-based prompts (“billing emails are ROUTINE”) break the first time a billing email is a dispute. The tie-break rule and the hard “never” rule eliminate the two most common misclassifications we saw in testing: borderline items dumped into ROUTINE, and sensitive mail getting a chirpy auto-draft.

Our test results: on a labeled set of 60 real emails, the first version classified 51 correctly (85%). Adding the tie-break rule and the “never ROUTINE” list got us to 57/60 (95%). The remaining misses were genuinely ambiguous threads. Your quality bar: ~95% on your own test set before running unattended.

Step 3: Set Up the Labels and the Routing Logic

Routing logic diagram for how to build an AI agent that triages email

In Gmail, create five labels matching your categories (e.g., Agent/Urgent, Agent/Action, Agent/Routine, Agent/FYI, Agent/Noise — the prefix keeps them grouped and makes it obvious what the agent touched).

Then build the branch logic — in Relay.app this is a conditional step after the AI classification step; in Lindy it’s part of the agent’s instruction set:

If classification is…Agent does…
URGENTApply label. Add to digest list with the sender and one-line reason. Optionally ping you (SMS/Slack) only for after-hours urgent mail.
ACTIONApply label. Draft nothing; add to digest as “needs your reply.”
ROUTINEApply label. Draft a reply (Step 4) and add to digest as “draft ready.”
FYIApply label. Count it in the digest only.
NOISEApply label; optionally auto-archive. Never appears in the digest.

The Noise → auto-archive branch deserves a decision. We recommend leaving auto-archive off for the first two weeks while you audit accuracy (Step 6), then turning it on only for categories where precision hit 100% in your audit. Archiving is reversible; don’t let the agent delete anything, ever.


Step 4: Write the Reply-Drafting Prompt (Templates Included)

Drafting is where agents earn their keep and where tone goes wrong. The trick: give the agent your own words as anchors and strict length rules. We use three templates — one generic, two examples from real mail.

Template A — Scheduling requests:

Write a short reply draft to this scheduling request.

My constraints this week: {{your_availability}}
Sender: {{from}}
Their message: {{body}}

Rules:
- Max 60 words. Plain text, no greeting longer than the name.
- Offer exactly two specific time windows. Include a scheduling link ONLY if the requester
  is not already a calendar contact; otherwise ask them to confirm one window.
- If they requested a time I'm unavailable, counter with the nearest two windows.
- End with my sign-off style (see examples).
- Never commit to new recurring meetings or same-day meetings after 2 PM.

Tone examples from my own replies:
1. {{paste_a_real_short_reply_you_sent}}
2. {{paste_another_one}}

Output ONLY the draft body. No commentary.

Template B — FAQ/pricing requests:

Write a short reply draft answering this routine question.

Sender: {{from}}
Their question: {{body}}

Use these facts (update them as facts change):
- Pricing: {{your_pricing_lines}}
- Standard turnaround: {{your_turnaround}}
- Links to include: {{pricing_page_url}}, {{booking_link}}

Rules:
- Max 80 words. Answer the actual question first, then one sentence of context.
- If the question mentions a topic NOT covered by the facts above, do NOT guess.
  Output "NEEDS HUMAN — topic outside facts" instead of a draft.
- Never invent prices, dates, or policy exceptions.
- Output ONLY the draft body. No commentary.

Template B’s escape hatch (“NEEDS HUMAN”) is the most important line in any drafting prompt. Agents hallucinate confidently when they lack facts; a facts block plus an explicit refusal rule converts hallucination risk into a clean handoff. In our two-week test run, the escape hatch fired 4 times — each one a genuinely unanswerable question that a draft-only agent would otherwise have invented an answer for.

Template C — Status checks on known projects:

Write a short status-reply draft.

Sender: {{from}}
Their message: {{body}}
Current status (updated weekly): {{project_status_notes}}

Rules:
- Max 70 words. State current status, next milestone, and date.
- If {{project_status_notes}} doesn't mention what they're asking about, output
  "NEEDS HUMAN — status not on file" instead of a draft.
- Output ONLY the draft body.

Step 5: Build the Morning Digest

Daily digest output from how to build an AI agent for your inbox

The digest is what makes the agent feel magical — and it’s just a formatting prompt run once a day over the accumulated triage data:

Write my 8:00 AM inbox digest from this triage data:
{{yesterdays_triaged_emails_with_categories_and_links}}

Format:
## Inbox Digest — {{date}}
- Triaged overnight: N emails (U urgent, A action, R with drafts ready, F FYI, X noise archived)
- URGENT (needs you today):
  - [sender] — one line why + link
- Drafts waiting for your approval:
  - [subject] — one line describing the draft + draft link
- Don't forget: items in ACTION older than 48h
Max 200 words. Plain, scannable, no fluff.

Deliver it where you’ll actually read it — email, Slack DM, or push. In our test the digest averaged 130 words and took under a minute to scan: the urgent list arrives pre-sorted and routine replies pre-drafted, so your first hour starts at zero inbox instead of fifty unread.

Step 6: Test, Audit, Then Let It Run

Don’t switch it on and walk away. Run this sequence:

  1. Dry run on 20 old emails. Feed them through manually (copy-paste into the classifier) and score each classification. Fix category definitions until you’re at ~95%.
  2. Live run in monitor mode, 3–5 days. The agent triages but drafts nothing and archives nothing. Review every decision; log each miss with the email type.
  3. Draft mode, 1–2 weeks. Drafts enabled, still nothing sent or archived automatically. Edit or discard every draft; track how many needed edits. Under ~10% edit rate means the drafting prompt is solid.
  4. Full run with weekly audits. Enable archive-on-noise. Once a week, spot-check 10 random triaged emails (30 seconds each) and confirm the categories.

Budget check: on Relay.app’s free tier (200 steps + 500 AI credits/month), one email costs roughly 2–3 steps and 2–3 AI credits. That covers ~60–80 emails/month — fine for a pilot. Bigger inboxes need a paid plan ($19/month annual on Relay.app, ~$49.99/month on Lindy).

The Agent at a Glance: Workflow Summary

StageWhat happensYour inputTime it saves
TriggerNew email polled every 15 minNone—
ClassifyAgent assigns one of 5 categoriesThe 5 category definitions you wrote onceEliminates triage reading
LabelGmail label applied per categoryLabel namesZero-effort sorting
DraftReply drafted for ROUTINE items only3 prompt templates + tone examples~3 min per routine reply
FlagURGENT items added to digest listVIP/”never” rulesNothing urgent slips
Digest8 AM summary of counts, urgents, draftsDelivery channelOne scan replaces inbox zero

Steady-state cost model: emails/day × 3 steps × 30 days ≈ monthly steps. Relay.app’s free tier (200 steps/month) covers roughly 2 emails/day; budget $19/month paid from ~7 emails/day up.

How to Get Started: Your First-Week Plan

  1. Day 1 — Connect and classify. Create the Relay.app workflow, connect Gmail with draft-only permissions, paste in the classification prompt with your five category definitions, and test on 20 old emails.
  2. Days 2–3 — Monitor mode. Let the agent triage live mail with drafting and archiving disabled. Review every decision; adjust category definitions on each miss.
  3. Days 4–5 — Draft mode. Enable reply drafting. Edit or discard every draft — an edit rate under ~10% means the prompts are working.
  4. Weekend — Build the digest. Add the 8 AM digest to the channel you check first each morning. Keep it under 200 words.
  5. Week 2 — Full run. Enable auto-archive for Noise only if audits showed 100% precision. Put a weekly 5-minute spot-check on your calendar.
  6. Month 2 — Plan for scale. Model monthly volume, pick a paid tier before free limits surprise you, and revisit your “never” list — real mail will surface new edge cases.

Troubleshooting: When Your Agent Misbehaves

Every first agent hits at least two of these. They’re all fixable in the prompts.

Problem: “It keeps misclassifying X as ROUTINE.”
Fix: your category definitions are topic-based, not consequence-based. Rewrite the definition around what happens if you’re wrong, and add an explicit example to the prompt: - Email asking for a refund → URGENT, never ROUTINE, even though it's "billing." One concrete example beats three paragraphs of abstraction.

Problem: “Drafts sound like a robot / not like me.”
Fix: you gave it instructions but no examples. Add two real replies you sent (copy-paste, unedited) as tone anchors. Also cap length — agents default to polite corporate filler; “max 60 words” kills it.

Problem: “It drafted a reply to something sensitive.”
Fix: your “never” list is too short. Legal, HR, payments, press, and executive escalations should be named explicitly in the classifier prompt. Also consider an approval branch: ROUTINE drafts get saved normally, but anything from a VIP domain goes to URGENT instead of ROUTINE.

Problem: “It runs but I never look at the digest.”
Fix: the delivery channel is wrong. Move the digest to wherever you actually look in the first 15 minutes of your day. Also cut it under 150 words — digests over 250 words get skimmed into oblivion.

Problem: “It uses up my credits/steps too fast.”
Fix: reduce polling frequency (every 30–60 minutes is fine for most inboxes), stop classifying newsletters you could filter with a Gmail filter rule instead, and exclude folders like sent mail and archive from the trigger. Agents shouldn’t do what deterministic filters do better and cheaper.

Problem: “It apologizes and asks me to confirm everything.”
Fix: the prompt has too many hedges. Remove “you may consider” and “if appropriate”; give binary rules. In conversational setups, tell the agent explicitly: “Make the call; explain your reasoning in the digest.”

Pre-Launch Checklist

Pre-launch checklist before finishing how to build an AI agent

Run through this before the agent touches your real inbox unattended:

  • Classification tested on 60+ real emails, ≥95% correct
  • “Never” list covers legal, HR, payments, press, VIP escalations
  • Agent has read/label/draft permissions only — no send access yet
  • Drafts audited for 1–2 weeks; edit rate under ~10%
  • Escape hatch (“NEEDS HUMAN”) present in every drafting prompt
  • Digest delivery channel confirmed; digest under 200 words
  • Noise auto-archive off until audit shows 100% precision; nothing auto-deleted ever
  • Kill switch tested — you can pause the agent in under 30 seconds
  • Weekly spot-check habit on the calendar (10 emails, 5 minutes)
  • Monthly volume modeled; paid plan chosen before free-tier limits surprise you

Frequently Asked Questions

Do I need to know how to code to build an AI agent?

No. The agent in this guide uses a no-code builder — your “code” is the written prompts and branch logic you configure by clicking. The hard part is specification and prompt design, which is writing, not programming. If you can write a clear procedure document, you can build this agent.

How long does it take to build your first AI agent?

The build itself took about 40 minutes; prompt tuning and testing took the rest of an afternoon. Budget 2–3 hours total for your first agent, most of it on the classification prompt and auditing test runs. Your second agent will take half the time — the guardrail patterns carry over.

Which AI agent builder should a beginner use?

For this inbox agent: Relay.app, because human approval and step-level control are built into the workflow — both essential for anything that touches your inbox. If you’d rather describe what you want conversationally than click through a workflow builder, Lindy’s setup is faster (~12 minutes in our test) but check that it’s set to draft-only before going live. We compared the full field in our no-code builder roundup.

How much does it cost to run a simple AI agent?

For a personal inbox agent, the free tier is usually enough to start — Relay.app’s free tier covers roughly 60–80 emails/month. Expect $19–$50/month once volume grows (Relay.app from $19/month annual, Lindy from ~$49.99/month after trial). Poll less often and filter newsletters with plain Gmail rules to stay cheap.

Is it safe to let an AI agent read my email?

Safer than most people assume, with two conditions: grant minimum permissions (read, label, draft — not send, not delete) and keep the agent draft-only for anything customer-facing. The real risk isn’t the agent reading mail; it’s the agent acting on mail. Reputable builders use standard OAuth with revocable access; check the builder’s security page for SOC 2 or equivalent certifications before connecting a work account.

What’s the difference between an AI agent and an automation?

An automation follows fixed rules you wrote (“if email from X, label as Y”). An agent uses judgment: it reads the email, reasons about it with an AI model, and decides what applies. Use automations for deterministic tasks (Gmail filters, Zapier zaps); use agents for the gray-area work where the right action depends on understanding the content — like triaging an inbox where the category is a judgment call. We break this down further in our agents-vs-automation explainer.

Conclusion

How to build an AI agent, boiled down: pick one narrow, judgment-heavy job; write a spec you’d hand to a careful human assistant; build it in a no-code builder with draft-only permissions; and spend your real effort on the classification prompt and the escape hatches. The inbox triage agent is the ideal first build — it saves 20–30 minutes a day, it’s safe by design (nothing sends without you), and every lesson (categories, tone anchors, audit loops) transfers directly to your second agent.

Next step: create a free Relay.app account, connect your inbox with draft-only permissions, and paste in the classification prompt from Step 2. Test it on 20 old emails tonight — you’ll know before bed whether your categories are right.

Leave a Comment