Narrow down to specific traces by applying a filter via the UI, CLI, or API. Paste ready-made patterns from Common filters, or save a useful combination as a shared table view. When you don’t have an exact filter in mind, switch to deep search or Loop.Documentation Index
Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Apply a filter
- UI
- CLI
- API
Select Filter to open the filter menu:
- Basic: Point-and-click filtering for common fields.
- SQL: Write precise SQL queries with operators, functions, and full-text search. Use the Generate button to create queries from natural-language descriptions. See SQL best practices performance tips.
SQL queries on project logs enforce your plan’s data retention limit. Use a relative interval to stay within the window. See Plans and limits for retention details.
Common filters
Ready-to-use filter expressions for the most common log queries. Paste them directly into the SQL filter tab in the UI, or use them as the WHERE clause inbt sql or /btql API queries.
Filter by score
Filter by score
Filter by tag
Filter by tag
Filter errored runs
Filter errored runs
Filter by metadata
Filter by metadata
Search text fields
Search text fields
Use
search() to match across all text fields, or MATCH to target a single field. See Full-text search for details.Filter by time
Filter by time
Use a relative interval to stay within your plan’s data retention window.
Match traces across spans
Match traces across spans
When filtering traces, you often want to match against any span in the trace, not just the root. Wrap conditions in See Single span filters for nesting rules and the
ANY_SPAN(). For example, to find traces with both an LLM call and an error somewhere in the tree:is_root restriction.Braintrust applies
ANY_SPAN() automatically in:- The Basic filter tab when Display > Row type is set to Traces.
- Topics automation filters.
- Trace-scoped online scoring rule filters.
Save and share filters
Save a frequently-used combination of filters, display settings, and columns as a custom table view. Saved views appear in the menu at the top of the table and are visible to all project members. If you’ve built a useful view in one project, you can duplicate it to another project via the API.Ask questions with Loop
Select Loop on the Logs page to ask natural language questions about your traces. Loop understands your data structure and can answer questions, identify patterns, and surface specific traces without writing any queries. Example questions:- “Show me traces where the user was confused”
- “Find requests that took longer than usual”
- “What are the most common error patterns?”
Find traces with deep search
Deep search finds traces based on semantic similarity rather than keyword matching or exact filters. It’s useful for discovering patterns, sentiment, and edge cases that SQL filters would miss. For example, you can find traces where users expressed frustration, even if the word “frustrated” never appears. See Use deep search for detailed examples and workflows.Speed up log filtering
If you frequently filter on the same custom fields, you can index them to reduce query latency. Braintrust offers two options: A full-text index for broad search and subfield indexes for specific fields you filter on most.- Go to Settings > Advanced.
- Under Log search optimization, enable the toggle to build a full-text index that speeds up text-based filter queries.
-
Under Subfield indexing, click + Add subfield index for each field you filter on frequently.
Braintrust auto-discovers candidate fields from your data (e.g.,
metadata.session_id). If a field doesn’t appear, you can type it in directly. Subfield paths must start withinput,output,expected,metadata, orspan_attributes. - Click Save and index.
- Enter how many days back to backfill (default: 3) and click Save and backfill.
Next steps
- Use deep search for semantic queries
- Score online to evaluate filtered traces
- Create dashboards with filtered metrics
- Read the SQL reference for complete query syntax