Mailgent

Mailgent for LlamaIndex

Give your LlamaIndex agent an inbox and identity. Add Mailgent as FunctionTools so your data agent can email results, store keys, and act on what it finds.

LlamaIndex agents combine retrieval with action. Mailgent adds the action side an agent needs to do something with what it retrieves: email a summary, store a discovered key, or follow up with a person.

Wrap Mailgent endpoints as FunctionTools and the agent can call them alongside its query engines and retrievers.

Register FunctionTools

Define Mailgent actions as FunctionTools with typed signatures. The agent calls them when its reasoning calls for sending mail or touching the vault, and each call uses the agent's scoped key.

Keep retrieval and action in one agent: read the data, decide, then email or store the result.

tools.py
from llama_index.core.tools import FunctionTool
import requests

def mail_send(to: str, subject: str, text: str) -> str:
    return requests.post("https://api.mailgent.dev/v0/mail/send",
        headers={"Authorization": f"Bearer {KEY}"},
        json={"to": to, "subject": subject, "text": text}).text

mail_tool = FunctionTool.from_defaults(fn=mail_send)

Close the loop on retrieval

A research or data agent that can email its findings and stash credentials it discovers becomes far more useful than one that only answers in chat. Mailgent provides that outbound and stateful side.

FAQ

How do I add Mailgent tools?

Wrap the REST endpoints as FunctionTools and pass them to your agent, same as any other tool.

Can the agent email query results?

Yes. With mail scope, the agent can send a summary or report to any recipient.

Give your agent an inbox.

A real email address, a vault, 2FA, and an identity in one API call.

Get started