Classification.
Extract intent + entities + urgencyfrom every inbound via our 2-call classifier. +$0.003 per inbound on Metered, opt-in per agent. Skip if your agent runs its own LLM — paying twice isn’t a feature.
Three signs you should turn it on.
Your hot path is fast routing
You want `switch (reply.intent)` to handle the 80% common cases without an extra LLM call. Latency-sensitive support workflows benefit most.
You want entity extraction reused multiple places
`reply.entities.date` parsed once, used in calendar + CRM + notification handlers. Cheaper than running your own extractor each place.
You don't want to maintain a classifier
We tune the prompt, version it through changes, retrain when intent categories shift. You consume the output as a stable API.
Three signs you should leave it off.
Your agent runs an LLM on every reply anyway
If your code is `agent.onReply((reply) => claude.complete(reply.body))`, our pre-extraction is duplicated work. You're paying twice.
You only need the body + sender
Simple acknowledgment agents that reply to ANY inbound the same way don't need intent. Use the base inbound at $0.002 each.
You need exact-match intents we don't ship
Our 12 canonical intents cover most common cases. If you need domain-specific intents (e.g., legal-document review categories), build it yourself with a custom classifier.
One flag, per agent.
// Enable per-agent
const agent = mails.agent("sarah", {
domain: "yourcompany.com",
classify_inbound: true, // +$0.003 per inbound
});
agent.onReply((reply) => {
if (reply.intent === "schedule_demo") {
return calendar.schedule(reply.entities);
}
if (reply.urgency > 0.8 && reply.intent === "support_question") {
return escalate.toHuman(reply);
}
// Fall back to your own LLM for cases the classifier didn't catch
return llm.handle(reply.body);
});The questions we get.
What does the classifier actually do?
Two LLM calls per inbound. Call 1: preprocessor (~$0.0003 cost) scores the message for one of ~12 canonical intents (schedule_demo, unsubscribe, out_of_office, support_question, refund_request, escalation, no_op, etc.) plus reputation lookup. Call 2: extractor (~$0.0008 cost) pulls structured entities per intent (date/time for schedule_demo, reason for unsubscribe, etc.). Total wall-clock ~600ms. Total cost to us ~$0.0011 per inbound; we charge +$0.003 to cover infra + margin.
Why is injection scanning included but classification is opt-in?
Injection scanning is security infrastructure — you can't easily replicate it and you shouldn't have to. It runs on every inbound regardless. Classification is convenience infrastructure — your agent probably has its own LLM that does similar work. We don't want to charge you twice for the same extraction.
Can I turn it on for some agents but not others?
Yes. `classify_inbound: true` is a per-agent flag. Enable it on the customer-service agent that benefits from fast routing; leave it off on the bulk-notification agent that just forwards body.
What if your classifier returns the wrong intent?
Your agent code should fall back to a default branch (the `default` case in your switch). We score confidence on every intent; if `intent_confidence < 0.7`, your switch can route to fallback. The classifier won't be perfect — it's a speed optimization for the common cases, not a replacement for your agent's reasoning.
Built for agents.
Self-serve at every volume.
Public API opens Q3 2026. Drop ~6 lines into your agent and ship.
$ npm install @mailsai/sdk