Skip to main content

Official AgentMail integration for CrewAI

Project description

CrewAI + AgentMail

Official AgentMail integration for CrewAI. Give your CrewAI agents real email inboxes — send, receive, reply, search, and organize emails as tools.

Install

pip install crewai-agentmail

Quick Start

from crewai import Agent
from crewai_agentmail import AgentMailTools

# Initialize with API key (or set AGENTMAIL_API_KEY env var)
toolkit = AgentMailTools(api_key="am_live_...")

# Add all 11 tools to an agent
agent = Agent(
    role="Email Assistant",
    goal="Manage email communications",
    tools=toolkit.get_tools(),
)

Create an Inbox & Send Email

# Individual tools
from crewai_agentmail import CreateInbox, SendEmail

create = CreateInbox(api_key="am_live_...")
print(create._run(name="Support Agent"))  # → inbox ID + email

send = SendEmail(api_key="am_live_...")
print(send._run(to="user@example.com", subject="Hello", body="Hi there!"))

Wait for Replies

from crewai_agentmail import WaitForMessage

wait = WaitForMessage(api_key="am_live_...")
print(wait._run(inbox_id="inbox_123", timeout=120))

Search & Label

from crewai_agentmail import SearchMessages, CreateLabel, ApplyLabel

search = SearchMessages(api_key="am_live_...")
print(search._run(inbox_id="inbox_123", query="urgent"))

label = CreateLabel(api_key="am_live_...")
print(label._run(name="Follow-Up", color="#FF5733"))

Environment Variables

Variable Description
AGENTMAIL_API_KEY Your AgentMail API key. Optional if passed to constructor.

Available Tools

Tool Description
CreateInbox Create a new email inbox
SendEmail Send an email
ListMessages List messages in an inbox
GetMessage Get full message details
ReplyToEmail Reply to a message
ForwardEmail Forward a message
WaitForMessage Long-poll for new messages
SearchMessages Search messages by query
CreateLabel Create an organizational label
ApplyLabel Apply a label to a message
DeleteInbox Delete an inbox permanently

Example

See example.py for a full CrewAI crew with a Sales Rep agent that creates an inbox, sends outreach, waits for replies, and cleans up.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crewai_agentmail-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crewai_agentmail-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file crewai_agentmail-0.1.0.tar.gz.

File metadata

  • Download URL: crewai_agentmail-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for crewai_agentmail-0.1.0.tar.gz
Algorithm Hash digest
SHA256 76ac5c6a40ce6bbee70dcaa925984cb2fac2ad6fc20f408650efef9dc38cfa9c
MD5 06741b927b3ea8d6c8060d0e97443ef6
BLAKE2b-256 f4ad35f70315f1d902a772b296df2799082874ee7e426cac7c0b95b926438538

See more details on using hashes here.

File details

Details for the file crewai_agentmail-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for crewai_agentmail-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 947b910d1b255ce211c2d3e2c45dd08f9e3ba948ddd93837063e68caf3ef1641
MD5 4a66bac67a2a88e9b070c2a606101b83
BLAKE2b-256 8ab8a4db10b4281ea815c40f1a3d79f12ae2c996c03486077fe6db0d0c88f47f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page