Overview
The Agentic Intent Classifier is a multi-head query classification stack for conversational traffic. It is the reference implementation that produces the Agentic Intent Taxonomy decision envelope used throughout the AIP protocol. Given a single user query, the classifier runs three neural classification heads in a single forward pass, resolves IAB content taxonomy via a local embedding index, applies calibration, computes a commercial score, evaluates fallback and policy rules, and emits a schema-validated combined envelope containingmodel_output, system_decision, and meta.
Source: agentic-intent-classifier
Hugging Face: admesh/agentic-intent-classifier
Quickstart
Architecture
The classifier uses a shared DistilBERT encoder with three linear classification heads trained via multitask learning, plus a separate IAB content classifier.Heads
The three multitask heads share a single encoder and run in one forward pass. The IAB head runs separately with its own classifier and a local embedding index over taxonomy nodes for retrieval-based reranking.
Taxonomy Labels
intent.type (10 labels)
intent.decision_phase (7 labels)
intent.subtype (18 labels)
iab_content
IAB content mapping is derived from every row in the IAB Content Taxonomy 3.1 TSV. The classifier supports tier1 through tier4 with mapping_mode (exact, nearest_equivalent, internal_extension) and mapping_confidence.
Inference Pipeline
Theclassify_query function is the single entry-point for classification:
-
Multitask forward pass — Runs the shared DistilBERT encoder once. Decodes logits for all three heads (
intent_type,intent_subtype,decision_phase) via calibrated argmax. - Confidence calibration — Each head applies per-label calibration artifacts (when available) to produce calibrated confidence scores with threshold gating.
-
Commercial score — Computed from
intent_type,decision_phase, andsubtypeusing a deterministic heuristic. -
IAB content resolution — Runs a separate supervised classifier over full taxonomy paths. Uses a local embedding index for taxonomy-node retrieval and reranking. Outputs
tier1–tier4withmapping_modeandmapping_confidence. -
Fallback evaluation — If any head falls below its confidence threshold, fallback metadata is produced with
reason(confidence_below_threshold,ambiguous_query,policy_default) and safe defaults. -
Policy and opportunity — Applies
commercial_scorethresholds, sensitivity rules, and regulated-vertical checks to producemonetization_eligibilityandopportunitytype/strength. - Schema validation — The full envelope is validated against the response schema before returning.
Output Envelope
The classifier produces the Agentic Intent Taxonomy envelope with an additionalmeta block:
meta block
component_confidence
Per-head confidence details are included inside model_output.classification.intent.component_confidence. Each head reports:
API
The classifier exposes a local HTTP API viademo_api.py:
POST /classify
Request:
GET /health
Returns head readiness and calibration status:
GET /version
What The Classifier Does
- Runs three classifier heads (
intent_type,intent_subtype,decision_phase) via a shared multitask DistilBERT encoder - Resolves
iab_contentthrough a local embedding index over taxonomy nodes plus label/path reranking - Applies calibration artifacts when present
- Computes
commercial_scorefrom intent type, decision phase, and subtype - Applies fallback when confidence is too weak or policy-safe blocking is required
- Emits a schema-validated combined envelope conforming to the Agentic Intent Taxonomy
What The Classifier Does Not Do
- It is not a multi-turn memory system
- It is not a production-optimized low-latency serving path (use the operator’s Groq-based classifier for production latency targets)
- It is not yet trained on large real-traffic human-labeled intent data
- Combined decision logic is heuristic, though materially stronger than rule-based baselines
Relationship to PlatformRequest
In the AIP protocol, the classifier can be used in two ways depending on the classification input mode:
The classifier output envelope (
model_output + system_decision) maps directly to the structures in the platform request policy block and the signals.intent block.
Related
- Agentic Intent Taxonomy — The decision envelope schema this classifier produces
- Platform Request — How classification feeds into the platform request
- Hugging Face Model — Hosted model for quick testing