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 import SDK with your LangSmith credentials. Uploads use a separate generatedClient, which reads TRAJECTORY_API_KEY from the environment by default:
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:Client() reads TRAJECTORY_API_KEY and TRAJECTORY_BASE_URL from the environment. Pass
api_key or base_url to the client explicitly to override either value.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.
Bring Your Own Data
Build trajectories without a provider — from CSV, JSONL, OpenAI, Anthropic, etc.
Telemetry Events
Push product telemetry from your app into Trajectory.
Linking Events to Trajectories
Correlate uploaded trajectories with telemetry via
trace_id.API Reference
Full function signatures and parameters.