Categorize Conversations and Route Agent
The Categorize Conversations and Route agent classifies incoming chat conversations into user-defined categories and routes the workflow down the corresponding branch. It combines deterministic rule-based filtering with LLM classification for flexibility and accuracy.
Formerly known as the Intent Classifier.
Use Cases
- A chat-based AI Employee needs to handle multiple types of requests (e.g., billing questions, technical support, general inquiries).
- You want to route conversations to different workflow branches based on intent.
- You need both deterministic keyword matching and LLM-based classification.
- You want to let the end user choose when a message could match multiple categories.
Inputs
| Input | Type | Description |
|---|---|---|
chat_conversation | Conversation | The chat conversation to classify. The agent considers the most recent messages (see context window below). |
Outputs
| Output | Type | Description |
|---|---|---|
category | Category | The assigned category name. |
Each category becomes a named output edge on the GWE canvas, enabling direct branching.
Configurations
| Parameter | Description | Default |
|---|---|---|
| Categories | List of category definitions. Each category has a name, description (up to 1,000 characters), and optional example queries and qualification criteria. | Required |
| Fallback category | Category assigned when no rule matches and the LLM cannot confidently classify the message. Defaults to "Fallback" and cannot be changed once set. | "Fallback" |
| Context window | Number of recent messages the agent considers when classifying. Older messages are ignored. | 10 |
| Human collaboration | When enabled, if the agent detects multiple matching categories, it presents the end user with buttons to choose the correct one instead of guessing. | Off |
| Additional instructions | Custom guidance for the LLM classifier (e.g., "Treat refund requests as billing, not complaints"). | None |
Configuring Categories
Each category in the list supports:
- Name -- a clear, descriptive label (e.g., "Billing", "Technical Support"). Must be unique within the agent.
- Description -- tells the LLM when to assign this category (up to 1,000 characters). Be specific: "Questions about invoices, charges, payment methods, or subscription billing" is better than "Billing stuff".
- Example queries -- sample messages that belong to this category. These help the agent match similar messages, and on exact match the agent assigns the category instantly without calling the LLM.
- Qualification criteria -- deterministic rules that force a category assignment without LLM evaluation. Requires a JSON Extractor agent connected upstream to supply structured data for rule evaluation.
How Classification Works
- Exact match check: If the user's message exactly matches an example query, that category is assigned immediately.
- Qualification criteria: If rules are configured and structured data is available from an upstream JSON Extractor, the rules are evaluated. A match assigns the category without calling the LLM.
- LLM classification: If no deterministic match occurs, the agent sends the recent conversation (limited by context window) to the LLM along with your category descriptions and instructions.
- Multi-intent handling: If the LLM detects the message could match multiple categories and human collaboration is enabled, the end user sees clickable buttons to choose. Otherwise, the agent picks the best match.
- Fallback: If no category matches, the fallback category is assigned.
How to Use This Agent
A customer service AI Employee with three intents:
chat_trigger -> categorize_conversations_and_route
-> [billing] -> search_billing_kb -> respond -> workflow_output
-> [technical] -> search_tech_kb -> respond -> workflow_output
-> [other] -> general_respond -> workflow_output
Tips
- Write detailed category descriptions. The LLM relies on these to distinguish between categories. Vague descriptions lead to misclassification.
- Add example queries for high-volume, unambiguous intents. Exact matches bypass the LLM entirely, reducing latency and cost.
- Enable human collaboration for workflows where getting the category wrong is costly (e.g., routing a complaint to sales). The small friction of asking the user to click a button is worth the accuracy gain.
- Use qualification criteria when you have structured data (from a JSON Extractor) that reliably determines the category -- for example, routing based on a ticket priority field or customer tier.
- Keep the context window at 10 unless your conversations are unusually long. More context means higher LLM cost and can introduce noise from earlier, unrelated parts of the conversation.
Related Agents
- Categorizer -- more flexible categorization that works with any input type, not just conversations.
- Text Categorizer -- categorizes plain text rather than conversation objects.