> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AgentMail integrations

> Integrate with AgentMail using LangChain Python.

[AgentMail](https://agentmail.to) 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

<CodeGroup>
  ```bash pip theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  pip install langchain-agentmail
  ```

  ```bash uv theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  uv add langchain-agentmail
  ```
</CodeGroup>

Get your API key from [agentmail.to](https://agentmail.to) and set it as an environment variable:

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
export AGENTMAIL_API_KEY="your-api-key"
```

## Tools

See the [AgentMail Toolkit](/oss/python/integrations/tools/agentmail) 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](/oss/python/integrations/document_loaders/agentmail) guide for loading messages from an inbox as LangChain `Document`s—useful for indexing into a vector store for RAG over email.

## Retriever

See the [AgentMail Retriever](/oss/python/integrations/retrievers/agentmail) guide for keyword search over an inbox.

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/providers/agentmail.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
