Categorizer Agent
The Categorizer is the most flexible classification agent on the platform. It accepts any combination of inputs -- documents, emails, extracted entities, conversations, or plain text -- via the named inputs system, and assigns one of your defined categories. Each category becomes a separate branch on the GWE canvas.
If you're unsure which categorizer to use, start here. The Categorizer handles the widest range of input types and is the recommended choice for new workflows.
Use Cases
- You need to route a workflow based on the content of any input -- documents, emails, extracted entities, or custom data.
- You want a single agent that handles both deterministic rule matching and LLM-based classification.
- You need to classify based on multiple inputs at once (e.g., both an email body and its extracted metadata).
- You need multi-level categorization (chain multiple Categorizer agents for hierarchical classification).
Inputs
The Categorizer uses named inputs, meaning you can wire any combination of data from upstream agents. Common inputs include:
| Named Input | Type | Description |
|---|---|---|
Text | Text | Plain text to classify. |
Document | Document | A document to classify. |
Email | An email message to classify. | |
Conversation | Conversation | A chat conversation to classify. |
Entities | JSON | Extracted entities or structured data to classify. |
You can provide multiple named inputs simultaneously. The agent considers all of them when making its classification decision.
Outputs
| Output | Type | Description |
|---|---|---|
category | Category | The assigned category name. |
Each defined category also produces a branch edge on the GWE canvas. Only the matching branch executes.
Configurations
| Parameter | Description | Default |
|---|---|---|
| Categories | List of categories. Each has a name, description (up to 1,000 characters), optional example queries, and optional qualification criteria. | Required |
| Fallback category | Category used when no match is found. Defaults to "Fallback" and cannot be changed once set. | Required |
| Categorization instructions | Custom guidance for the LLM (e.g., "Prioritize the email subject over the body" or "Treat anything mentioning 'urgent' as high priority"). | "Use all the inputs available and categorize into the most appropriate category." |
| Process entire document | When a document is provided as input, controls whether the full document is sent to the LLM or just the relevant snippets. | Off |
| Qualification criteria | Deterministic rules per category. Requires a JSON Extractor agent connected upstream to supply structured data. | None |
Configuring Categories
Each category supports:
- Name -- a unique, descriptive label. Cannot be changed after creation.
- Description -- tells the LLM when this category applies. Up to 1,000 characters. Be specific about the criteria.
- Example queries -- sample inputs that belong to this category. Helps the agent recognize similar inputs. No duplicates allowed.
- Qualification criteria -- deterministic rules evaluated before the LLM. If a rule matches, the category is assigned immediately without LLM evaluation. Rules require structured data from an upstream JSON Extractor.
A category description is optional if qualification criteria are provided (since the rules handle classification), but recommended for clarity.
How Classification Works
- Qualification criteria: If rules are configured, they are evaluated first. A matching rule assigns the category immediately.
- LLM classification: If no rule matches, the agent sends all named inputs to the LLM along with your category descriptions and instructions.
- Fallback: If the LLM cannot confidently assign a category, the fallback category is used.
How to Use This Agent
Categorize inbound emails by department:
email_trigger -> categorizer
-> [sales] -> sales_workflow
-> [support] -> support_workflow
-> [hr] -> hr_workflow
-> [other] -> general_workflow
Tips
- Wire all relevant context as named inputs. The more information the agent has, the better it classifies. For example, wire both the email body and extracted entities from a JSON Extractor.
- Use qualification criteria for deterministic routing. If a structured field reliably determines the category (e.g., a "department" field from extracted data), add it as a rule. This is faster and more predictable than LLM classification.
- Keep categories mutually exclusive. Overlapping descriptions lead to inconsistent results. If two categories are similar, add distinguishing criteria in the description.
- Enable "Process entire document" only when the full document content matters for classification. For large documents, leaving it off reduces latency and cost.
Related Agents
- Categorize Conversations and Route -- specialized for chat conversations with multi-intent detection and human collaboration.
- Document Categorizer -- deprecated; use the Categorizer with document named inputs instead.
- Text Categorizer -- simpler text-only classification (v0, deprecated).