Why Every Claude Code User Needs To Try AgentMail (Not Gmail)

BBetter Stack
컴퓨터/소프트웨어창업/스타트업AI/미래기술

Transcript

00:00:00This is AgentMail, an API platform built specifically for AI agents that gives them
00:00:05a unique email address and inbox which allows them to send, receive, read and act upon emails
00:00:11to do things like customer support, cold outreach or just to be somewhere to manage all your forgotten
00:00:17newsletters. It works through a Python or TypeScript SDK, it has its own MCP server and even has its own
00:00:24CLI with skills to support it. But what's the difference between AgentMail and me creating a
00:00:29Gmail account for my agent using an MCP server to manage all of the messages? Hit subscribe and
00:00:35let's find out. Last week I made a video about the Google Workspace CLI which lets your agent manage
00:00:44your calendar, documents and of course your email which is really cool. But while your agent can
00:00:50manage Gmail with its own account, Gmail wasn't built for agents it was built for humans so it
00:00:56won't have the greatest experience. Let me explain. Now I've already signed up to AgentMail as you can
00:01:02tell by this AgentMail dashboard and created an inbox with a unique name. Note this AgentMail
00:01:08domain over here is because I'm on the free plan but you can add your own custom domain
00:01:14if you upgrade your plan. I've also created an API key and have added it to the list of
00:01:19my shell environment variables which means with the AgentMail CLI installed I can use it with
00:01:24Claude code and personally I prefer to use CLIs with Claude code instead of MCP servers. Let's also
00:01:30install the AgentMail skill to prevent me from referencing it inside my prompt. And that's it,
00:01:35you're good to use AgentMail with Claude. I know I've mentioned this already but if you have seen
00:01:39my Google Workspace CLI video you'll see how much easier it is to set up AgentMail than to set up
00:01:46this CLI to use with Claude code. Okay let's continue and now I can ask Claude what AgentMail
00:01:51inboxes do I have which will load up the skill then use the CLI to give me a response. Now from
00:01:56here I can get Claude to do some really cool things like send an email from my AgentMail email address
00:02:01to my personal email giving me a list of the top three places to get Matcha from King's Cross and
00:02:07yes I am a huge fan of Matcha. Let me know in the comments if you are too. And while it does that I
00:02:12want to prove to you that I don't have any messages that I've faked and now that it's done I have a new
00:02:18email giving me a list of the best places to get Matcha from in King's Cross. But because my agent
00:02:23has its own email address I can do some really cool things like sign it up to newsletters and I
00:02:29can also ask it to complete the subscription which it's gone ahead and done. But if I did want to do
00:02:34it manually I do have access to the inbox for the agent and we can see that the verification email
00:02:40for Node Weekly is over here but the agent has already completed this step. I could even forward
00:02:45some of my existing emails to the agent and ask the agent to summarise those emails which it's
00:02:52actually done quite well. I could even use called code's new loop feature to check every minute for
00:02:56new emails and summarise them which is actually a pretty good use of that feature. Now I'm just
00:03:01scratching the surface of what can be done with AgentMail because even if we just were to focus
00:03:06on inboxes you can have multiple inboxes for different agents. So if you have called code,
00:03:12codex, gemini, cli each one can have its own inbox or you could have an inbox just for subscriptions
00:03:18one just for customer support and because you're not charged based on inbox like other platforms
00:03:25it actually works out to be quite cost effective and allows you to have some really cool workflows
00:03:30like having an agent send a message to another inbox based on its contents and also getting
00:03:36agents to create inboxes on demand and delete them when they're done. Now I've been using
00:03:41AgentMail with Claude code which is nice for personal use and for testing but really you'd
00:03:47want this to be on its own custom agent because you don't want the limitation of having three days
00:03:52which you'll find more about on my video on loops and you might want to poll much more frequently.
00:03:58So let me show you an example of building a custom agent using the Claude SDK
00:04:03and using AgentMail. So here is a super simple agent powered by the Claude SDK that is using
00:04:09this email address from AgentMail and checking for new emails every 30 seconds from the time
00:04:15that the script starts running. So I'm not going to go through all the code in detail
00:04:19but we can see here it processes the messages and it does this by looking through all the
00:04:23messages inside the inbox checking the labels that are unread and based on the time that it's received
00:04:31it will then trigger another function which is generate reply and if we scroll down the
00:04:36generate reply function over here writes a prompt and this user content prompt goes to the Claude
00:04:42model which is currently haiku and it's using this system prompt to respond. So if we start the script
00:04:48we can see it's already noticed 16 messages in the inbox. I've been testing this a lot and so let's
00:04:54give it a new email and see if it replies. So I've written an email to the agent saying just testing
00:05:00the system who are you and what do you do. Now the script is polling every 30 seconds for new emails
00:05:06and now it's got one it's processing the message then using Claude to generate a response and if we
00:05:11go back we have a new email and a response from Claude which is super surreal but here it replies
00:05:17saying it's an AI assistant helping to manage this inbox and because this code is designed to read
00:05:23through threads I can send it a response saying thanks for your reply tell me a joke about cats.
00:05:29The script waits for 30 seconds processes the whole thread with three messages and then sends a
00:05:34response why don't cats play poker in the jungle because there are too many cheaters. As usual there
00:05:40are so many other features this tool has to offer that I haven't been able to go through in this
00:05:45video like web sockets for streaming events which also allow for zero latency email checking pods
00:05:51which isolate data between different customers if you're planning on building a product that offers
00:05:55the Asian mail infrastructure to different users IMAP and SMTP support and so much more. Speaking
00:06:02of things I didn't get around to showing all the features of in a video if you'd like to make a
00:06:06desktop app that is small fast and powered by web technology then you should check out this video
00:06:12I've made about electrobahn which might just be the thing you're looking for.

Key Takeaway

AgentMail provides a purpose-built email infrastructure for AI agents that surpasses traditional services like Gmail by offering seamless CLI integration, specialized SDKs, and scalable inbox management.

Highlights

AgentMail is an API-first email platform designed specifically for AI agents, offering unique inboxes and SDKs.

Unlike Gmail, AgentMail is built for machine interaction, supporting Python/TypeScript SDKs, MCP servers, and a CLI.

The platform allows agents to perform complex tasks like managing newsletters, customer support, and cold outreach autonomously.

AgentMail offers a more streamlined setup for Claude Code compared to the complex configuration required for Google Workspace.

Users can create and delete multiple inboxes on demand, making it a cost-effective solution for various specialized AI workflows.

Advanced features include WebSockets for zero-latency email checking, data isolation through 'pods', and IMAP/SMTP support.

A custom agent can be built using the Claude SDK to poll the inbox and generate automated, thread-aware responses.

Timeline

Introduction to AgentMail for AI Agents

The speaker introduces AgentMail as an API platform specifically engineered for AI agents rather than human users. It provides agents with unique email addresses and inboxes to send, receive, and act upon messages for tasks like customer support or newsletter management. The technical ecosystem includes a Python and TypeScript SDK, an MCP server, and a dedicated CLI with specific skills. A primary question is raised regarding the advantage of AgentMail over creating a standard Gmail account for an agent. This section establishes that while Gmail is built for humans, AgentMail is optimized for the machine experience.

Setting Up AgentMail with Claude Code

The speaker demonstrates the setup process, showcasing the AgentMail dashboard and the creation of a unique inbox name. Free plans use an AgentMail domain, while upgraded plans allow for custom domains to enhance professional branding. The integration involves creating an API key, adding it to shell environment variables, and installing the AgentMail CLI for use with Claude Code. The speaker emphasizes his preference for CLIs over MCP servers for better control and performance. Crucially, he notes that this setup is significantly faster and easier than configuring the Google Workspace CLI for similar tasks.

Live Demonstration: Tasks and Newsletter Management

In this practical demonstration, Claude Code is used to query available inboxes and send a specialized email about Matcha locations in King's Cross. The agent successfully interacts with real-world services by signing up for newsletters and autonomously completing the verification process. The speaker shows the manual inbox view to confirm that the agent handled the verification email before a human could even intervene. Additionally, the agent demonstrates its ability to summarize forwarded emails efficiently. This section highlights the power of Claude's new loop feature for periodic email checking and summarization.

Scalability, Costs, and Workflow Advantages

The discussion shifts to the architectural advantages of AgentMail, such as the ability to maintain multiple inboxes for different agents like Codex or Gemini. Unlike other platforms that charge per inbox, AgentMail's pricing model is described as cost-effective for complex AI workflows. This flexibility allows agents to create inboxes on demand for specific tasks and delete them once the job is finished. The speaker explains that while Claude Code is great for testing, professional applications require custom agents to avoid session limitations. This context sets the stage for moving beyond basic CLI tools into full application development.

Building a Custom Agent with Claude SDK

The speaker presents a technical walkthrough of a custom agent powered by the Claude SDK and AgentMail. The script polls the inbox every 30 seconds, filters for unread messages, and triggers a 'generate reply' function using the Claude Haiku model. A live test shows the agent receiving a 'who are you' email and responding with a self-description as an AI assistant. The agent proves its capability to handle conversation threads, successfully processing a follow-up request for a joke. This demonstrates a complete, automated loop where the AI maintains context across multiple email exchanges.

Advanced Features and Conclusion

The video concludes by briefly touching upon advanced features intended for production-grade products. These include WebSockets for streaming events and zero-latency email polling, as well as 'pods' for isolating data between different customers. Support for traditional protocols like IMAP and SMTP is also mentioned to ensure compatibility with broader email ecosystems. The speaker suggests these tools are essential for anyone building a serious AI-driven product. Finally, he points viewers toward a related video on Electrobahn for those interested in building fast desktop applications with web technology.

Community Posts

No posts yet. Be the first to write about this video!

Write about this video