HydraDB
Getting started
HydraDB is a context layer for AI agents. The hydradb-agentmail-plugin syncs an AgentMail inbox into HydraDB as an app source, so an agent can recall past email before it replies. Each message is stored as app-source knowledge and queried back through the context API.
Other integrations give an agent an inbox. This one connects an inbox you already have to a memory layer. Point it at one inbox or every inbox on the account.
Use cases
- Recall before replying: Query past threads, decisions, and files across the whole inbox, not just the current thread.
- Thread-aware memory: Every message links to its thread and to its parent through
in_reply_to, so a conversation is recalled together with its reply and thread links intact, not as loose records. - Cross-session memory: Email synced once stays queryable across agent runs and sessions.
- Attachment-aware search: Attachment names and types are indexed alongside the body, so “which email had the signed PDF” is answerable.
Prerequisites
- An AgentMail account with an API key from the AgentMail Console.
- A HydraDB account with an API key and a target database.
- Python 3.9+.
Setup
Install the connector:
Set your keys and target database:
Quickstart
Sync every inbox on the account:
Or scope to a single inbox:
Call it from your own code, for example from an AgentMail webhook handler:
Recall
Query HydraDB with query_apps enabled (the default) to search the synced email alongside your other app sources:
Results carry the source email as app knowledge, with thread and reply relations intact.
Keep it live
Run the sync on a schedule for a backfill, or drive it from an AgentMail message.received or message.sent webhook to ingest each email as it lands. message_to_item and ingest_items are importable for the webhook path.
