Skip to main content

Prerequisites

  • pip install trajectory-sdk
  • A LangSmith API key (starts with lsv2_pt_...)
  • A LangSmith project ID with existing traces

Walkthrough

You can also save to disk instead of (or in addition to) uploading:
Each conversation becomes one JSON file in ./exports/, named by conversation ID.

Import by ID

If you already know which conversations you want:

LangSmith Notes

  • Conversations are identified by conversation_id or session_id in run metadata. Runs without either are treated as standalone conversations.
  • Roles are normalized: humanuser, aiassistant.
  • API responses are cached in-memory for 5 minutes to reduce load on repeated imports.