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

# Lens

> See what users ask your agent. Lens groups production traffic into categories and tracks how the mix changes over time.

Lens discovers categories in your agent's production traffic and labels each session or trace. Use it to find which interactions to investigate. For example, a customer support agent's top categories might be order tracking, returns, and product questions.

## How Lens works

Lens uses two components to categorize your traffic:

* **Discovery agent:** Periodically analyzes traffic to identify categories and generate descriptions for them.
* **Labeling judge:** Assigns sessions or traces to a category. Records that don't match an existing category are labeled Unclassified.

As new traffic arrives, Lens continues to label records and discover new categories.

While [Signal](/docs/ax/observe/signal.md) identifies recurring failures, Lens helps you understand the types of interactions your agent handles.

## Enable Lens

Lens requires a tracing project with incoming traffic, project update permissions, and access to [managed agents](/docs/ax/agents/build-your-own-agent.md). See [Pricing and usage](/docs/ax/security-and-settings/pricing-and-usage.md) for availability.

1. Open your tracing project, select the **Signal & Agents** tab, and select **Lens** under **Managed agents**.

2. Click **Enable Lens**.

3. Configure the following settings:

   | Setting | Description |
   | - | - |
   | **Agent description** | Optional. Describe what your agent does to help Lens identify relevant categories. |
   | **Labeling unit** | Choose **Sessions** for multi-turn interactions or **Traces** for individual requests. This cannot be changed after enabling Lens. |
   | **Harness** | The harness that runs discovery. Defaults to Claude Code. |
   | **AI provider** | Required. The AI integration whose API key powers the harness, either Arize's or your own. |
   | **Trigger** | How often discovery runs, between 3 and 12 hours. Defaults to 3 hours. |
   | **Judge** | The required model used to assign categories to sessions or traces. |

4. Click **Enable Lens**.

![Enable Lens dialog with a project selector, an optional agent description for a customer support agent, Sessions or Traces as the labeling unit, and review settings with Claude Code as the harness and an AI provider integration selector](https://storage.googleapis.com/arize-assets/doc-images/lens/enable-lens.webp)

The Enable Lens dialog: project, labeling description and unit, and review settings.

You can also enable Lens from the **Managed Agents** page. The dialog adds a **Project** step, where you select a project that does not already have Lens enabled.

### When to expect results

The first discovery run can take a few hours. Once categories are discovered, Lens begins labeling your traffic.

New labels appear after the next scheduled discovery run, plus processing time. If no categories are found, Lens tries again on the next run.

You can pause or resume Lens from the page header or update your settings under **Configure Lens**. The labeling unit cannot be changed.

## Explore your categories

The Lens page shows labeled traffic from the last 30 days.

![Active Lens page for a tracing project showing 14 categories, a top category at 34.9 percent, 12 new categories this window, a daily share chart of 4,494 labeled sessions by category, and the Find and filter traces category selected with its share, 7-day change, session count, and description](https://storage.googleapis.com/arize-assets/doc-images/lens/lens-results-sessions.webp)

Lens results: metric tiles, the share of labeled sessions over time, and the ranked category list with a selected category's details.

| Metric | Description |
| - | - |
| **Categories** | Total number of discovered categories. |
| **Top category** | Percentage of labeled traffic belonging to the largest category. |
| **New this window** | Categories discovered in the last 30 days, excluding the initial set of categories. |

The share chart shows how the distribution of categories changes over time. Smaller categories may be grouped under **Other**. Unlabeled records are excluded from the chart.

Select a category to see its:

* Description
* Record count and share of traffic
* Recent changes in share
* Example sessions or traces

Click **View records** to explore all sessions or traces assigned to that category.

### Unclassified traffic

Sessions or traces that don't match an existing category are labeled Unclassified and included in the share chart.

Subsequent discovery runs may identify new categories that better represent this traffic.

## Use categories across Arize

Lens adds a `lens.category` attribute and labeling timestamp to each labeled record.

You can use the category attribute to:

* Filter sessions and traces using `lens.category = '<name>'`.
* Run evals on specific categories of traffic.
* Build dashboards to track categories over time.
* Include category labels in data exports.

## Troubleshooting

| Issue | What to check |
| - | - |
| Lens is missing under Signal & Agents | Confirm that managed agents are enabled for your account and your deployment supports sandboxes. |
| Enable Lens is disabled | Confirm that you have project update permissions. |
| Waiting for categories | Allow a few hours for the first discovery run. Confirm that traces are arriving and the automation is Active. |
| No categories found | Check your traffic volume and agent description. Lens retries on the next discovery run. |
| Categories exist but the chart is empty | Labeling may still be in progress, or there may be no labeled traffic in the current window. |
| Labeling failed | Check the judge under **Configure Lens** and wait for the next run. |
| High volume of Unclassified traffic | Refine your agent description and wait for the next discovery run. |

## Related documentation

* [Managed agents](/docs/ax/agents/build-your-own-agent.md)
* [Signal](/docs/ax/observe/signal.md)
* [Explore your traces](/docs/ax/observe/tracing/view-and-manage-traces.md)
* [Instrument your agent](/docs/ax/instrument/set-up-tracing.md)
* [Connect your AI provider](/docs/ax/agents/connect-your-ai-provider.md)
* [Pricing and usage](/docs/ax/security-and-settings/pricing-and-usage.md)
