Mailbox Agents







Alpha, version 0.11.0. Built, and run on a test account of
invented mail. On a real mailbox, read-only and in the stage shadow:
invoices version 3 on 2026-11-18, sorting and invoices on
2026-11-22, and invoices, inquiries and awaiting_reply in the
versions of 0.11.0 on 2026-11-23. None changed anything. Names, settings and
the state file may still change from one version to the next. The
design is written down in
docs/mailbox-agents/CONCEPT.md.
Do not point it at a mailbox you care about.
The AI agents of Mailbox, on PyPI as benethos-mailbox-agents. They
work on a mailbox continuously. Each one looks at mail as it arrives or
leaves, decides one narrow question about it and takes one
reversible action: a keyword, or a move to a folder. The first ones sort
invoices, track sent mail that still waits for a reply, recognise project
inquiries and file the mail of listed senders into folders.
Mailbox is self-hosted and has five packages. The agents do not work
alone. They need the service, which runs on your own machine or server
and holds the connections to your mail accounts, and a model gateway.
Install the service first: Install
and First start
in its README. Up to 0.2.0 the agents were a repository of their own,
benethos-hub/mailbox-agents,
which keeps their history and their changelog up to that release.
A message comes to an agent through the change feed of the service. The
agent asks a model through the gateway, and hands a keyword or a move
back to the service.
| Package |
Its part |
How you get it |
mailbox-service |
It holds the connections to your mail accounts and their credentials, encrypted. It offers one REST API for every provider and decides what a token may do. It has to be running. |
Getting started, before the agents |
mailbox-agents |
This package. Small AI agents that sort and mark mail. |
Install |
mailbox-client |
The Python client of the REST API. The agents make every request with it. |
installed with the agents |
mailbox-mcp |
The MCP server. It turns the REST API into tools for an AI assistant. The agents do not use it. |
not needed here |
mailbox-common |
What the service, the MCP server and the agents share. |
installed with this package |
The agents take only a service of their own version: before 1.0
the same minor version, from 1.0 the same major version and a minor
version no older than theirs. An agent stops at any other. The agents
0.2.0, released before they joined this repository, take the service
0.8 and 0.9 only.
What the project is for: the repository's README.
Contents
- How it works
- Install
- Development
- Licence
How it works
- Mail is reached only through the REST API of the service, with its
Python client
benethos-mailbox-client.
- A language model is reached only through an OpenAI-compatible gateway,
with one call per message, a JSON schema for the answer and no tools.
- Everything else is deterministic code: which messages an agent looks at,
what a rule says, whether a quote from the model is really in the mail,
and which action follows.
- Every agent runs in a process of its own, with its own credentials and
its own SQLite state file. The state file holds ids and decisions, never
the text of a mail.
- A new agent starts in the stage
shadow, where it only records what it
would do. The stages keyword and full follow after it was measured
against labelled mail.
Install
The package is benethos-mailbox-agents on PyPI, for Python 3.11 or
newer:
uvx benethos-mailbox-agents --version
In operation each agent runs as a container of the image
ghcr.io/benethos-hub/benethos-mailbox-agents.
containers/production
holds the compose file and says how to set it up. Every setting is listed
in
docs/mailbox-agents/concept/configuration.md.
Development
Needs uv and a clone of the repository, from
whose root the commands run.
uv sync
uv run benethos-mailbox-agents --version
uv run pytest -q packages/mailbox-agents/tests
The suite is offline. The live checks run against a mail server and a
mailbox service of their own with invented mail, see
containers/live.
Licence
MIT, see LICENSE.