The built-in facets (Task, Sentiment, Issues) cover general patterns, but most products have domain-specific signals worth tracking. Custom facets let you define your own extractors with a preprocessor, prompt, and optional exclusion regex.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.
Custom facets require Pro or Enterprise plans. The built-in facets are available on all plans.
When to create a custom facet
Create a custom facet when the built-ins don’t capture the patterns you need:- Domain-specific categories: Your logs have patterns that built-in facets don’t capture.
- Too many uncategorized traces: The built-ins aren’t extracting relevant summaries.
- Wrong level of detail: You need more specific categorization (e.g., distinguish between different API endpoints instead of just “API request”).
- Business-specific needs: Track patterns unique to your product (e.g., “Feature requests,” “Pricing questions,” “Integration issues”).
Create a facet
- Go to the Topics page and click + Facet.
-
Give your facet a name and description. The name cannot be changed after creation. Example:
- “Churn risk”
- “Facet for assessing customer churn risk based on conversations”
-
Choose a preprocessor to transform your trace data.
- Select Preprocessor > Thread (default) to format traces as conversation threads.
-
Or select + Custom preprocessor to write a JavaScript function that filters or transforms your data. Common patterns:
-
Enter a prompt with clear instructions for what to extract. Example:
-
Optionally, enter a case-insensitive regex to exclude facet outputs from topic generation. For example, if the facet output is
'NONE', a regex of'^NONE'will exclude it from being used in topic generation. - Click Test to verify extraction quality on sample traces.
-
Choose whether to Apply to existing traces or only to new traces.
This option triggers processing across all automated facets, not just this one. Logs already processed for a given facet are skipped.
- Click Create.
Manage facets
- Go to the Topics page.
- Find the facet’s card and select an action:
- Pause or Resume — Click the Active toggle in the card header and confirm in the dialog.
-
Edit facet — In the ellipsis menu, select Edit facet. The facet panel opens on the Logs page where you can update the preprocessor, prompt, or exclusion pattern. To reprocess existing logs with the updated definition, enable Apply to existing traces before saving.
This option triggers processing across all automated facets, not just this one. Logs already processed for a given facet are skipped.
- Delete facet — In the ellipsis menu, select Delete facet. Built-in facets (Task, Sentiment, Issues) cannot be deleted.
Common issues
Poor topic quality
Poor topic quality
Too many uncategorized traces: Topics may be too specific for your data. Try adjusting the automation filter to include a broader range of traces, or use a more targeted prompt when creating a facet.Topics too generic: Refine the facet prompt to extract more specific summaries, such as distinguishing between different task subtypes.Summaries too similar: If the facet produces nearly identical summaries, clustering can’t differentiate well. Review sample summaries and adjust the prompt to capture more variation.
Next steps
- Iterate on facet output using the Signals tab on individual traces.
- Rewind history to reprocess past traces after changing a facet prompt.
- Build datasets from logs classified by your new facet.