Skip to content

Add AgentMail as an alternative email provider - #8

Open
adi-singh13 wants to merge 1 commit into
kaymen99:mainfrom
adi-singh13:add-agentmail-provider
Open

Add AgentMail as an alternative email provider#8
adi-singh13 wants to merge 1 commit into
kaymen99:mainfrom
adi-singh13:add-agentmail-provider

Conversation

@adi-singh13

Copy link
Copy Markdown

Summary

This PR adds AgentMail as an optional alternative email provider alongside the existing Gmail API integration. The goal is to give users more flexibility — especially those who want a quicker setup without OAuth.

Changes

  • src/tools/AgentMailTools.py — New email tools class implementing the same interface as GmailToolsClass, using the AgentMail Python SDK
  • src/nodes.py — Added a factory function that selects the email provider based on the EMAIL_PROVIDER environment variable (gmail by default, agentmail as an option)
  • README.md — Added setup instructions for the AgentMail option

How it works

Users set EMAIL_PROVIDER=agentmail in their .env file along with AGENTMAIL_API_KEY and AGENTMAIL_INBOX_ID. The existing Gmail flow remains the default and is completely unchanged.

Why AgentMail?

  • No OAuth complexity — just an API key, no credentials.json or token.json needed
  • Programmatic inbox creation — each agent can get its own email address via the SDK
  • AI-native features — extracted text and auto-labeling built in

This is a non-breaking, additive change. The default behavior (Gmail API) is untouched.

Adds AgentMail (https://agentmail.to) as an optional email provider
alongside the existing Gmail API integration. Users can switch between
providers by setting the EMAIL_PROVIDER environment variable.

Changes:
- Add src/tools/AgentMailTools.py with full AgentMail SDK integration
- Update src/nodes.py with a factory function to select email provider
- Update README.md with AgentMail setup instructions

AgentMail offers a simpler setup (API key only, no OAuth) which can be
useful for quick prototyping or environments where Gmail OAuth is
inconvenient.
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