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

from transformers import pipeline

clf = pipeline(
    "admesh-intent",
    model="admesh/agentic-intent-classifier",
    trust_remote_code=True,
)

out = clf("Which laptop should I buy for college?")
print(out["model_output"]["classification"]["intent"])
print(out["model_output"]["classification"]["iab_content"])
print(out["system_decision"]["policy"])

Architecture

The classifier uses a shared DistilBERT encoder with three linear classification heads trained via multitask learning, plus a separate IAB content classifier.
                     query_text

                   ┌─────┴─────┐
                   │ DistilBERT │  (shared encoder, single forward pass)
                   │  Encoder   │
                   └─────┬─────┘

              ┌──────────┼──────────┐
              ▼          ▼          ▼
        intent_type  intent_subtype  decision_phase
           head         head            head
              │          │              │
              ▼          ▼              ▼
         calibration  calibration  calibration
              │          │              │
              └──────────┼──────────────┘

                   ┌─────┴─────┐
                   │    IAB    │  (separate classifier + embedding index)
                   │ Classifier│
                   └─────┬─────┘

              ┌──────────┼──────────┐
              ▼          ▼          ▼
         commercial   fallback    policy
           score      logic       rules
              │          │          │
              └──────────┼──────────┘


              schema-validated envelope
        (model_output + system_decision + meta)

Heads

HeadBase ModelLabelsOutput
intent_typeDistilBERT (shared)10 labelsHigh-level intent classification
intent_subtypeDistilBERT (shared)18 labelsInteraction pattern
decision_phaseDistilBERT (shared)7 labelsCommercial funnel stage
iab_contentSeparate classifierFull IAB TSV pathsIAB Content Taxonomy 3.1 mapping (tier1–tier4)
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)

LabelDescription
informationalSeeking knowledge or understanding
exploratoryOpen-ended exploration without a specific goal
commercialEvaluating products, services, or solutions
transactionalReady to take a purchase or conversion action
supportSeeking help with an existing product or service
personal_reflectionIntrospective or emotional processing
creative_generationRequesting creative content production
chit_chatCasual conversation with no task goal
ambiguousIntent cannot be determined from context
prohibitedContent that violates safety or policy rules

intent.decision_phase (7 labels)

LabelDescription
awarenessFirst contact with a topic or need
researchActively gathering information
considerationEvaluating options and narrowing choices
decisionReady to choose or commit
actionExecuting the decision (purchase, signup, etc.)
post_purchaseAfter the transaction — review, setup, feedback
supportOngoing support for an existing relationship

intent.subtype (18 labels)

LabelDescription
educationLearning or understanding a concept
product_discoveryFinding new products or services
comparisonComparing alternatives side by side
evaluationAssessing a specific option in depth
deal_seekingLooking for promotions, discounts, or deals
provider_selectionChoosing a vendor or provider
signupCreating an account or starting a trial
purchaseBuying a product or subscribing
bookingReserving or scheduling a service
downloadDownloading software, content, or resources
contact_salesReaching out to a sales team
task_executionPerforming a specific operational task
onboarding_setupSetting up or configuring a product
troubleshootingDiagnosing and fixing issues
account_helpAccount access, settings, or management
billing_helpBilling, invoicing, or payment issues
follow_upContinuing a previous conversation thread
emotional_reflectionProcessing feelings or experiences

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:
{
  "model_output": {
    "classification": {
      "iab_content": {
        "taxonomy": "IAB Content Taxonomy",
        "taxonomy_version": "3.1",
        "tier1": { "id": "52", "label": "Business and Finance" },
        "tier2": { "id": "53", "label": "Business" },
        "tier3": { "id": "72", "label": "Business I.T." },
        "mapping_mode": "nearest_equivalent",
        "mapping_confidence": 0.93
      },
      "intent": {
        "type": "commercial",
        "subtype": "comparison",
        "decision_phase": "decision",
        "confidence": 0.87,
        "commercial_score": 0.92,
        "summary": "User is evaluating CRM tools for a small team.",
        "component_confidence": {
          "intent_type": {
            "label": "commercial",
            "confidence": 0.91,
            "raw_confidence": 0.88,
            "confidence_threshold": 0.6,
            "calibrated": true,
            "meets_threshold": true
          },
          "intent_subtype": {
            "label": "comparison",
            "confidence": 0.85,
            "raw_confidence": 0.82,
            "confidence_threshold": 0.5,
            "calibrated": true,
            "meets_threshold": true
          },
          "decision_phase": {
            "label": "decision",
            "confidence": 0.89,
            "raw_confidence": 0.86,
            "confidence_threshold": 0.5,
            "calibrated": true,
            "meets_threshold": true
          },
          "overall_strategy": "min_required_component_confidence"
        }
      }
    }
  },
  "system_decision": {
    "policy": {
      "monetization_eligibility": "allowed",
      "eligibility_reason": "commercial_score_above_threshold",
      "decision_basis": "score_threshold",
      "applied_thresholds": {
        "commercial_score_min": 0.7,
        "intent_type_confidence_min": 0.6,
        "intent_subtype_confidence_min": 0.5,
        "decision_phase_confidence_min": 0.5
      },
      "sensitivity": "low",
      "regulated_vertical": false
    },
    "opportunity": {
      "type": "comparison_slot",
      "strength": "high"
    },
    "intent_trajectory": ["decision"]
  },
  "meta": {
    "system_version": "0.9.0",
    "calibration_enabled": true,
    "iab_mapping_is_placeholder": false
  }
}

meta block

FieldTypeDescription
system_versionstringClassifier version
calibration_enabledbooleanWhether any head used calibrated confidence
iab_mapping_is_placeholderbooleanWhether IAB mapping used placeholder fallback

component_confidence

Per-head confidence details are included inside model_output.classification.intent.component_confidence. Each head reports:
FieldTypeDescription
labelstringPredicted label
confidencenumberCalibrated confidence (0.01.0)
raw_confidencenumberPre-calibration confidence
confidence_thresholdnumberMinimum threshold for this head
calibratedbooleanWhether calibration artifacts were applied
meets_thresholdbooleanWhether confidence meets the threshold

API

The classifier exposes a local HTTP API via demo_api.py:

POST /classify

Request:
{ "text": "best CRM for small teams" }
Response: Full classification envelope (see Output Envelope above).

GET /health

Returns head readiness and calibration status:
{
  "status": "ok",
  "system_version": "0.9.0",
  "heads": [
    { "head": "intent_type", "model_path": "...", "calibration_path": "...", "ready": true, "calibrated": true },
    { "head": "intent_subtype", "model_path": "...", "calibration_path": "...", "ready": true, "calibrated": true },
    { "head": "decision_phase", "model_path": "...", "calibration_path": "...", "ready": true, "calibrated": true },
    { "head": "iab_content", "model_path": "...", "calibration_path": "...", "ready": true, "calibrated": true }
  ]
}

GET /version

{
  "system_version": "0.9.0",
  "api_schema_version": "2026-03-22"
}

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:
ModeWho runs the classifierHow it connects
Operator-derivedThe operator runs the classifier on interaction.input.query_textOperator uses the classifier output to populate policy and drive auction decisions
Platform-derivedThe platform runs the classifier locally and sends provided_signalsOperator validates the signals via signal_validation and may normalize scores
The classifier output envelope (model_output + system_decision) maps directly to the structures in the platform request policy block and the signals.intent block.