Skip to main content
Use bulk import when you have a large project and want to process conversations from an export file rather than making individual API calls.

Prerequisites

pip install "trajectory-sdk[parquet]"
This adds pyarrow for reading Parquet files.

Export from LangSmith

  1. Go to your project in LangSmith
  2. Export your project data as a Parquet file
  3. Save the file locally

Import

import trajectory_sdk as tj

tj.init(
    provider="langsmith",
    api_key="lsv2_pt_...",
    project_id="your-project-id",
)

trajectories = tj.import_conversations(
    bulk=True,
    source="./langsmith_export.parquet",
)

print(f"Imported {len(trajectories)} trajectories")
tj.save(trajectories, "./exports")