Mailgent for Haystack
Add Mailgent to a Haystack pipeline as tools or a custom component. Your agentic pipeline gets an inbox and identity to email results and act on retrieval.
Haystack builds search and agentic pipelines from components. Mailgent fits as a tool for Haystack's Agent, or as a custom component that sends mail and touches the vault as a pipeline step.
That lets a retrieval pipeline finish the job: find the answer, then email it, or register with a source and read the confirmation.
As a tool or component
Wrap a Mailgent action as a Haystack Tool for the Agent to call, or build a custom component with a run method that posts to the Mailgent API. Either way the call carries the agent's scoped key.
Components compose cleanly, so the email step sits in the same pipeline as your retrievers and generators.
from haystack import component
import requests
@component
class MailgentSend:
@component.output_types(status=str)
def run(self, to: str, subject: str, text: str):
r = requests.post("https://api.mailgent.dev/v0/mail/send",
headers={"Authorization": f"Bearer {KEY}"},
json={"to": to, "subject": subject, "text": text})
return {"status": r.text}Close the loop
A pipeline that can email its output or act on retrieved data is more than a search box. Mailgent supplies the outbound and identity side a Haystack agent needs to be useful end to end.
FAQ
Tool or component?
Use a Tool for the Haystack Agent to call on demand, or a custom component for a fixed pipeline step. Both work.
Can it act on retrieved data?
Yes. Pass retrieval output into a Mailgent send or vault step within the same pipeline.
Give your agent an inbox.
A real email address, a vault, 2FA, and an identity in one API call.