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

# Patterns: monitor known behaviors

> Reusable classifiers that flag known behaviors, from built-in frustration and confusion to custom domain-specific signals.

Patterns answer a single question: **is behavior we already care about happening in production?**

Every conversational run is scanned against every enabled pattern. Matches show up on the pattern's detail page, feed into Insight Search and Recaps, and can trigger Slack alerts.

Patterns are for behaviors you already know to look for. For recurring errors you didn't know to look for, see [Failures](/analyze/failures).

## Built-in patterns

Three patterns are available out of the box and run automatically on conversational runs:

* **Frustration** — the user expresses annoyance, dissatisfaction, or negative sentiment toward the agent.
* **Confusion** — the user indicates they don't understand or are lost.
* **Task failure reported** — the user reports that the agent didn't complete their request correctly.

Built-in patterns cannot be edited or deleted.

## Custom patterns

Create your own patterns to monitor behaviors specific to your product. Custom patterns use AI-powered classification against a description and, optionally, labeled examples.

Ideas teams typically add:

* Competitor mentions
* Requests for missing functionality
* Escalation requests
* Compliance-relevant phrases
* Specific workflow behaviors, for example "user asked to cancel"
* Any domain-specific signal that matters to your team

### Creating a pattern

Open **Patterns** and click **Create pattern** to open the wizard.

<Steps>
  <Step title="Define the pattern">
    * **Pattern name** — human-readable, up to 50 characters. Example: `User asked for refund`.
    * **Pattern ID** — kebab-case identifier auto-generated from the name, up to 50 characters. Example: `user-asked-for-refund`.
    * **Description** — describe what the pattern detects, up to 350 characters. The more specific the description, the better the accuracy.

    **Trigger conditions** control which runs are scanned:

    * **When to check** — all runs (default), runs that use **any of** a set of tools, or runs that use **all of** a set of tools.
    * **Metadata filters** — up to 10 key/value filters restricting scans to matching runs.
  </Step>

  <Step title="Label examples (optional)">
    Improve accuracy by labeling recent runs as positive or negative examples.

    * Browse runs from the past 7 days.
    * For each run, mark it as **matches** (positive) or **does not match** (negative).
    * Up to 100 examples per pattern.
    * Filter runs by text search, run type, attributes, or metadata.
  </Step>

  <Step title="Configure alerts">
    * **Enable Slack alerts** — toggle notifications for this pattern.
    * **Select channels** — pick channels from your connected [Slack workspace](/integrations/slack).
    * **Alert frequency** — every detection, threshold-based (for example 5 detections in 60 minutes), or a daily digest.
  </Step>
</Steps>

<Note>
  When you create a pattern, it automatically scans recent historical runs for matches so you see results immediately.
</Note>

## Patterns list

The Patterns page shows every pattern (built-in and custom) with its current detection count. Use the search bar to filter by name.

## Pattern detail

Open any pattern to see the runs where it was detected. Each row includes:

* The detection confidence score
* Evidence explaining why the pattern matched
* A link into the full [trace](/investigate/traces)

For custom patterns, you can edit trigger conditions and alerts or delete the pattern.

## How patterns fit with the rest of the product

* **Failures** ([Failures](/analyze/failures)) surface recurring runtime errors from the execution itself. Patterns surface behaviors the classifier recognizes from the transcript and metadata.
* **Insight Search** ([Insight Search](/analyze/insight-search)) can be scoped to a pattern's runs to investigate root cause.
* **Recaps** ([Recaps](/analyze/recaps)) reference detected patterns in the trend and issue sections.
* **Slack** ([Slack](/integrations/slack)) delivers pattern alerts to subscribed channels, and the Slack bot can suggest new patterns based on what it sees.

## Limitations

* Patterns run on **conversational** runs only. Runs without `tcc.conversational: true` are excluded.
* Custom patterns are classifier-based. Accuracy depends on the description and labeled examples; use the labeling step for behaviors that are ambiguous from words alone.
* Trigger conditions are `AND` between tool filters and metadata filters. There is no OR-of-groups composition today.

## Related

<CardGroup cols={2}>
  <Card title="Failures" icon="triangle-exclamation" href="/analyze/failures">
    Recurring errors from execution, grouped automatically.
  </Card>

  <Card title="Insight Search" icon="comment-question" href="/analyze/insight-search">
    Investigate the runs a pattern is matching.
  </Card>

  <Card title="Slack" icon="slack" href="/integrations/slack">
    Deliver pattern alerts to channels.
  </Card>

  <Card title="Concepts" icon="cubes" href="/concepts">
    Runs, sessions, and conversational runs.
  </Card>
</CardGroup>
