Skip to main content

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 containing model_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

The classify_query function is the single entry-point for classification:
  1. Multitask forward pass — Runs the shared DistilBERT encoder once. Decodes logits for all three heads (intent_type, intent_subtype, decision_phase) via calibrated argmax.
  2. Confidence calibration — Each head applies per-label calibration artifacts (when available) to produce calibrated confidence scores with threshold gating.
  3. Commercial score — Computed from intent_type, decision_phase, and subtype using a deterministic heuristic.
  4. IAB content resolution — Runs a separate supervised classifier over full taxonomy paths. Uses a local embedding index for taxonomy-node retrieval and reranking. Outputs tier1tier4 with mapping_mode and mapping_confidence.
  5. 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.
  6. Policy and opportunity — Applies commercial_score thresholds, sensitivity rules, and regulated-vertical checks to produce monetization_eligibility and opportunity type/strength.
  7. 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 additional meta 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 via demo_api.py:

POST /classify

Request:
Response: Full classification envelope (see Output Envelope above).

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_content through a local embedding index over taxonomy nodes plus label/path reranking
  • Applies calibration artifacts when present
  • Computes commercial_score from 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.