AgentLoops
AI Nodes

Classifier

Classify text into custom categories using AI.

Classifier

The Classifier node uses AI to categorize text into predefined categories. Define your categories with descriptions, and the AI will analyze the input and assign the most appropriate category.

Overview

Use the Classifier node when you need to:

  • Categorize customer support tickets
  • Sort emails by type or priority
  • Route content to appropriate handlers
  • Tag or label text content automatically

Configuration

FieldTypeRequiredDescription
modelstringYesThe AI model to use for classification.
categoriesarrayYesList of categories to classify into. Must have at least one category.
includeJustificationbooleanNoWhen enabled, returns an explanation for why the category was chosen. Default: false.

Category Configuration

Each category in the categories array has the following properties:

PropertyTypeRequiredDescription
idstringYesUnique identifier for the category (auto-generated).
namestringYesThe category name (e.g., "bug_report", "feature_request").
descriptionstringYesDescription of what content belongs in this category.

Loop Mode

The Classifier node supports Loop Mode for batch classification:

FieldTypeDefaultDescription
loopModebooleanfalseEnable to classify each item in an array input separately.
maxIterationsnumber100Maximum number of iterations when loop mode is enabled.
concurrencynumber1Number of parallel classifications.
onErrorstring"stop"Error handling: "stop" or "continue".

Inputs

The Classifier node accepts inputs from connected upstream nodes. All connected inputs are automatically concatenated and analyzed together.

Output

VariableTypeDescription
categorystringThe name of the assigned category.
justificationstring(Optional) Explanation for the classification. Only present when includeJustification is enabled.

Example Use Cases

Support Ticket Classification

Categories:

NameDescription
bug_reportUser is reporting a bug, error, or unexpected behavior in the product
feature_requestUser is requesting a new feature or enhancement
billing_inquiryQuestions about billing, payments, subscriptions, or pricing
general_questionGeneral questions about how to use the product
account_issueProblems with account access, login, or settings

Input:

I've been charged twice for my subscription this month. Can you help me get a refund?

Output:

{
  "category": "billing_inquiry",
  "justification": "The user is reporting a duplicate charge and requesting a refund, which is a billing-related issue."
}

Content Moderation

Categories:

NameDescription
appropriateContent is suitable and follows community guidelines
spamContent is promotional, repetitive, or unsolicited advertising
offensiveContent contains inappropriate language or harmful material
off_topicContent is unrelated to the discussion or platform purpose

Email Priority Classification

Categories:

NameDescription
urgentTime-sensitive matters requiring immediate attention
highImportant items that should be addressed within 24 hours
normalRegular correspondence with standard response time
lowInformational or FYI emails that don't require action

Best Practices

  1. Write detailed category descriptions: The AI relies on descriptions to understand the boundaries between categories. Be specific about what belongs (and doesn't belong) in each category.

  2. Use mutually exclusive categories: Avoid overlap between categories to improve classification accuracy.

  3. Keep category names simple: Use clear, lowercase names with underscores (e.g., feature_request not Feature Request!!!).

  4. Enable justification for debugging: When building or testing your workflow, enable includeJustification to understand why classifications are made.

  5. Consider edge cases: Include categories for unclear or borderline content (e.g., "other" or "needs_review").

  6. Test with diverse inputs: Verify classification works correctly with various input formats and edge cases.

On this page