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

# Datasets from an OpenClaw Agent

> Turn the agent's real turns into datasets: for training, annotation, or as benchmark material.

Traces are raw material for datasets. Any turn the connected agent handled ([Connect an OpenClaw Agent](/docs/agentspace/connect-openclaw-agent)) can become a dataset item; how to read those turns is on [Benchmark an OpenClaw Agent](/docs/agentspace/benchmark-openclaw-agent).

## Build a dataset from traces

On the **Traces** tab, select the turns you want (say, every `benchgen-chat` turn where the agent went wrong) and choose **Add to dataset**. Pick an existing dataset of this agent, or type a name (for example `failed-turns`) to create one.

<Frame caption="Three chat turns selected, with Add to dataset open and a new dataset being created">
  <img src="https://mintcdn.com/benchgen-8fc81371/oXzVpf1EVd5pntSt/images/agentspace/openclaw/06-traces-add-to-dataset.png?fit=max&auto=format&n=oXzVpf1EVd5pntSt&q=85&s=3c8596ff900093696e20464276cbfd51" alt="Three chat turns selected on the Traces tab with the Add to dataset dialog open" width="1440" height="900" data-path="images/agentspace/openclaw/06-traces-add-to-dataset.png" />
</Frame>

Each selected trace becomes one dataset item with the turn's input and output. The dataset is created in the agent's own project and catalogued in BenchGen at the same time, so it:

* appears under **Datasets** with its own URL, linking back to the traces it was built from;
* can be picked in the training form, the same as any dataset uploaded by hand or imported from HuggingFace.

<Frame caption="The Datasets page: a dataset built from traces carries a Traces badge">
  <img src="https://mintcdn.com/benchgen-8fc81371/oXzVpf1EVd5pntSt/images/agentspace/openclaw/09a-datasets-list.png?fit=max&auto=format&n=oXzVpf1EVd5pntSt&q=85&s=323c2f276a8139b2a2c795930045aee7" alt="The Datasets page with a trace-built dataset carrying a Traces badge" width="1440" height="900" data-path="images/agentspace/openclaw/09a-datasets-list.png" />
</Frame>

<Frame caption="The dataset's Data tab: one item per trace, with its source trace, input and expected output">
  <img src="https://mintcdn.com/benchgen-8fc81371/oXzVpf1EVd5pntSt/images/agentspace/openclaw/09b-dataset-data.png?fit=max&auto=format&n=oXzVpf1EVd5pntSt&q=85&s=c10074d8b36b23477b633f79b2890d8f" alt="The dataset's Data tab listing one item per trace" width="1440" height="900" data-path="images/agentspace/openclaw/09b-dataset-data.png" />
</Frame>

## Find an item's id and its source trace

The **Data** tab lists one row per item. The **Item id** column carries the id
the training form and the API refer to, and **Source trace** links the item
back to the trace it was made from; click it to open that trace in place, with
the same observation tree and input/output view as on the Traces tab.

<Frame caption="A dataset item's source trace opened straight from the Data tab">
  <img src="https://mintcdn.com/benchgen-8fc81371/oXzVpf1EVd5pntSt/images/agentspace/openclaw/09c-item-source-trace.png?fit=max&auto=format&n=oXzVpf1EVd5pntSt&q=85&s=0133eea3ecea6ba3613e18dc448305b8" alt="A dataset item's source trace opened from the Data tab" width="1440" height="900" data-path="images/agentspace/openclaw/09c-item-source-trace.png" />
</Frame>

Items are not copied anywhere else: the dataset in the agent's project is the one source of truth. Adding more traces later reports how many were **added**, **skipped** (already in the dataset) and **failed**.

For human review before training, **Add to annotation queue** puts the same selection into one of the agent's annotation queues.

## Next: fine-tune a model

<CardGroup cols={2}>
  <Card title="Add a Dataset" icon="database" href="/docs/train/add-a-dataset">
    Or bring in more data by uploading a file or importing from HuggingFace.
  </Card>

  <Card title="Fine-tune a Model" icon="sliders" href="/docs/train/fine-tune-a-model">
    Configure and launch a LoRA fine-tuning run on the dataset you just built.
  </Card>
</CardGroup>
