Skip to content

Add example: Build an Email Agent with AgentMail#2470

Open
adi-singh13 wants to merge 1 commit intoopenai:mainfrom
adi-singh13:add-agentmail-email-agent-example
Open

Add example: Build an Email Agent with AgentMail#2470
adi-singh13 wants to merge 1 commit intoopenai:mainfrom
adi-singh13:add-agentmail-email-agent-example

Conversation

@adi-singh13
Copy link

@adi-singh13 adi-singh13 commented Feb 27, 2026

Summary

Adds a new example notebook showing how to build an AI email agent using OpenAI GPT-4 and AgentMail — the email API for AI agents.

What this covers

  • Creating programmatic email inboxes for agents
  • Sending emails from an agent
  • Receiving and processing incoming emails
  • Using GPT-4 to generate contextual email replies
  • Thread management for multi-turn email conversations
  • Using AgentMail's extracted_text for clean reply parsing
  • OpenAI function calling with agentmail-toolkit
  • Production webhook setup

Why this is useful

Email is one of the most common capabilities AI agents need — for customer support, authentication (2FA), sales outreach, and document processing. This example shows a clean pattern for building email-powered agents with OpenAI.

About AgentMail

  • YC S25 backed
  • API-first email infrastructure for AI agents
  • SOC 2 Type II certified
  • Free tier available at console.agentmail.to

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f0b9399a81

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@@ -0,0 +1,335 @@
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add registry entry for this new notebook

This commit adds a new cookbook notebook but does not update registry.yaml, so the static site generator will not publish or surface this example on cookbook.openai.com. In this repo, new content is expected to be registered explicitly, so the change is incomplete as-is and the main user-visible goal of the commit (shipping a new example) will not be met.

Useful? React with 👍 / 👎.

@@ -0,0 +1,335 @@
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Rename notebook to lowercase per repo convention

The new file name uses mixed case (Email_agent_with_AgentMail.ipynb), which violates this repo’s notebook naming convention for lowercase, separator-based names. This inconsistency makes links/paths less predictable and increases maintenance friction when authors reference files across docs and metadata, so it should be normalized before merge.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant