Skip to main content

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.

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.

Apply a filter

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.
When viewing traces (set in Display > Row type), Basic filter conditions match across spans automatically.
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 in bt sql or /btql API queries.
scores.Factuality > 0.8
tags MATCH "error"
error IS NOT NULL
metadata.user_id = "user-123"
Use search() to match across all text fields, or MATCH to target a single field. See Full-text search for details.
search('timeout')
Use a relative interval to stay within your plan’s data retention window.
created > now() - interval 1 day
When filtering traces, you often want to match against any span in the trace, not just the root. Wrap conditions in ANY_SPAN(). For example, to find traces with both an LLM call and an error somewhere in the tree:
ANY_SPAN(span_attributes.type = 'llm') AND ANY_SPAN(error IS NOT NULL)
See Single span filters for nesting rules and the is_root restriction.
Braintrust applies ANY_SPAN() automatically in:

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?”
You can also select one or more rows and use Find similar traces. Loop identifies common traits across the selected traces and returns semantically similar ones. Loop is also available when viewing an individual trace. Ask questions like “Summarize this trace” or “Why did this request fail?” See Analyze logs and Analyze individual traces for more details. 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.
  1. Go to Settings > Advanced.
  2. Under Log search optimization, enable the toggle to build a full-text index that speeds up text-based filter queries.
  3. 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 with input, output, expected, metadata, or span_attributes.
  4. Click Save and index.
  5. Enter how many days back to backfill (default: 3) and click Save and backfill.
The Index status section shows backfill progress as indexing runs in the background.
Use search() in SQL filters to query all text fields at once. It gets automatic bloom filter acceleration when log search optimization is on.

Next steps