The Email interface connects agents to email, polling for new messages via IMAP and sending responses via SMTP.
Quick Start
from definable.agent import Agent
from definable.agent.interface.email import EmailInterface
agent = Agent(model="gpt-4o", instructions="You are a helpful email assistant.")
email = EmailInterface(
imap_host="imap.gmail.com",
smtp_host="smtp.gmail.com",
email_address="[email protected]",
password="app-password",
)
agent.serve(email)
Features
- IMAP polling for new messages
- SMTP sending with TLS
- Thread tracking via In-Reply-To and References headers
- Multipart body extraction
- Session management per email thread
Constructor Reference
Email address to monitor.
Email password or app-specific password.
Seconds between IMAP polls.
Imports
from definable.agent.interface.email import EmailInterface