langsmith

$npx mdskill add langchain-ai/docs/langsmith

Trace, evaluate, and deploy AI agents and LLM apps with LangSmith

  • Solve issues with tracing, debugging, and evaluating AI agent behavior
  • Uses LangChain, LangGraph, Deep Agents, and other compatible frameworks
  • Analyzes LLM outputs and agent steps to provide evaluation and monitoring insights
  • Delivers results via dashboards, alerts, and deployment tools for production use

SKILL.md

.github/skills/langsmithView on GitHub ↗
---
name: langsmith
description: Trace, evaluate, and deploy AI agents and LLM applications with LangSmith. Use when adding observability, running evaluations, engineering prompts, or deploying agents to production.
license: MIT
compatibility: Framework-agnostic. Works with LangChain, LangGraph, Deep Agents, OpenAI Agents SDK, CrewAI, Pydantic AI, and more.
metadata:
  author: langchain-ai
  version: "1.0"
---

# LangSmith

LangSmith is a framework-agnostic platform for building, debugging, and deploying AI agents and LLM applications. Trace requests, evaluate outputs, test prompts, and manage deployments all in one place at [smith.langchain.com](https://smith.langchain.com).

## When to use

Use LangSmith when you need to:
- **Trace and debug** LLM calls, agent steps, retrieval, and tool use
- **Evaluate** LLM outputs with automated or human-in-the-loop scoring
- **Engineer prompts** with a visual playground and version control
- **Deploy agents** to production with the LangGraph-based agent server
- **Monitor** production systems with dashboards, alerts, and cost tracking

## When NOT to use

- To build agent logic or LLM pipelines, use [LangChain](https://docs.langchain.com/oss/langchain/overview), [LangGraph](https://docs.langchain.com/oss/langgraph/overview), or [Deep Agents](https://docs.langchain.com/oss/deepagents/overview) instead
- LangSmith is the **platform layer** that complements these frameworks

## Quick setup

Set two environment variables to enable tracing from any supported framework:

```bash
export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY="your-api-key"  # from smith.langchain.com/settings
```

### Install the SDK

```bash
# Python
pip install langsmith

# JavaScript/TypeScript
npm install langsmith
```

### Verify tracing

```python
from langsmith import traceable

@traceable
def my_function(query: str) -> str:
    # Your LLM logic here—all calls inside are traced automatically
    return "result"
```

## Core capabilities

| Capability | Description |
|-----------|-------------|
| Observability | Trace every step of your LLM app with automatic or manual instrumentation |
| Evaluation | Run evaluations with code, LLM-as-judge, or composite evaluators |
| Prompt engineering | Create, version, and test prompts in a visual playground |
| Agent deployment | Deploy LangGraph agents with streaming, human-in-the-loop, and durable execution |
| Monitoring | Dashboards, alerts, and cost tracking for production workloads |

## Key documentation

- [Overview](https://docs.langchain.com/langsmith/observability)—Get started with LangSmith
- [Observability quickstart](https://docs.langchain.com/langsmith/observability-quickstart)—Add tracing in minutes
- [Evaluation quickstart](https://docs.langchain.com/langsmith/evaluation-quickstart)—Run your first evaluation
- [Prompt engineering quickstart](https://docs.langchain.com/langsmith/prompt-engineering-quickstart)—Iterate on prompts
- [Deployment quickstart](https://docs.langchain.com/langsmith/deployment-quickstart)—Deploy an agent
- [Integrations](https://docs.langchain.com/langsmith/integrations)—Connect your framework or provider
- [Create account & API key](https://docs.langchain.com/langsmith/create-account-api-key)—Account setup

## API reference

For SDK class and method details, use the [LangChain API Reference](https://reference.langchain.com) site:
- Browse: `https://reference.langchain.com/python/langsmith`
- MCP server: `https://reference.langchain.com/mcp`

## Related skills

- **langchain**—Build agents with prebuilt architecture and model integrations
- **langgraph**—Orchestrate stateful, durable agent workflows
- **deep-agents**—Batteries-included agent harness with planning and subagents

More from langchain-ai/docs

SkillDescription
add-docs-pageAdd, move, rename, or delete a page on the LangChain docs site. Covers choosing the source directory, writing frontmatter, placing the entry in src/docs.json navigation, adding redirects, and verifying with the lint and broken-link gates. Use when asked to add a new doc or page, move or rename a page, put something in the nav, or add a redirect.
deep-agentsBuild batteries-included agents with planning, context management, subagent delegation, and sandboxed execution. Use for complex, multi-step tasks that need built-in capabilities.
deepagentsAnalyze Deep Agents Python library releases against LangChain Deep Agents docs and prepare one-feature documentation updates.
deepagents-codeAnalyze Deep Agents Code releases against LangChain Deep Agents Code docs and prepare one-feature documentation updates.
deepagentsjsAnalyze Deep Agents TypeScript releases against LangChain Deep Agents docs and prepare one-feature documentation updates for JS-facing content.
docs-code-samplesUse this skill when migrating inline code samples from LangChain docs (MDX files) into external, testable code files that are extracted by this repo’s snippet scripts and used as Mintlify snippets. Applies when extracting code blocks from documentation, creating runnable code samples, using snippet delineators, or wiring snippet output into MDX includes.
docs-editEdit a docs page that already has an open pull request, or revise a page in place. Covers checking out the PR's own branch instead of cutting a new one, forked cross-repository PRs, reading the real diff, checking the edit against related pages, and the verification to run before handing off. Use when asked to edit, revise, fix, or review changes on a named PR, branch, or existing page.
docs-restructureRestructure documentation that spans several pages. Covers splitting a page that has grown too long, moving sections between pages, retiring a page, and fixing a topic documented in two places at once. Use when asked to streamline, simplify, consolidate, or reorganize docs, or when a page review keeps producing edits without the page getting shorter.
docs-reviewReview changed docs prose against Vale and the AGENTS.md style guide, reporting findings with the rule each one breaks. Use after authoring or editing a page and before committing, or to review a PR, a branch, or the current diff.
docs-team-voiceWrite or revise documentation prose so it reads like the rest of this site, in the docs team's shared voice. Covers sentence length, cross-link density, how to state defaults and conditions, naming exact identifiers, and what to cut in a revision pass. Use when drafting or rewriting a page, a section, a concept overview, a how-to, a callout, or landing copy.