> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Filter Options

> Filter and search traces using structured queries, time ranges, and view toggles.

Filter stored traces in the [AgentOS UI](https://os.agno.com/traces) using the filter bar, the date picker, and the Runs/Sessions view toggle.

## Construct Queries

The filter bar supports structured queries with autocomplete for field names, operators, and enum values.

![Filter bar showing autocomplete suggestions](https://mintcdn.com/agno-v2/YYvi4tppzLkCaS3K/images/traces-sql-filter.png?fit=max\&auto=format\&n=YYvi4tppzLkCaS3K\&q=85\&s=b5b50874c006cd7b6913b6ee33530367)

Filter bar with autocomplete suggestions

**Syntax:**

```
field operator value
```

### Fields

Fields are fetched dynamically and may vary. The defaults:

| Field | Type |
| - | - |
| `trace_id` | text |
| `run_id` | text |
| `session_id` | text |
| `name` | text |
| `status` | enum: `OK`, `ERROR` |
| `user_id` | text |
| `agent_id` | text |
| `team_id` | text |
| `workflow_id` | text |
| `created_at` | datetime |
| `start_time` | datetime |
| `end_time` | datetime |
| `duration_ms` | number |

### Operators

| Operator | Symbol | Works With |
| - | - | - |
| Equals | `=` | text, number, enum |
| Not equals | `!=` | text, number, enum |
| Greater than | `>` | number, datetime |
| Greater than or equal | `>=` | number, datetime |
| Less than | `<` | number, datetime |
| Less than or equal | `<=` | number, datetime |
| Contains | `contains` | text |
| Starts with | `startswith` | text |
| In (multiple values) | `in` | text, enum |

Operator support varies by field. `name` (Trace Name) supports `=`, `!=`, `contains`, and `startswith`, but not `in`.

### Combining Conditions

* `AND`: all conditions must match
* `OR`: any condition must match
* Operators and keywords are **case-insensitive** (`and`, `AND`, `And` all work)

### Examples

Single condition:

```
status = OK
```

```
session_id = 625185b5-6a7a-43bd-afae-339a989ea1cc
```

Text matching:

```
agent_id contains my-agent
```

```
agent_id startswith chatbot
```

Multiple conditions:

```
status = OK AND agent_id = my-agent
```

```
status in "ERROR" AND agent_id != "test-agent"
```

Mixed operators:

```
status = OK AND agent_id = my-agent OR team_id = my-team
```

## Time Filters

The date picker sits next to the filter bar.

![Date picker with preset and custom ranges](https://mintcdn.com/agno-v2/YYvi4tppzLkCaS3K/images/traces-date-filter.png?fit=max\&auto=format\&n=YYvi4tppzLkCaS3K\&q=85\&s=3bd0f9a508003002af6c513001197b45)

Date picker presets

| Preset |
| - |
| Last 30 minutes |
| Last 1 hour |
| Last 6 hours |
| Last 1 day |
| Last 7 days |
| All time |
| Custom (pick start and end dates) |

> [!NOTE]
>
> The filter bar and date picker are **mutually exclusive**. Applying a text filter clears the date range. Picking a date range clears the text filter.

## Views

Toggle between two views using the **Runs / Sessions** tab at the top right of the filter bar.

![Runs and Sessions view toggle](https://mintcdn.com/agno-v2/YYvi4tppzLkCaS3K/images/traces-view-filter.png?fit=max\&auto=format\&n=YYvi4tppzLkCaS3K\&q=85\&s=a219334bc1f94b63d5605762b6a98568)

Runs and Sessions view toggle

* **Runs**: individual trace executions
* **Sessions**: traces grouped by session


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.