Skip to main content
AgentMail is an inbox-as-an-API platform built for AI agents—provisioning, sending, replying, drafting, and inbound webhooks all available over a single HTTP API. The langchain-agentmail package wraps the AgentMail SDK as LangChain tools, plus a document loader and a retriever over an inbox.

Installation and setup

pip install langchain-agentmail
Get your API key from agentmail.to and set it as an environment variable:
export AGENTMAIL_API_KEY="your-api-key"

Tools

See the AgentMail Toolkit guide for details on the available tools, including sending and replying to messages, managing drafts, attachments, and labels.

Document loader

See the AgentMail Document Loader guide for loading messages from an inbox as LangChain Documents—useful for indexing into a vector store for RAG over email.

Retriever

See the AgentMail Retriever guide for keyword search over an inbox.