HydraDB for AgentMail
Sync AgentMail inboxes into a HydraDB knowledge graph.
AgentMail gives AI agents their own inboxes. This connector ingests that email into HydraDB as an app source, so an agent can recall past conversations before it replies.
Each message is stored as a HydraDB app_knowledge item of type email and
linked to its thread node, so recall returns the whole conversation. AgentMail
provides a native thread_id, so threads need no reconstruction.
Quick start
pip install hydradb-agentmail-plugin
export AGENTMAIL_API_KEY=... # AgentMail API key
export HYDRADB_API_KEY=... # HydraDB API key
export HYDRADB_DATABASE=... # target database (tenant)
agentmail-sync # every inbox
agentmail-sync <inbox_id> # one inbox
Behavior
- With no argument, lists all inboxes and syncs each. Pass an inbox id to scope to one.
- Uses AgentMail's reply-stripped
extracted_text, falling back totextthenpreview. Caps body length at 8000 characters. - Links each message to an
agentmail-thread-<thread_id>node and to its parent viain_reply_to, so threads and reply chains come back connected. - Set
AGENTMAIL_AFTER(ISO 8601) to pull only messages after a cutoff. - Query with
query_apps: true(the default) to search this email alongside other app sources.
Configuration
| Variable | Required | Description |
|---|---|---|
AGENTMAIL_API_KEY |
yes | AgentMail API key (bearer token). |
HYDRADB_API_KEY |
yes | HydraDB API key. |
HYDRADB_DATABASE |
yes | Target HydraDB database (tenant). |
HYDRADB_COLLECTION |
no | Sub-tenant scope within the database. |
AGENTMAIL_INBOX_ID |
no | Default inbox when no argument is given. |
AGENTMAIL_AFTER |
no | ISO 8601 cutoff for an incremental pull. |
Field mapping
AgentMail's message_id is the RFC Message-ID, so in_reply_to already equals
the parent's node id once angle brackets are stripped. The parent upserts to the
same id on its own sync, so reply edges connect across incremental runs.
| AgentMail field | HydraDB app_knowledge |
|---|---|
message_id (RFC Message-ID) |
id (upsert key, brackets stripped) |
| (constant) | type: "email" |
subject |
title and first line of content.text |
extracted_text / text / preview |
content.text |
timestamp |
timestamp |
inbox_id, thread_id |
tenant_metadata |
from, to, cc, reply_to, in_reply_to, labels, attachments |
additional_metadata |
thread_id |
relations.ids: agentmail-thread-<thread_id> |
in_reply_to |
relations.ids: parent message node |
Live ingest
Run on a schedule for a backfill, or call it from an AgentMail
message.received / message.sent webhook to ingest each email on arrival.
message_to_item and ingest_items are importable for the webhook path.
License
MIT. See LICENSE.
Metadata
Release files for hydradb-agentmail-plugin 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hydradb_agentmail_plugin-0.1.0.tar.gz | 7.0 kB | Without provenance | Details for hydradb_agentmail_plugin-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hydradb_agentmail_plugin-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for hydradb_agentmail_plugin-0.1.0-py3-none-any.whl |
Total release size: 14.5 kB
Release files / hydradb_agentmail_plugin-0.1.0.tar.gz
| Download URL | hydradb_agentmail_plugin-0.1.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4df362764792c789f74c8b9ee5a44291f71db981fbff268f5a4db5230c9a817
|
|
BLAKE2b-256 checksum How to use checksums |
dc5eb05c5544a056566f0f263a6adc3a0cc3aa3391e03b5a25b3036e58b158af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / hydradb_agentmail_plugin-0.1.0-py3-none-any.whl
| Download URL | hydradb_agentmail_plugin-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03eb1245b0c3c94e4991a8c03458111901951155efbf16231d7b88eb6ea8b8c0
|
|
BLAKE2b-256 checksum How to use checksums |
93e6c950c111b0f909550b38379f1488bfc7d7fa47ec71d9a4e4d347df8f9fa9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for hydradb-agentmail-plugin 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.