Setup
- Python
- TypeScript
If you are using a service API key (e.g. for CI/CD or multi-project setups), you must also set the
LANGWATCH_PROJECT_ID environment variable (or pass project_id/projectId to the SDK) so the SDK knows which project to access. You can find the project ID in your project settings.List Datasets
Retrieve all datasets for your project with pagination support.- Python
- TypeScript
Create a Dataset
Create a new dataset with an optional column schema.- Python
- TypeScript
Get a Dataset
Fetch a dataset by slug or ID, including all its entries.- Python
- TypeScript
Update a Dataset
Update a dataset’s name or column types.- Python
- TypeScript
Delete a Dataset
Archive a dataset by slug or ID.- Python
- TypeScript
List Records
Retrieve records from a dataset with pagination.- Python
- TypeScript
Create Records
Batch-add records to an existing dataset.- Python
- TypeScript
Update a Record
Update (or upsert) a single record by ID.- Python
- TypeScript
Delete Records
Batch-delete records by their IDs.- Python
- TypeScript
Upload a File
Upload a CSV, JSON, or JSONL file to a dataset. If the dataset does not exist, it is created automatically.- Python
- TypeScript
if_exists parameter controls how conflicts are handled:Using with Evaluations
Datasets are commonly used to run offline evaluations against your LLM or agent.- Python
- TypeScript
Dataset Entry Structure
Each dataset entry contains:Typed Datasets (TypeScript)
You can define types for your dataset entries for better type safety:MCP Tools (AI Coding Agents)
If you’re using an AI coding agent (Claude Code, Cursor, etc.) with the LangWatch MCP server, dataset tools are available directly:
The
platform_list_datasets and platform_get_dataset tools support a format parameter, use "json" for raw data or "digest" (default) for AI-readable markdown.
Finding Your Dataset Slug
You can find the dataset slug in the LangWatch UI:- Go to the Datasets page
- Click on your dataset
- The slug is shown in the URL:
app.langwatch.ai/{project}/datasets/{slug}
dataset_) which is shown in the dataset details.