All guides

Export data from LangSmith

Export LangSmith runs with the SDK or bulk export, then prepare selected examples for Lunary.

$20 per user / month. Payment required to activate your workspace.

Preserve the raw archive, validate its run relationships, and import selected examples as a separate dataset.

Small archive

Use SDK list_runs with a fixed project and time window.

Large archive

Check eligibility for bulk export to S3-compatible storage.

Moving to Lunary

Map examples explicitly and instrument new traffic separately.

Export options

Export data from LangSmith: at a glance
Source informationPreserve in archiveUse during migration
Run, trace, and parent IDsOriginal valuesReconstruct relationships and retain provenance
Inputs and outputsOriginal approved payloadExplicitly select dataset input and observed output
Feedback and scoresScore name, value, and associated runReview before treating a score as ground truth
Model and prompt contextIdentifiers, version, and parameters when presentExplain differences when replaying a case
Times and costSource values and unitsCompare equivalent request windows

1. Set the archive scope

Record the project, environment, start time, exclusive end time and filters. Include child runs if you need complete traces.

  • Preserve run, trace and parent IDs plus timestamps.
  • Handle prompts, datasets, scores and permissions separately.
  • Use a new file for each window to avoid duplicate appends.

2. Export a sample

Configure the LangSmith credentials and endpoint, then set ARCHIVE_PROJECT. This JSONL example includes child runs and applies the upper date boundary locally; it is not a resumable whole-history exporter.

Example
import json
import os
from datetime import datetime, timezone
from langsmith import Client

start = datetime(2026, 9, 1, tzinfo=timezone.utc)
end = datetime(2026, 9, 2, tzinfo=timezone.utc)
client = Client()
count = 0

# Exclusive creation protects an existing archive from replacement.
with open("langsmith-sample.jsonl", "x", encoding="utf-8") as archive:
    for run in client.list_runs(
        project_name=os.environ["ARCHIVE_PROJECT"],
        start_time=start,
    ):
        if not start <= run.start_time < end:
            continue
        archive.write(json.dumps(run.dict(), default=str) + "\n")
        count += 1

print(f"Archived {count} runs; reconcile with the source project.")

3. Scale with bulk export

Eligible accounts can export Parquet to S3-compatible storage. Check plan and signup-date requirements, set a fixed interval, and wait for the job’s completed status.

4. Validate and prepare the import

Reconcile unique run IDs against the source filters and inspect a nested failure. Keep checksums and the query beside the archive.

  • Record parents outside the export window.
  • Map selected inputs and expected outputs to Lunary’s CSV/JSONL dataset format.
  • Retain a dataset-row-to-source-ID map; raw LangSmith runs are not native Lunary traces.

Questions & answers

Will this migrate the entire LangSmith project into Lunary?

No. It creates an archive and outlines a controlled move. Prompts, evaluation objects, permissions, and native trace history need separate handling.

Why can exported run counts differ from trace counts?

A trace can contain multiple runs. Compare the same unit, filters, time boundaries, and root-versus-child selection in both places.

Does a failed model output belong in ground truth?

No. Keep the observed output distinct from the expected correct behavior. Have the relevant reviewer approve reference answers.

By Lunary · Documentation reviewed Sep 16, 2026

Sources & methodology (5)

Based on vendor documentation, not an independent benchmark or hands-on rating. Features and plans can change.

Build with Lunary.

Trace, evaluate, and improve your AI applications.

$20 per user / month. Payment required to activate your workspace.