> ## Documentation Index
> Fetch the complete documentation index at: https://docs.duckie.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Intent, Tagging, and Routing

> Classify support tickets and turn the classification into deterministic routing

Intent classification should interpret the customer's message. Routing should apply the support team's rules. Keeping those responsibilities separate makes the system easier to test, audit, and improve.

## What It Does

The intent, tagging, and routing function:

* Reads the normalized ticket and customer context bundle
* Classifies the primary intent and secondary topics
* Identifies product area, urgency, sentiment, language, and missing information
* Applies allowed categories, attributes, and helpdesk tags
* Calculates priority and SLA risk
* Routes the ticket to the right queue, owner, response workflow, or specialist team
* Escalates when confidence is low or the routing consequence is sensitive

## Recommended Components

| Need                              | Duckie component                     |
| --------------------------------- | ------------------------------------ |
| Interpret customer language       | Autonomous triage classifier agent   |
| Restrict tags to allowed values   | Workflow branch logic and categories |
| Calculate priority and SLA        | Routing workflow                     |
| Write tags and assignment         | Helpdesk app tools or custom tools   |
| Track confidence and routing path | Attributes and analytics             |
| Review low-confidence cases       | Slack escalation agent               |

## Flow

```mermaid theme={null}
flowchart TD
  Context["Ticket and customer context"]
  Context --> Classifier["Intent and tag classifier agent"]
  Classifier --> Output["Structured classification"]
  Output --> Confidence{"Confidence threshold met?"}
  Confidence -->|No| Escalate["Slack triage review"]
  Confidence -->|Yes| Validate["Validate allowed tags"]
  Escalate --> Reviewer["Reviewer decision"]
  Reviewer --> Validate
  Validate --> Priority["Priority and SLA workflow"]
  Priority --> Route["Routing workflow"]
  Route --> Writeback["Write tags, attributes, queue, and owner"]
  Writeback --> Runs["Runs and analytics"]
```

## Suggested Taxonomy

Start small. A useful first taxonomy usually has broad intent, product area, urgency, and route dimensions.

| Dimension               | Example values                                                                                                        |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------- |
| **Intent**              | access issue, billing question, bug report, how-to question, feature request, cancellation, complaint, account change |
| **Product area**        | account, authentication, billing, dashboard, integration, notifications, API, mobile, data import                     |
| **Urgency**             | low, normal, high, critical                                                                                           |
| **Sentiment**           | neutral, confused, frustrated, angry, positive                                                                        |
| **Customer segment**    | enterprise, business, self-serve, trial, partner                                                                      |
| **Route**               | tier 1, billing support, technical support, account management, engineering triage, trust and safety                  |
| **Missing information** | no account match, unclear product area, missing screenshot, missing order ID, missing reproduction steps              |

<Tip>
  Avoid overfitting the first taxonomy. If reviewers cannot consistently explain the difference between two tags, start with one broader tag and split it after you have run data.
</Tip>

## Classifier Output Contract

Have the classifier return structured output. The routing workflow can then validate values and apply rules.

```json theme={null}
{
  "primary_intent": "access issue",
  "secondary_topics": ["authentication", "workspace permissions"],
  "product_area": "account",
  "urgency": "high",
  "sentiment": "frustrated",
  "missing_information": [],
  "recommended_route": "technical support",
  "confidence": 0.86,
  "reasoning_summary": "Requester can log in but cannot access a workspace after a permission change."
}
```

## Routing Rules

Keep routing rules deterministic after classification.

| Rule                                    | Example action                                                               |
| --------------------------------------- | ---------------------------------------------------------------------------- |
| Low confidence                          | Send to Slack triage review before writing assignment.                       |
| Known incident match                    | Tag as incident-related and route to incident macro or response workflow.    |
| Priority customer and high urgency      | Assign to priority queue and set elevated SLA.                               |
| Billing intent                          | Route to billing support unless account risk or refund approval is required. |
| Bug report with reproduction details    | Route to technical support or engineering triage.                            |
| Bug report without reproduction details | Ask for missing details before routing to engineering.                       |
| Angry sentiment and repeated contact    | Add management-review attribute or route to senior support.                  |

## Helpdesk Writeback

Common writebacks include:

* Tags
* Category or custom fields
* Priority
* SLA policy
* Queue or group
* Assignee
* Internal summary note
* Missing-information request
* Link to the Duckie run

<Info>
  Start with internal notes and shadow tags. Turn on assignment and priority writebacks only after replay testing and human review show that the routing rules are reliable.
</Info>

## Related Docs

<CardGroup cols={2}>
  <Card title="Categories" icon="folder" href="/tagging/categories">
    Define the allowed classification categories.
  </Card>

  <Card title="Attributes" icon="tags" href="/tagging/attributes">
    Track confidence, urgency, SLA risk, and route.
  </Card>

  <Card title="Autonomous Agents" icon="wand-magic-sparkles" href="/agents/autonomous-agents">
    Configure the triage classifier agent.
  </Card>

  <Card title="Workflows" icon="diagram-project" href="/workflows/overview">
    Apply deterministic routing and writeback logic.
  </Card>
</CardGroup>
