
Dan Patiño
AI Strategy & Innovation at Coderhouse
Artificial Intelligence
LangSmith is a platform from LangChain for tracing, debugging, evaluating, and monitoring applications built on large language models. It records what your app did on every request, including each model call, retrieval step, and tool call, and lets you test new versions against saved datasets before you ship them. You do not need to use the LangChain framework to use it: LangSmith works with many frameworks and providers, including OpenAI, Anthropic, CrewAI, the Vercel AI SDK, and Pydantic AI, according to the LangSmith documentation.
It matters because LLM apps fail in ways normal software does not. The same input can produce different outputs, an agent can pick the wrong tool, and a prompt change that fixes one case can quietly break ten others. Without traces and evaluations, teams debug by guesswork. This guide explains what LangSmith does, how developers use it day to day, and how it compares with alternatives.
What LangSmith does
LangSmith covers two jobs that production AI teams need: observability and evaluation.
Observability: capture traces of every request, inspect them, build dashboards, and set alerts on errors, latency, cost, or quality.
Evaluation: build datasets of test cases, run your app against them, score the results with evaluators, and compare versions side by side.
Feedback: collect human annotations and user feedback, then turn interesting production runs into new test cases.
It also offers prompt management and deployment features, but tracing and evaluation are what most developers adopt it for first.
How tracing works
A trace is the full record of one request. Inside it, each step is a run: an LLM call, a retriever query, a tool call, or a custom function. Each run stores its inputs, outputs, timing, token usage, and errors. Related runs from a multi-turn conversation are grouped into threads.
Setting up tracing usually takes minutes. You create an API key, set a few environment variables, and either use a framework integration or wrap your own functions with the SDK. From then on, when a user reports a bad answer, you can open the trace and see exactly what happened:
Which documents retrieval returned, and whether the right one was among them.
The exact prompt the model received after templates were filled in.
Which tool the agent chose, with which arguments, and what came back.
How long each step took and how many tokens it used.
This is the practical side of AI observability: not just knowing that something failed, but seeing why.
How evaluation works
LangSmith's evaluation concepts split testing into two modes:
Offline evaluation runs before deployment on a dataset, a collection of examples with inputs and, optionally, reference outputs. Use it for benchmarking, regression testing, and comparing prompts or models.
Online evaluation runs on live production traces, which have no reference answers. Use it to monitor quality, safety, and anomalies in real time.
Scores come from evaluators. LangSmith supports human review through annotation queues, deterministic code checks (for example, valid JSON or an exact label match), LLM-as-a-judge scoring, and pairwise comparisons between two versions. The docs recommend starting with 10 to 20 hand-curated examples that define what "good" looks like, then growing the dataset from real production traces, especially runs with negative feedback, errors, or long latency.
A typical LangSmith workflow
Instrument the app. Turn on tracing in development so every run is recorded.
Debug with traces. When an answer is wrong, find the step that went wrong: retrieval, prompt, tool choice, or output parsing.
Build a dataset. Save representative inputs and expected outputs, including the cases that broke.
Add evaluators. Combine code checks for format, LLM-as-a-judge for qualities like faithfulness or helpfulness, and human review for subjective cases.
Run experiments. Test each prompt or model change against the dataset and compare scores before merging.
Monitor production. Attach online evaluators and alerts, then feed failing traces back into the dataset.
This loop turns "the bot seems worse this week" into a measurable regression you can fix and prevent.
LangSmith vs alternatives
Tool | Best for | Notes |
|---|---|---|
LangSmith | Teams using LangChain or LangGraph, or wanting tracing plus evaluation in one place | Framework-agnostic; cloud, hybrid, or self-hosted options |
Teams that prefer an open-source platform they can self-host | Tracing, prompt management, and evaluations | |
Arize Phoenix | Open-source tracing and evaluation built on OpenTelemetry | Popular for RAG debugging |
Custom logging | Very small projects | Cheap to start, hard to scale once you need evals and dashboards |
The concepts transfer across tools. If you understand traces, datasets, evaluators, and offline versus online evaluation, switching platforms is mostly a matter of learning a new interface.
Who should learn LangSmith
AI engineers building RAG apps and agents who need to prove quality before and after each change.
Forward deployed and applied AI engineers who hand systems to clients and must show measurable results.
Backend developers moving into AI who already know logging and testing and want the LLM-specific version.
Frequently asked questions
Do I need LangChain to use LangSmith?
No. LangSmith integrates with LangChain and LangGraph, but you can trace any Python or TypeScript app through its SDK or supported integrations.
Is LangSmith only for production?
No. Many teams get the most value during development, using traces to debug and offline evaluations to compare prompts and models before launch.
What is the difference between tracing and evaluation?
Tracing shows what your app did. Evaluation scores whether it did it well. You need both: traces explain failures, evaluations catch them early.
Build and evaluate production AI apps
If you write Python and want hands-on practice with retrieval, agents, evaluation, and observability, the AI Engineering Course is an 8-week live program with one weekly class that ends in a production-style capstone you build, evaluate, and hand off. If your interest is analyzing data and running experiments, the Data Analytics Course covers SQL, Python, statistics, and AI-assisted analysis.
I'm Dan Patiño, head of AI Strategy & Innovation at Coderhouse. My day-to-day work involves merging the tactical management of e-commerce (CRO, Email Marketing and SEO) with the development of disruptive solutions. I specialize in building internal AI-powered apps to automate tasks and boost innovation within the team. I firmly believe that technology is strategy's best ally. To dive deeper into my professional journey, I'll be waiting for you on my LinkedIn profile.