Skip to content

Commit 67c7efa

Browse files
committed
add agent traces docs
1 parent 64dc522 commit 67c7efa

4 files changed

Lines changed: 61 additions & 16 deletions

File tree

docs/hub/_toctree.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@
292292
sections:
293293
- local: datasets-cell-editing
294294
title: Editing Datasets
295+
- local: datasets-agent-traces
296+
title: Agent Traces
295297
- local: datasets-viewer-configure
296298
title: Configure the Dataset Viewer
297299
sections:

docs/hub/data-studio.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ You can search for a word in the dataset by typing it in the search bar at the t
2727

2828
## Run SQL queries on the dataset
2929

30-
You can run SQL queries on the dataset in the browser using the SQL Console. This feature also leverages our [auto-conversion to Parquet](data-studio#access-the-parquet-files).
30+
You can run SQL queries on the dataset in the browser using the SQL Console. This feature also leverages our [auto-conversion to Parquet](data-studio#access-the-parquet-files).
3131

3232
<div class="flex justify-center">
3333
<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/sql-ai.png" />
3434
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/sql-ai-dark.png"/>
3535
</div>
3636

37-
For more information see our guide on [SQL Console](./datasets-viewer-sql-console).
37+
For more information see our guide on [SQL Console](./datasets-viewer-sql-console).
3838

3939
## Share a specific row
4040

@@ -45,6 +45,10 @@ You can share a specific row by clicking on it, and then copying the URL in the
4545
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/datastudio-row-dark.png"/>
4646
</div>
4747

48+
## Agent traces
49+
50+
Drop raw JSONL traces from tools like Claude Code, Codex, or Pi into a dataset (or a [Storage Bucket](./storage-buckets)), and Data Studio swaps the default table view for a dedicated trace viewer for stepping through sessions, turns, tool calls, and model responses. See [Agent Traces](./datasets-agent-traces) for supported agents and viewing traces.
51+
4852
## Large scale datasets
4953

5054
The Dataset Viewer supports large scale datasets, but depending on the data format it may only show the first 5GB of the dataset:
@@ -101,12 +105,12 @@ You can specify which files to display in the Dataset Viewer by adding a YAML co
101105
```yaml
102106
---
103107
configs:
104-
- config_name: default
105-
data_files:
106-
- split: train
107-
path: "data.csv"
108-
- split: test
109-
path: "holdout.csv"
108+
- config_name: default
109+
data_files:
110+
- split: train
111+
path: "data.csv"
112+
- split: test
113+
path: "holdout.csv"
110114
---
111115
```
112116

@@ -115,14 +119,14 @@ You can also select multiple files per split or use glob patterns:
115119
```yaml
116120
---
117121
configs:
118-
- config_name: default
119-
data_files:
120-
- split: train
121-
path:
122-
- "data/train_part1.csv"
123-
- "data/train_part2.csv"
124-
- split: test
125-
path: "data/*.csv"
122+
- config_name: default
123+
data_files:
124+
- split: train
125+
path:
126+
- "data/train_part1.csv"
127+
- "data/train_part2.csv"
128+
- split: test
129+
path: "data/*.csv"
126130
---
127131
```
128132

docs/hub/datasets-agent-traces.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Agent traces
2+
3+
<div class="flex justify-center">
4+
<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/datasets/agent-traces-preview-light.webp" alt="Agent trace preview on a dataset page in light mode."/>
5+
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/datasets/agent-traces-preview-dark.webp" alt="Agent trace preview on a dataset page in dark mode."/>
6+
</div>
7+
8+
Agent traces from Claude Code, Codex, and Pi Agent are natively supported on the Hugging Face Hub. Upload the raw JSONL sessions to a dataset or a [Storage Bucket](./storage-buckets) and Data Studio opens them in a dedicated trace viewer.
9+
10+
## Find your traces
11+
12+
Each supported agent writes JSONL sessions to a known directory:
13+
14+
| Agent | Local session directory |
15+
| ----------- | ----------------------- |
16+
| Claude Code | `~/.claude/projects` |
17+
| Codex | `~/.codex/sessions` |
18+
| Pi | `~/.pi/agent/sessions` |
19+
20+
These trace files are supported out of the box, so you can upload them without modifying or converting them first.
21+
22+
<Tip>
23+
24+
The easiest way to upload is to ask your agent itself: point it at the directory above and tell it to upload the `.jsonl` files to a Hub dataset or bucket.
25+
26+
Buckets are especially useful if you want to keep syncing traces as new sessions land.
27+
28+
</Tip>
29+
30+
## View your traces
31+
32+
Once you have traces in a dataset or bucket, open them in Data Studio and click a row. The trace viewer shows the session timeline, prompts, assistant messages, tool calls, and results.
33+
34+
<div class="flex justify-center">
35+
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/datasets/agent-traces-session.webp" alt="Agent trace session viewer showing user and assistant turns with expanded tool calls."/>
36+
</div>
37+
38+
For a public example, open [`TeichAI/DeepSeek-v4-Pro-Agent`](https://huggingface.co/datasets/TeichAI/DeepSeek-v4-Pro-Agent). You can also browse more datasets tagged as [`traces`](https://huggingface.co/datasets?format=format%3Aagent-traces).

docs/hub/datasets.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ This documentation focuses on the datasets functionality in the Hugging Face Hub
1313
- [Downloading Datasets](./datasets-downloading)
1414
- [Libraries](./datasets-libraries)
1515
- [Dataset Viewer](./datasets-viewer)
16+
- [Agent Traces](./datasets-agent-traces)
1617
- [Data files Configuration](./datasets-data-files-configuration)

0 commit comments

Comments
 (0)