Skip to main content
You can manage datasets from LangWatch using the SDK, MCP tools, or REST API for offline evaluations and automated workflows.

Setup

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.

Create a Dataset

Create a new dataset with an optional column schema.

Get a Dataset

Fetch a dataset by slug or ID, including all its entries.

Update a Dataset

Update a dataset’s name or column types.

Delete a Dataset

Archive a dataset by slug or ID.

List Records

Retrieve records from a dataset with pagination.

Create Records

Batch-add records to an existing dataset.

Update a Record

Update (or upsert) a single record by ID.

Delete Records

Batch-delete records by their IDs.

Upload a File

Upload a CSV, JSON, or JSONL file to a dataset. If the dataset does not exist, it is created automatically.
The if_exists parameter controls how conflicts are handled:

Using with Evaluations

Datasets are commonly used to run offline evaluations against your LLM or agent.

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:
  1. Go to the Datasets page
  2. Click on your dataset
  3. The slug is shown in the URL: app.langwatch.ai/{project}/datasets/{slug}
You can also use the dataset ID (starting with dataset_) which is shown in the dataset details.