Text Classification
Automatically sort and label input text into categories using AI, with customizable options for categories, models, and classification types.

Component description
How the Text Classification component works
Classification Component
The Classification component is designed to perform text classification, sorting incoming text into one or more user-defined categories. This is particularly useful in AI workflows where automatic categorization, routing, or labeling of incoming messages or documents is required.
What the Component Does
At its core, this component takes an input text and classifies it according to a set of categories and their optional descriptions. It supports integration with conversational history and allows customization of the classification logic using various configuration options. The component is model-agnostic and can leverage any compatible language model, including lightweight models, making it flexible and efficient for a variety of use cases.
Key Inputs
Input Name | Type | Required | Description |
---|---|---|---|
Input Text | Message | Yes | The main text to be classified. |
Chat History | InMemoryChatMessageHistory | No | Previous conversation messages to provide context and improve classification accuracy. |
LLM (Model) | BaseChatModel | No | Specifies which large language model to use for the classification. |
Categories | Data (Nested Dict) | Yes | A dictionary of category names and optional descriptions to define what the text should be classified into. |
Classification Type | Dropdown (str) | Yes | Choose how many categories can be selected: One or More, Zero or More, One Only, Zero or One. |
Custom System Message | Message | No | An optional system prompt to further guide the classification model’s behavior. |
Tool Description | str (multiline) | No | A description for the tool, helpful when used within agent frameworks. |
Tool Name | str | No | Optional, for referencing this tool in agent-based workflows. |
Verbose | bool | No | Option to enable verbose output for debugging or transparency. |
Notable Features
- Chat History Integration: By incorporating chat history, the component can classify text with greater context, increasing precision in multi-turn conversations.
- Configurable Classification Type: Supports flexible classification logic, allowing single or multiple categories per input as per workflow needs.
- Customizable Prompts: Advanced users can add system messages to tweak or fine-tune the classification prompt.
- Model Flexibility: Works with a range of language models, including smaller/faster models.
Outputs
Output Name | Type | Description |
---|---|---|
Categories | Message | The resulting classification(s) for the input text. |
Tool | Tool | The classification tool instance, for integration in agent workflows. |
Example Use Cases
- Customer Support: Automatically categorize incoming support tickets or chat messages to route them to the correct department.
- Content Moderation: Classify user-generated content into safe, spam, or flagged categories.
- Document Management: Organize documents or emails by topic or department.
- Conversational AI: Provide context-aware responses by classifying user intent based on conversation history.
Why Use This Component?
This component streamlines the process of integrating robust text classification into your AI workflows. Its flexibility, context-awareness, and support for both basic and advanced configuration make it a valuable building block for automation, analytics, and conversational AI systems. Whether you need simple keyword-based categorization or nuanced, context-rich intent detection, this component can be tailored to your requirements.
Examples of flow templates using Text Classification component
To help you get started quickly, we have prepared several example flow templates that demonstrate how to use the Text Classification component effectively. These templates showcase different use cases and best practices, making it easier for you to understand and implement the component in your own projects.
Frequently asked questions
- What does the Text Classification component do?
It analyzes input text and assigns it to one or more categories you define, using an AI model for accurate, automated classification.
- Can I define my own categories?
Yes, you can set custom categories and descriptions to tailor classification for your specific workflow needs.
- Does it support context from previous messages?
Yes, you can enable chat history input to improve the accuracy of classification by considering prior conversation context.
- What models can be used for classification?
You can select from various language models, including small or large LLMs, depending on your accuracy and speed requirements.
- Is it possible to control how many categories are assigned?
Yes, you can specify whether the classification should return one, multiple, or no categories at all for each input.
Try FlowHunt Text Classification
Experience fast and reliable AI-powered text categorization in your automations with FlowHunt's Text Classification component.