The Core Components of an AI Email Agent
Before you build anything, you need to understand the three pieces of a working system. Forget the hype about autonomous agents. A practical email bot is just a simple assembly line with three stops: Trigger, Brain, and Action.
- The Trigger: A New Email Arrives. This is your starting pistol. For most of us, this means connecting to a Gmail or Outlook account. The automation platform needs to securely access your inbox to see new messages as they come in.
- The Brain: An LLM Classifies and Drafts. This is where the AI does its job. It’s not one monolithic task. It’s two distinct steps. First, the AI reads the email and classifies it (e.g., ‘Sales Lead’, ‘Support Question’, ‘Spam’). Second, based on that category, it drafts a reply using instructions you provide. We’ll use the OpenAI API for this, but Claude or Gemini works too.
- The Action: A Draft is Saved. The AI doesn’t hit send. I’ll say that again: the AI does not hit send. It saves a draft reply in your email account and maybe applies a label like ‘AI-Drafted’. A human—you—gives it a final check and sends it.
To connect these three pieces, you need glue. That’s a no-code automation platform like Make or Zapier. They listen for the trigger and shuttle data between your email and the AI model. I use Make for its visual interface and better handling of complex logic, but the principles are the same for both.
What Most Guides Get Wrong About AI Email Automation
Most tutorials on this topic show you a toy. They hook up ChatGPT to Gmail and have it auto-reply to everything. This is profoundly stupid and a fantastic way to destroy your reputation. An unconstrained LLM will eventually say something bizarre, wrong, or offensive to a customer. It’s not a matter of if, but when.
AI Side Hustles
Practical setups for building real income streams with AI tools. No coding needed. 12 tested models with real numbers.
Get the Guide → $14
The common approach misses the most critical part of the process: context and control. A simple prompt like “Reply to this email” gives the AI no guardrails. It doesn’t know your business, your tone of voice, or what it is and isn’t allowed to promise. It will happily offer a 50% discount to a tire-kicker or apologize for an outage that never happened.
This is the part that requires real engineering.
The goal isn’t to create a fully autonomous agent that runs your inbox. The goal is to build an assistant that does the 80% of repetitive work for you. It handles the triage, finds the right information, and drafts a solid starting point. Your job is the final 20%: review, personalize, and send. This human-in-the-loop system gives you speed without sacrificing quality or taking on massive risk.
Step-by-Step: Building Your Triage & Draft Agent in Make
Let’s build a functional version of this. We’ll use Make and the OpenAI API to watch a Gmail inbox, classify new emails, and draft replies for sales inquiries.
Step 1: The Trigger – Watch for New Emails
In a new Make scenario, your first module is the Gmail ‘Watch Emails’ trigger. Connect your account and specify the folder to watch (usually ‘Inbox’). Set it to only pull unread emails. This module will run periodically, grab new emails, and pass their content downstream.
Step 2: The First AI Call – Classification
Next, add an OpenAI ‘Create a Completion’ module. This is your classifier. The goal is to turn an unstructured email into a structured category. Your prompt is the most important piece here. Don’t be lazy with it.
Here’s a solid starting prompt for the ‘content’ field:
You are an expert email triage system. Read the following email and classify it into one of these exact categories: [Sales Inquiry], [Support Request], [Spam], [Job Application], [Other]. Your response must be ONLY the category name and nothing else. Email content: "{{1.text}}"
The `{{1.text}}` is Make’s way of inserting the text content from the Gmail trigger. By forcing the model to only reply with a category name, you get clean, predictable output you can use in the next step.
Step 3: The Router – Branching Logic
Add a ‘Router’ module after the OpenAI classifier. A router creates conditional paths. We’ll create a path that only runs if the output from the previous step contains ‘Sales Inquiry’. You’ll add other paths later for ‘Support Request’ and so on. This is how you handle different types of emails with different instructions.
Step 4: The Second AI Call – The Draft
On the ‘Sales Inquiry’ path, add another OpenAI module. This one drafts the reply. The prompt here needs to be much more detailed. It should include your company’s context, your desired tone, and specific instructions.
You are a helpful sales assistant for DeepUseCase, a company that sells AI automation blueprints. Your tone is professional, direct, and helpful. Draft a reply to the following sales inquiry. Ask clarifying questions to understand their needs. Mention that our blueprints are deployable and designed for operators. Do not promise specific results or pricing. End by suggesting a 15-minute call and asking for their availability. Inquiry: "{{1.text}}"
This prompt gives the AI everything it needs: a persona, context about the business, rules (don’t promise pricing), and a clear call to action. This is how you get useful drafts instead of generic nonsense.
Step 5: The Action – Create a Draft and Label It
The final step is another Gmail module, this time the ‘Create a Draft’ action. Map the fields appropriately: ‘To’ address comes from the original email’s ‘From’ address. The ‘Subject’ can be the original subject with “Re:”. The ‘Body’ is the output from your drafting AI module. Crucially, in the same module, add a label like ‘AI-Drafted’. This lets you easily find and review all the drafts in your Gmail interface.
My biggest gripe with this whole process? Parsing the email body. You’ll quickly discover that `{{1.text}}` contains a ton of junk—signatures, disclaimers, and endlessly nested reply chains. You often have to add an intermediate step to clean this text with regex or string functions before sending it to the AI. It’s an annoying but necessary bit of plumbing.
