> ## Documentation Index
> Fetch the complete documentation index at: https://langwatch.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.

# Threads in datasets

> Add whole conversations to a dataset, one row per thread, with every trace of the thread in one column.

A thread is the set of traces that share a `thread_id` in their metadata: one conversation, one row. Use it when the evaluation needs the whole conversation, for example to check whether the user's problem was resolved by the end.

## Add threads to a dataset

**1. Give the dataset a column for the traces**

Open the dataset, click **Edit columns**, and add a column of type `json`, for example `traces`. Keep a `string` column for `thread_id` if you want it in the row.

**2. Select the traces**

Open the [Trace Explorer](https://app.langwatch.ai/@project/traces), select traces from the
conversations you want, and click **Add to dataset**. You do not need to select every trace of a
conversation; LangWatch pulls the rest of each thread in the next step.

**3. Switch the mapping to Thread**

In the **Add to Dataset** drawer, click **Thread** under **Mapping**. A badge shows how many traces the selected threads hold. Map the `traces` column to the **traces** source and pick the fields to keep per trace; **input** and **output** are selected by default. Map `thread_id` to **thread\_id**. The **traces** source also fits a `string` column, which then holds the JSON list as text.

![The Add to Dataset drawer with the mapping on Thread, the 4 traces badge, the traces source keeping input and output per trace, and Full Thread (AI-Readable) mapped onto a second column](https://mintcdn.com/langwatch/b_7qlc4BhHkq6ZDw/images/datasets/add-to-dataset-thread.png?fit=max\&auto=format\&n=b_7qlc4BhHkq6ZDw\&q=85\&s=0688a95d75f3d0f181664657d9bed147)

**4. Add the rows**

Check the **Preview**, then click **Add N rows to dataset**. Each row is one thread; the `traces` cell is a JSON list with one object per trace.

A source named **Full Thread (AI-Readable)** is also available. It renders the whole conversation as text for an LLM judge to read.

Traces without a `thread_id` are grouped into one row named `no_thread`.

**Also check:** [Thread-level online evaluation](https://langwatch.ai/docs/evaluations/online-evaluation/setup-monitors.md#evaluate-whole-threads) to score conversations on production traffic, and [Datasets](https://langwatch.ai/docs/datasets/overview.md) for the trace mapping.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.