📚Academy
likeone
online

Email & Communication Agents

Your AI reads, drafts, triages, and sends email -- so you don't have to.

Email is the single biggest time sink in business. An AI agent that triages your inbox, drafts responses in your voice, schedules follow-ups, and sends routine messages saves hours every week. This lesson builds that agent.

What you'll learn

  • Setting up automated email sending with Resend or SMTP
  • Building an email triage system: priority, category, suggested action
  • Drafting responses in your voice using brain context
  • Template systems for recurring email patterns

The Email Agent Stack

A complete email agent needs four components:

Reading (inbox access). Connect to your email via IMAP, Gmail API, or MCP integration. The agent reads incoming messages, extracting sender, subject, body, and attachments.

Triage (classification). The agent classifies each email: priority (urgent, normal, low), category (client, billing, support, spam), and suggested action (reply, forward, archive, flag for human review).

Drafting (response generation). For emails that need a response, the agent drafts in your voice using brain context -- your identity, your communication style, your relationship with the sender, your current projects.

Sending (outbound delivery). The agent sends emails via Resend API, SMTP, or your email provider's API. Proper authentication (SPF, DKIM, DMARC) ensures deliverability.

Sending Email with Resend

Resend is the simplest way to send transactional email from code. One API call, proper authentication, great deliverability:

// Install: npm install resend import { Resend } from 'resend'; // Initialize with your API key const resend = new Resend(process.env.RESEND_API_KEY); // Send an email async function sendEmail(to, subject, body) { const response = await resend.emails.send({ from: 'you@yourdomain.com', // Must be verified domain to: to, // Recipient subject: subject, // Subject line html: body, // HTML body (or use 'text' for plain) bcc: 'archive@yourdomain.com' // BCC yourself for records }); return response; } // Example: send a client follow-up await sendEmail( 'client@company.com', 'Following up on our conversation', '

Hi Sarah,

Thanks for the call today. As discussed, here are the next steps...

' );

Email Triage System

The triage system reads each incoming email and classifies it using your local AI or cloud model:

// Triage prompt -- sent to your AI with the email content const triagePrompt = ` You are an email triage agent for a business owner. Classify this email: From: ${email.from} Subject: ${email.subject} Body: ${email.body.substring(0, 1000)} Respond with JSON: { "priority": "urgent|normal|low", "category": "client|billing|support|newsletter|spam|personal", "action": "reply|forward|archive|flag|delete", "summary": "One sentence summary", "draft_reply": "If action is reply, draft a response. Otherwise null." } Rules: - Emails from known clients are always priority: normal or urgent - Newsletters and marketing are always priority: low, action: archive - Anything mentioning money, deadlines, or problems is priority: urgent `;

Run this through your local Ollama model for routine classification (free, fast) and escalate to Claude for emails that need nuanced drafting (better quality). The triage itself costs nothing when run locally.

🔒

This lesson is for Pro members

Unlock all 355+ lessons across 36 courses with Academy Pro. Founding members get 90% off — forever.

Already a member? Sign in to access your lessons.

Academy
Built with soul — likeone.ai