langsmith-trace
Add tracing to LangChain/LangGraph apps and query trace data via CLI for debugging and dataset generation.
- Automatic tracing for LangChain/LangGraph apps with environment variables; manual tracing via
@traceabledecorator andwrap_openai()for other frameworks in Python and TypeScript - Query traces (complete execution trees) or runs (individual nodes) using
langsmithCLI with filters for time, latency, errors, tags, and custom metadata - Export traces to JSONL files preserving hierarchy; supports bulk export for dataset creation and performance analysis
- Manage datasets, examples, evaluators, experiments, and conversation threads through dedicated CLI command groups
LANGSMITH_API_KEY=lsv2_pt_your_api_key_here # REQUIRED
LANGSMITH_PROJECT=your-project-name # Optional: default project
LANGSMITH_WORKSPACE_ID=your-workspace-id # Optional: for org-scoped keys
Authentication is REQUIRED: either set the LANGSMITH_API_KEY environment variable, or pass the --api-key flag to CLI commands (preferred):
langsmith trace list --project my-project --api-key $LANGSMITH_API_KEY
IMPORTANT: Always check the environment variables or .env file for LANGSMITH_PROJECT before querying or interacting with LangSmith. This tells you which project contains the relevant traces and data. If the LangSmith project is not available, use your best judgement to identify the right one.
More from langchain-ai/langsmith-skills
langsmith-evaluator
INVOKE THIS SKILL when building evaluation pipelines for LangSmith. Covers three core components: (1) Creating Evaluators - LLM-as-Judge, custom code; (2) Defining Run Functions - how to capture outputs and trajectories from your agent; (3) Running Evaluations - locally with evaluate() or auto-run via LangSmith. Uses the langsmith CLI tool.
1.7Klangsmith-dataset
INVOKE THIS SKILL when creating evaluation datasets, uploading datasets to LangSmith, or managing existing datasets. Covers dataset types (final_response, single_step, trajectory, RAG), CLI management commands, SDK-based creation, and example management. Uses the langsmith CLI tool.
1.7K