---
title: "Classifiers"
description: "Fast typed decisions for triage, routing, tagging, and yes/no gates — no assistant turn."
updated: 2026-10-05
---

# Classifiers

Classifiers are named, versioned decision tools that answer structured questions in about **100 ms** without waking an assistant. Use them for triage, routing, tagging, severity scoring, and yes/no gates — anywhere you need a cheap, repeatable branch before (or instead of) a full model turn.

> **Note:** Classifiers are distinct from [Wrenches](https://docs.apexti.com/features/wrenches.md) (executable JavaScript) and from [Workflows](https://docs.apexti.com/features/workflows.md) (multi-step graphs). A workflow **classify** step *runs* a saved classifier; a wrench can call `runClassifier` / `runClassifierMany` at runtime.

## Why use classifiers?

| Without a classifier | With a classifier |
|---|---|
| An assistant turn reasons about every inbound item | A typed question returns a label, score, or yes/no in ~100 ms |
| Routing logic drifts as prompts change | Criteria and examples are versioned and testable |
| Expensive models do disposable triage | Fast decisions stay off the chat path |

Typical uses:

- Route tickets to billing vs. product vs. support
- Score severity (cosmetic → blocking)
- Gate whether a message should become a board task
- Suggest an assignee or priority before a human confirms

## Question types

Each classifier has one or more **questions**, keyed by id. Every **choice** question automatically includes an `uncertain` option.

| Type | What it returns | When to use it |
|---|---|---|
| `choice` | One labeled option (or `uncertain`) | Routing, tagging, disposition |
| `score` | An ordered severity / intensity band | Priority or impact ladders |
| `noul` | Yes / no style gate | Urgent?, spam?, actionable? |

Option criteria can be plain strings, or richer objects with `what`, `not_for`, and `examples` so the decision model knows clear boundaries.

## Create and manage classifiers

Use Toolbelt actions (via the `toolbelt` tool or Configure UI):

| Action | Purpose |
|---|---|
| `list_classifiers` | List classifiers on this assistant |
| `create_classifier` | Create a named classifier with questions (and optional examples) |
| `update_classifier` | Update metadata or create a new version |
| `delete_classifier` | Remove a classifier and its bindings |
| `test_classifier` | Run against stored gold examples, or classify a one-off `state` |

### Create example

```javascript
await toolbelt({
  action: "create_classifier",
  params: JSON.stringify({
    name: "ticket_triage",
    description: "Route inbound messages to the right team.",
    questions: JSON.stringify({
      department: {
        type: "choice",
        instructions: "Which team should own this?",
        criteria: {
          billing: { what: "Charges, refunds, seats", not_for: "Product defects", examples: ["Why was I charged twice?"] },
          sales: { what: "Pricing, demos, new accounts", not_for: "Support how-tos", examples: ["Can we schedule a demo?"] },
          support: { what: "How-to and account help", not_for: "Billing disputes", examples: ["How do I invite a teammate?"] }
        }
      }
    }),
    examples: JSON.stringify([
      { state: "Invoice looks wrong for March", expected: { department: "billing" } }
    ]),
    projectionSpec: JSON.stringify({ fields: ["subject", "body"], maxChars: 4000 })
  })
});
```

### Test before you wire it

```javascript
await toolbelt({
  action: "test_classifier",
  params: JSON.stringify({
    classifierId: "<classifier uuid>",
    state: "Login button does nothing on Safari"
  })
});
```

Omit `state` to score the classifier against its stored gold examples (matched / compared counts).

## Use in a workflow

Add a **classify** step (`type: "classify"`) and point it at the classifier:

```json
{
  "id": "triage",
  "type": "classify",
  "title": "Triage",
  "classifierId": "<classifier uuid>",
  "input": "trigger",
  "branchOn": "department",
  "defaultBranch": "review"
}
```

Wire one edge per option (plus a default) so unexpected answers still continue. See [Workflows](https://docs.apexti.com/features/workflows.md).

## Use in a wrench

Inside wrench code, call the runtime helpers (not `test_classifier`):

- `runClassifier(classifierId, state)` — classify one payload
- `runClassifierMany(classifierId, items)` — batch classify

Use `list_classifiers` first to get the exact `classifierId`.

## Versioning

Changing `questions`, `examples`, or `projectionSpec` creates a **new version**. Existing workflow / job bindings stay on their pinned version unless you pass `rebindAll: true` on `update_classifier`.

## Where classifiers show up

- **Configure / Assistant Design** — attach a classifier to a job with role `runs`, or scaffold one from the AI Job Planner (**Create Classifier**)
- **Workflows** — `classify` steps for branching
- **Wrenches** — `runClassifier` for inline gates before tool calls
