Why use datasets
Datasets in Braintrust have key advantages:- Integrated: Use directly in evaluations, explore in playgrounds, and populate from production.
- Versioned: Every change is tracked, so experiments can pin to specific versions.
- Scalable: Stored in a modern data warehouse without storage or performance limits.
- Secure: Self-hosted deployments keep data in your warehouse.
Create datasets
- UI
- SDK
Upload CSV
The fastest way to create a dataset is uploading a CSV file:
Records with an
id key are automatically deduplicated by their id value.Generate with Loop
Ask Loop to create a dataset based on your logs or specific criteria:
- “Generate a dataset from the highest-scoring examples in this experiment”
- “Create a dataset with the most common inputs in the logs”
Add records manually
Once you’ve created a dataset, add or edit records directly in the UI:
Dataset structure
Each record has three top-level fields:- input: Data to recreate the example in your application (required).
- expected: Ideal output or ground truth (optional but recommended for evaluation).
- metadata: Key-value pairs for filtering and grouping (optional).
View and edit datasets

- Filter and search records
- Create custom columns to extract nested values
- Edit records inline
- Copy records between datasets
- Delete individual records or entire datasets
Create custom columns
Extract values from records using custom columns. Use SQL expressions to surface important fields directly in the table.Label datasets
Configure categorical fields to allow reviewers to rapidly label records. This requires first configuring human review in your project’s Configuration tab.
Define schemas
Dataset schemas let you define JSON schemas forinput, expected, and metadata fields. Schemas enable:
- Validation: Ensure records conform to your structure.
- Form-based editing: Edit records with intuitive forms instead of raw JSON.
Infer from data
Automatically generate schemas from existing data:- Open the schema editor for a field.
- Click Infer schema.
- The schema generates from the first 100 records.
Enable enforcement
Toggle Enforce in the schema editor to validate all records. When enabled:- New records must conform or show validation errors.
- Existing non-conforming records display warnings.
- Form editing validates input automatically.
Enforcement is UI-only and doesn’t affect SDK inserts or updates.
Read and filter datasets
- SDK
- UI
Read datasets with the same method used to create them:
Filter with BTQL
Use_internal_btql to filter, sort, and limit records:Track performance
Monitor how dataset rows perform across experiments:View experiment runs
See all experiments that used a dataset:- Go to your dataset page.
- In the right panel, select Runs.
- Review performance metrics across experiments.

Analyze per-row performance
See how individual rows perform:- Select a row in the dataset table.
- In the right panel, select Runs.
- Review the row’s metrics across experiments.
This view only shows experiments that set the
origin field in eval traces.
- Consistently low scores suggest ambiguous expectations.
- Failures across experiments indicate edge cases.
- High variance suggests instability.
Multimodal datasets
You can store and process images and other file types in your datasets. There are several ways to use files in Braintrust:- Image URLs (most performant) - Keep datasets lightweight with external image references.
- Base64 (least performant) - Encode images directly in records.
- Attachments (easiest to manage) - Store files directly in Braintrust.
- External attachments - Reference files in your own object stores.
Use in evaluations
Pass datasets directly toEval():
Next steps
- Configure human review to label datasets.
- Run evaluations using your datasets.
- Use the Loop to generate and optimize datasets.
- Read the SQL reference for advanced filtering.