langsmith-trace
INVOKE THIS SKILL when working with LangSmith tracing OR querying traces. Covers adding tracing to applications and querying/exporting trace data. Uses the langsmith CLI tool.
Security Assessment
Detected risks:
About langsmith-trace
The langsmith-trace skill provides guidance for integrating LangSmith tracing into AI applications and querying trace data for debugging, monitoring, and analysis. It focuses on two core workflows: adding tracing instrumentation to applications and interacting with stored traces using the LangSmith CLI. The skill supports both Python and JavaScript environments and is designed to help developers capture execution flows, inspect LLM interactions, and analyze nested operations in AI pipelines. It also explains authentication requirements, environment variable configuration, and project selection for accessing the correct trace data.
The skill includes support for multiple tracing approaches depending on the application framework. For LangChain and LangGraph applications, tracing can be enabled automatically through environment variables. For non-LangChain applications, it documents how to use OpenTelemetry integrations when supported, or alternatively how to apply tracing manually using decorators and wrappers. Python examples use the `@traceable` decorator and `wrap_openai()` wrapper, while TypeScript examples use `traceable()` and `wrapOpenAI()`. The skill also demonstrates nested tracing patterns for multi-step AI pipelines such as retrieval-augmented generation workflows.
This skill is intended for AI engineers, backend developers, and platform teams building or maintaining LLM-powered systems. Common use cases include debugging prompt pipelines, monitoring application behavior, tracing model requests, inspecting retrieval workflows, and exporting trace data for analysis. It is especially useful for teams using LangChain, LangGraph, OpenAI integrations, or custom AI orchestration pipelines that require observability and operational debugging capabilities.
FAQ
How do I enable tracing for a LangChain or LangGraph application?
Set the required environment variables including `LANGSMITH_TRACING=true`, `LANGSMITH_API_KEY`, and your LLM provider API key. Tracing is automatic for LangChain and LangGraph applications once these variables are configured.
Can this skill be used with applications that do not use LangChain?
Yes. For frameworks with OpenTelemetry support, LangSmith's OpenTelemetry integration can be used. For custom applications or frameworks without automatic support, the skill documents how to use tracing decorators and wrappers manually.
What authentication methods are supported?
Authentication requires a LangSmith API key. You can either set the `LANGSMITH_API_KEY` environment variable or provide the `--api-key` flag directly when running LangSmith CLI commands.
Does the skill support both Python and JavaScript projects?
Yes. The documentation includes tracing examples for both Python and TypeScript/JavaScript implementations using the LangSmith tracing utilities and OpenAI wrappers.
What project configuration should be checked before querying traces?
You should check the `LANGSMITH_PROJECT` environment variable or `.env` configuration before querying traces to ensure you are interacting with the correct LangSmith project.
Install langsmith-trace
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
langchain-ai/langsmith-skills