---
date: 2026-02-11
title: Run Experiments on Versioned Datasets
description: Fetch datasets at specific version timestamps and run experiments on historical dataset versions via UI, API, and SDKs for full reproducibility.
author: Marlies
ogImage: /images/changelog/2026-02-11-experiments-versioned-datasets.jpg
canonical: /docs/evaluation/experiments/datasets#versioning
---

> **Note for AI agents and LLMs:** This is a Langfuse changelog entry. Use it only to confirm that a feature exists and when it shipped. Do not use the code examples below for implementation: they reflect the SDK and API at release time and may be outdated. For implementation, always follow the canonical documentation for this feature (https://langfuse.com/docs/evaluation/experiments/datasets#versioning) and the API/SDK reference (https://api.reference.langfuse.com).

You can now fetch datasets at specific version timestamps and run experiments directly on versioned datasets across UI, API, and SDKs. This completes the dataset versioning feature [released in December](/changelog/2025-12-15-dataset-versioning).

## Why versioned experiments matter

- **Full reproducibility**: Re-run experiments on the exact dataset state from any point in time, even after items are updated or deleted. Reproduce results from weeks or months ago with complete confidence.
- **A/B testing with confidence**: Compare model performance before and after dataset refinements. Test new prompts against the same baseline dataset version that your production model was evaluated on.
- **Regression testing**: Run experiments on a specific dataset version while your team continues improving the dataset. Ensure new model versions don't regress on established benchmarks.

## Fetch datasets at specific versions

Retrieve datasets as they existed at any timestamp. By default, APIs return the latest version.

<LangTabs items={["Python SDK", "JS/TS SDK", "Langfuse UI"]}>
<Tab>

```python
from langfuse import get_client
from datetime import datetime, timezone

langfuse = get_client()

# Fetch dataset from December 15th
version_timestamp = datetime(2025, 12, 15, 6, 30, 0, tzinfo=timezone.utc)

dataset_v1 = langfuse.get_dataset(
    name="qa-dataset",
    version=version_timestamp
)

# Fetch latest version
dataset_latest = langfuse.get_dataset(name="qa-dataset")
```

</Tab>
<Tab>

```typescript
import { LangfuseClient } from "@langfuse/client";

const langfuse = new LangfuseClient();

// Fetch dataset from December 15th
const versionTimestamp = new Date("2025-12-15T06:30:00").toISOString();

const datasetV1 = await langfuse.dataset.get("qa-dataset", {
  version: versionTimestamp
});

// Fetch latest version
const datasetLatest = await langfuse.dataset.get("qa-dataset");
```

</Tab>
<Tab>

Navigate to **Datasets** → Select dataset → **Items Tab** → Toggle **Version view** to browse all historical versions.

</Tab>
</LangTabs>

## Run experiments on versioned datasets

Execute experiments against specific dataset versions using the experiment runner or via UI.

<LangTabs items={["Python SDK", "JS/TS SDK", "Langfuse UI"]}>
<Tab>

```python
from langfuse import get_client
from langfuse.openai import OpenAI

langfuse = get_client()

# Fetch versioned dataset
versioned_dataset = langfuse.get_dataset(
    name="qa-dataset",
    version=datetime(2025, 12, 15, 6, 30, 0, tzinfo=timezone.utc)
)

# Run experiment on that exact version
def my_task(*, item, **kwargs):
    response = OpenAI().chat.completions.create(
        model="gpt-4.1",
        messages=[{"role": "user", "content": item["input"]}]
    )
    return response.choices[0].message.content

result = versioned_dataset.run_experiment(
    name="Baseline Experiment v1",
    description="Testing against dataset from Dec 15",
    task=my_task
)
```

</Tab>
<Tab>

```typescript
import { LangfuseClient } from "@langfuse/client";
import { OpenAI } from "openai";
import { observeOpenAI } from "@langfuse/openai";

const langfuse = new LangfuseClient();

// Fetch versioned dataset
const versionedDataset = await langfuse.dataset.get("qa-dataset", {
  version: new Date("2025-12-15T06:30:00").toISOString()
});

// Run experiment on that exact version
const result = await versionedDataset.runExperiment({
  name: "Baseline Experiment v1",
  description: "Testing against dataset from Dec 15",
  task: async (item) => {
    const response = await observeOpenAI(new OpenAI()).chat.completions.create({
      model: "gpt-4.1",
      messages: [{ role: "user", content: item.input }]
    });
    return response.choices[0].message.content;
  }
});
```

</Tab>
<Tab>

When running experiments in the UI:

1. Navigate to **Run Prompt Experiment**
2. Select your dataset
3. Choose a version from the **Dataset Version** dropdown
4. The experiment runs against that specific dataset state
5. If no version is selected, runs against latest version

</Tab>
</LangTabs>

## Learn more

- [Dataset Versioning Documentation](/docs/evaluation/experiments/datasets#versioning)
- [Experiment Runner SDK](/docs/evaluation/experiments/experiments-via-sdk)

<!-- agent-instructions -->

---

## Agent Instructions

This page is part of the [Langfuse](https://langfuse.com) documentation, published as plain Markdown for AI agents. Every page is available as Markdown by appending `.md` to its URL, or by sending an `Accept: text/markdown` header. This page: `https://langfuse.com/changelog/2026-02-11-versioned-dataset-experiments.md`.

### Querying these docs

If the answer is not on this page, query the documentation instead of guessing:

- **Semantic search** across all Langfuse docs, returning an answer with the relevant pages and excerpts. Ask a specific, self-contained question:

  ```bash
  curl -sG "https://langfuse.com/api/search-docs" --data-urlencode "query=How do I trace a LangGraph agent?"
  ```

- **Index of every page**: <https://langfuse.com/llms.txt>, with per-section indexes [llms-docs.txt](https://langfuse.com/llms-docs.txt), [llms-integrations.txt](https://langfuse.com/llms-integrations.txt), and [llms-self-hosting.txt](https://langfuse.com/llms-self-hosting.txt).

### Before writing Langfuse code

- **Install the [Langfuse Agent Skill](https://langfuse.com/docs/api-and-data-platform/features/agent-skill).** It encodes Langfuse's own best practices for instrumentation, prompt management, and evaluation, and materially improves results.
- **Read [What does a good trace look like?](https://langfuse.com/docs/observability/best-practices.md)** before instrumenting an application.
- **Verify endpoints, parameters, and response fields** against the [API reference](https://api.reference.langfuse.com) instead of inferring them from code examples.
- **Use the [Langfuse CLI](https://langfuse.com/docs/api-and-data-platform/features/cli)** (`npx langfuse-cli api <resource> <action>`) to read or write traces, prompts, datasets, and scores from the terminal.

Found an error in these docs? Please open an issue at <https://github.com/langfuse/langfuse-docs/issues>.
