Prerequisites
- Python 3.11 or higher
- A LangSmith API key (starts with
lsv2_pt_...) - A LangSmith project with existing traces
Installation
Configure the SDK
Initialize the SDK with your LangSmith credentials and (optionally) a Trajectory API key for uploading:| Parameter | Required | Description |
|---|---|---|
project_id | Yes | Your LangSmith project ID |
workspace_id | No | LangSmith workspace UUID (required for bulk export) |
destination_id | No | Bulk export destination UUID (required for live bulk export) |
api_key | No | Reads from LANGSMITH_API_KEY / LANGCHAIN_API_KEY env var if omitted |
trajectory_api_key | No | Required for tj.upload(). Reads from TRAJECTORY_API_KEY env var if omitted |
Individual Import
List conversations, pick the ones you want, and import them:Bulk Import
Import all conversations from a project at once:Upload
After importing (either way), upload trajectories to the Trajectory platform:trajectory_api_key must be set in tj.init() (or via the TRAJECTORY_API_KEY env var) for upload to work.Save to Disk
If you prefer to save locally instead of uploading:Next Steps
Core Concepts
Learn what Trajectories, Steps, and Messages represent.
Bulk Export
Export all conversations from a project at once.
API Reference
Full function signatures and parameters.