How it Works

From inbox to reply — in six steps

MailPilot polls your inbox, optionally pre-filters by keywords, retrieves KB context when configured, and uses one LLM call for relevance and reply—then drafts or auto-sends based on REPLY_MODE.

1
Poll inbox
Gmail API (recent threads) or IMAP INBOX on a schedule, manual run, or IMAP IDLE for SMTP mailboxes.
2
Keyword prefilter
Optional SERVICE_KEYWORDS skip obvious noise before the LLM runs (same as the worker prefilter).
3
RAG lookup
When KB is configured, MailPilot embeds the message and retrieves top pgvector chunks (JSON upload).
4
AI relevance & reply
A single LLM call returns relevance, confidence, and reply text; RELEVANCE_THRESHOLD must pass.
5
Draft or auto-send
REPLY_MODE=draft stores the reply for review; send posts via Gmail API or SMTP immediately.
6
State & queue
ProcessedMeta prevents re-handling; the dashboard queue shows activity. Login/settings events are audit-logged in admin.