Deterministic fast path
High-confidence bulk mail from non-VIP senders skips the model entirely — a tier-one deterministic pass fills the fields and moves on. The LLM is reserved for mail that actually needs judgment.
Enrichment is the load-bearing AI pass in SwarmMarshal — it turns raw mail into threat verdicts, routing, summaries, commitments, facts, and memory. Because it runs on everything you receive, it gets the strictest engineering in the product: deterministic fast paths, calibration gates, replay harnesses, and cost governance.
A single consolidated pass emits every per-message AI field at once — threat, inbox routing, category, summary, entities, commitments, facts, action items, a reply draft, and memory candidates — instead of a fleet of per-field calls.
High-confidence bulk mail from non-VIP senders skips the model entirely — a tier-one deterministic pass fills the fields and moves on. The LLM is reserved for mail that actually needs judgment.
The prompt is split so the static prefix — instructions, taxonomy, memory — is roughly 97% of input tokens and identical across messages, letting provider prompt caching absorb most of the cost of every call.
Model output is a draft. Deterministic validators check contract shape, enum legality, exact-quote grounding, and knowledge gates; a repair pass fixes what it can, and ungrounded claims are dropped before anything durable is written.
Raw mail headers are noisy enough to poison a classifier — a provider's own antispam headers contain brand names and digit runs that look exactly like impersonation signals. SwarmMarshal distills headers into compact, prompt-safe evidence instead.
Authentication verdicts, Reply-To and Return-Path alignment, list headers, provider spam scores, and brand-domain mismatch are extracted into a structured block. Raw header excerpts only surface when the signals are already suspicious.
A curated brand-profile table backs impersonation checks — "claims to be Microsoft, sent from a domain Microsoft doesn't use" is a lookup, not a hunch.
The pipeline's prompt, validator, and scorer are bound to one shared taxonomy, and calibration renders through the exact production prompt path — byte-identical, never a hand-edited copy.
Pipeline changes are proven by running the real registered production task — the actual validator, repair, and finalizer path — over a cloned throwaway profile with seeded fixtures. Not a mock of the pipeline; the pipeline.
The champion model always serves. Captured production prompts are periodically replayed offline against challenger candidates, and a judge decides whether a cheaper challenger reaches the same answers — promotion happens on evidence, demotion risk never touches your inbox.
Picking a local model for the pipeline is a decision system: refresh Model Scout priors → build hardware-fit candidates → run a structured-output compatibility probe → run the full seed suite only for survivors → promote and warm the winner, unload the losers. Runtime-repair failures are distinguished from genuine model incompatibility, and every verdict lands in a catalog keyed by prompt hash and hardware.
The pipeline treats spend as a design constraint: obvious junk is stopped cheaply, provider verdicts are trusted but verified, and learned senders never cost tokens again.
New, untaught senders pass a cheap pre-pipeline gate — deterministic link, phone, and renewal-scam extraction plus a small prompt. A threat verdict short-circuits the heavyweight pipeline so obvious junk is never indexed or enriched.
Provider-flagged spam is reviewed for false positives — but only messages with independent innocence signals (clean authentication plus threading, contact, or transactional evidence) earn a model call. Everything else stays junked for free.
Teaching a sender sets skip masks that mark the AI processors complete without running them. Taught mail flows through the pipeline at zero model cost, forever.
Brand-impersonation and callback-scam heuristics live in one shared deterministic module — the same code in production and in analysis, so they can never drift apart. Around them runs a correction loop:
A background reconciliation agent merges, retires, and updates durable memories against evolving evidence instead of appending forever. Combined with the enrichment validators — knowledge-worthiness gates, grounded-quote requirements, trust-gated promotion — long-term memory stays an asset instead of becoming sediment.
The pipeline feeds the knowledge graph and context engine; Model Scout decides what it runs on.