LangSmith SDK 0.16 explained: traceable spans, local-only evaluations and review queues
Three LangSmith SDK releases landed between 17 and 21 November 2026. The most useful change for developers is a beta upload_runs flag that lets evaluate() score an agent entirely on your machine. This guide traces and evaluates a small support agent step by step.
- Reading time
- 13 min
- Sections
- 7
- Code examples
- 7
- Tables
- 1
- Sources
- 6
- Published
- 23 Nov 2026
- What changed
- LangSmith SDK 0.15.0 adds new API resources
- Why it matters
- upload_runs=False makes LangSmith's evaluation harness usable in places where it was awkward before: CI jobs without credentials, air-gapped environments, and early experiments on sensitive data.
- What to do
- Upgrade and pin
LangSmith is LangChain's platform for watching and testing LLM applications. The Python SDK, the langsmith package, does two jobs. It records traces, the tree of steps an agent took, and it runs evaluations, where your agent answers a dataset of questions and small scoring functions grade each answer.
The SDK moved fast in the past week. Version 0.15.0 appeared on PyPI on 17 November 2026, 0.15.1 on 20 November and 0.16.0 on 21 November. By comparing the installed packages we found three concrete changes: a generated client for new REST resources in 0.15.0 (including read-only SQL over tracing projects), a beta upload_runs parameter on evaluate() in 0.15.1, and new annotation-queue review types in 0.16.0.
This article explains how tracing and evaluation work, then runs a complete evaluation with upload_runs=False, with no API key and no network access to LangSmith. All code was run with langsmith==0.16.0 on Python 3.13.
What happened
LangSmith SDK 0.15.0 adds new API resources (17 November 2026)
Compared with 0.14.17, the 0.15.0 package contains new modules under langsmith.resources, among them sql, ai_search, repos, commits, workspace_secrets, workspace_tags and sandbox volumes. The files say they are generated from LangSmith's OpenAPI spec. The sql.query method sends "a single read-only SQL statement" to /v2/sql/query, limited to the tracing projects you list, and its docstring notes that "queries over runs need a start_time lower bound".
LangSmith SDK 0.15.1 adds upload_runs to evaluate() (20 November 2026)
evaluate() gained upload_runs. None or True uploads every run as before. False uploads nothing: "results, including summary scores, stay local". A callable decides per example whether to upload that run's trace. Using it prints a LangSmithBetaWarning.
LangSmith SDK 0.16.0 adds review types for annotation queues (21 November 2026)
The 0.16.0 package adds types for reviewing annotation-queue items, including an agreement state with the values "agreed", "disagreed" and "none", and set_review parameters for a score, a value or a list of values. These support workflows where more than one person labels the same trace.
How LangSmith tracing works
Think of a trace as a flight recorder. Every time your agent calls a model, a tool or a retriever, the recorder writes one entry with inputs, outputs, timing, errors and metadata. Entries nest: a tool call made inside an agent step becomes a child of that step. LangSmith calls each entry a run; OpenTelemetry would call it a span.
There are three ways to create runs:
- Automatic. LangChain and LangGraph code is traced when the
LANGSMITH_TRACINGenvironment variable istrueand an API key is set. @traceable. Decorate any Python function. Its arguments become inputs and its return value becomes outputs.- Wrappers. The SDK has wrappers for popular model clients, so raw API calls are recorded as
llmruns with token counts.
@traceable takes a run_type ("chain" by default, or "llm", "tool", "retriever", "prompt" and others), a name, metadata, tags, and two hooks that matter in production: process_inputs and process_outputs. These let you change what is recorded, for example dropping a long document or masking an email address, without changing what the function receives.
Here is a tiny support agent with one traced tool:
pip install "langsmith==0.16.0"
from langsmith import traceable
@traceable(run_type="tool", name="lookup_policy")
def lookup_policy(topic: str) -> str:
policies = {"refund": "Refunds within 30 days.", "shipping": "Ships in 2 business days."}
return policies.get(topic, "No policy found.")
@traceable(name="support_agent")
def support_agent(inputs: dict) -> dict:
q = inputs["question"].lower()
topic = "refund" if "refund" in q or "money back" in q else "shipping" if "ship" in q else "other"
return {"answer": lookup_policy(topic), "topic": topic}
The "agent" is a keyword router so the example runs without a model. Swap the router for a model call and nothing else in this article changes. Each call to support_agent produces a parent run with one child, lookup_policy, of type tool. In our run, the child run recorded {'output': 'Refunds within 30 days.'} for the first example. The agent trace simulation shows how such trees look for a real multi-step agent.
Masking what you record, verified locally
You can check what a trace will contain without sending it anywhere. @traceable accepts langsmith_extra={"on_end": callback} at call time, and the callback receives the finished run object. Combined with tracing_context(enabled=True), that gives you a local test for your masking rules:
import re
from langsmith import traceable, tracing_context
EMAIL = re.compile(r"[\w.+-]+@[\w-]+\.[\w.]+")
def mask_inputs(inputs: dict) -> dict:
return {k: EMAIL.sub("[email]", v) if isinstance(v, str) else v for k, v in inputs.items()}
@traceable(name="draft_reply", process_inputs=mask_inputs)
def draft_reply(message: str) -> str:
return f"Thanks, we got your message ({len(message)} chars)."
captured = []
with tracing_context(enabled=True):
print(draft_reply("Hi, I am ayse@example.com and my order is late",
langsmith_extra={"on_end": captured.append}))
print("recorded inputs:", captured[0].inputs)
Thanks, we got your message (46 chars).
recorded inputs: {'message': 'Hi, I am [email] and my order is late'}
Notice the two different views. The function saw the real text, so its reply counted 46 characters including the address. The recorded run saw only the masked version. That separation is the point: masking changes the flight recorder, not the flight. Put a test like this in your suite for every traced function that can receive personal data, because a regex that misses one format leaks it into every trace from then on.
How evaluation works
An evaluation has four parts:
| Part | What it is | In our example |
|---|---|---|
| Target | The function under test; takes inputs, returns outputs |
support_agent |
| Data | Examples with inputs and reference outputs |
Five support questions with the correct topic |
| Row evaluators | Score one example; receive outputs, reference_outputs, inputs as needed |
correct_topic, mentions_days |
| Summary evaluators | Score the whole experiment from all rows | topic_accuracy |
Evaluators are plain functions. The SDK looks at the parameter names to decide what to pass, so def correct_topic(outputs, reference_outputs) receives exactly those two dicts. A function can return a bool, a number or a dict with key and score.
import uuid
from langsmith import evaluate
from langsmith.schemas import Example
def correct_topic(outputs: dict, reference_outputs: dict) -> bool:
return outputs["topic"] == reference_outputs["topic"]
def mentions_days(outputs: dict) -> dict:
return {"key": "mentions_days", "score": int("day" in outputs["answer"])}
def accuracy(outputs: list[dict], reference_outputs: list[dict]) -> dict:
hits = sum(o["topic"] == r["topic"] for o, r in zip(outputs, reference_outputs))
return {"key": "topic_accuracy", "score": hits / len(outputs)}
ds = uuid.uuid4()
data = [Example(id=uuid.uuid4(), dataset_id=ds, inputs={"question": q}, outputs={"topic": t})
for q, t in [("Can I get a refund?", "refund"), ("When will it ship?", "shipping"),
("I want my money back", "refund"), ("Do you sell gift cards?", "other"),
("My parcel never arrived", "shipping")]]
results = evaluate(support_agent, data=data, evaluators=[correct_topic, mentions_days],
summary_evaluators=[accuracy], upload_runs=False)
We ran this with LANGSMITH_TRACING=true and no API key. The SDK printed a beta warning for upload_runs, a missing-key warning and a failed connection message, then completed the evaluation locally:
Starting evaluation of experiment: shiny-girl-96
Can I get a refund? refund {'correct_topic': True, 'mentions_days': 1}
When will it ship? shipping {'correct_topic': True, 'mentions_days': 1}
I want my money back refund {'correct_topic': True, 'mentions_days': 1}
Do you sell gift cards? other {'correct_topic': True, 'mentions_days': 0}
My parcel never arrived other {'correct_topic': False, 'mentions_days': 0}
summary: 0.8
Step by step:
evaluateransupport_agentonce per example and recorded each run, including thelookup_policychild.- For each row, it called both row evaluators. The last question has no keyword the router knows, so it fell through to
otherand failedcorrect_topic. - After all rows, it called the summary evaluator with lists of outputs and references. Four of five topics match, so
topic_accuracyis 0.8. - Because
upload_runs=False, nothing was sent. The scores live in theresultsobject, which you can iterate or convert to a table.
Why summary evaluators matter
Row scores are easy to read but can hide what you care about. Precision on the "refund" class, an F1 score or a cost-weighted metric can only be computed over the whole set. That is what summary_evaluators are for. With five examples, one failure moves accuracy by 20 points. A dataset of 200 examples moves 0.5 points per example, which is why small sets produce noisy comparisons. Before declaring a new prompt better, test whether the difference is real; the paired McNemar test simulation shows how to compare two runs on the same examples.
Repetitions and concurrency
Agents are not deterministic. evaluate has num_repetitions (default 1) to run every example several times, and max_concurrency to run rows in parallel. With 200 examples and three repetitions you make 600 agent runs. If each costs 4,000 input tokens and 500 output tokens, that is 2.4 million input and 0.3 million output tokens per experiment, so price the run before scheduling it nightly.
Continue learning
How this article connects
6 pages link to or from it. Drag to turn, click a dot to open it.
Where model-graded scoring fits
Our evaluators are exact checks. Many agent outputs need judgement: was the answer polite, grounded, complete? For those you use an LLM-as-judge evaluator, a function that asks a model to grade the output against a rubric and returns its score. Judges are themselves models, so measure how often they agree with people before trusting them; the judge agreement simulation explains the numbers. The 0.16.0 review types, with their agreed and disagreed states, point at the same need from the human side: knowing when two labellers disagree.
What it means in practice
upload_runs=False makes LangSmith's evaluation harness usable in places where it was awkward before: CI jobs without credentials, air-gapped environments, and early experiments on sensitive data. You get the same evaluator API, the same summary logic and the same result objects, without sending prompts or outputs anywhere. The callable form is a middle ground: upload only failures, or only a sample.
The SQL resource matters for teams that already have many traces. Instead of exporting runs and loading them into a warehouse to answer "which tool fails most on Mondays", you can send read-only SQL to the projects you choose. We did not run it, because it needs a LangSmith workspace, so treat our description as based on the SDK code and docstrings.
The same harness works for real agents. The target argument of evaluate accepts a plain function or a LangChain Runnable, which includes a compiled LangGraph graph. In practice you usually wrap the graph in a small function that maps the example's inputs to the graph's input state and pulls the final answer and the list of tool calls out of the result. Returning the tool calls as part of the outputs lets you write trajectory evaluators too, for example "did the agent call lookup_policy before answering?" or "did it make more than five tool calls?". Those checks are cheap, deterministic and catch many regressions that a judge model scoring only the final text would miss. A useful habit is to start every new agent with three deterministic evaluators (right tool used, answer not empty, tool calls under a limit) before adding any model-graded ones.
For more on tracing in general, see the tracing and evals pages, and the LangSmith tool page.
What to do now
- Upgrade and pin. Move to
langsmith==0.16.0and pin it; three releases in five days means behaviour can shift between minors. - Trace your own functions. Add
@traceablewith the rightrun_typeto tools, retrievers and planning steps that are not LangChain components. - Mask before you record. Use
process_inputsandprocess_outputsto drop secrets, personal data and large blobs from traces. - Run evaluations in CI without uploads. Use
upload_runs=Falsefor pull-request checks and fail the build if a summary score drops. - Upload selectively in staging. Pass a callable to
upload_runsthat returnsTrueonly for failing or sampled examples. - Write summary evaluators. Compute the metric you actually report, such as per-class accuracy or cost per solved task.
- Repeat noisy agents. Set
num_repetitionsto 3 or more for agents with tool use, and compare distributions, not single numbers. - Plan human review. If several people label traces, design for disagreement using the new review states.
Risks and open questions
Beta flags can change. upload_runs prints a beta warning. Keep its use in one helper so a rename is a one-line fix.
Local means you own the results. With uploads off, nothing is stored in LangSmith. Save results to your own storage, or the history is lost when the CI job ends.
Generated clients move fast. The new resources are generated from an OpenAPI spec; one type module present in 0.15.1 was already gone in 0.16.0. Pin versions if you call them directly.
Small datasets mislead. A five-example set swings 20 points per mistake. Grow datasets from real failures found in traces.
Watch next: whether upload_runs leaves beta, documentation and examples for SQL over traces, and how the review states surface in the LangSmith interface.
Frequently asked questions
Can I use LangSmith without an account?
For local evaluation, yes: in our test evaluate(..., upload_runs=False) ran and scored every example without an API key, after printing warnings. Viewing traces in the web interface, storing datasets and sharing experiments still needs an account.
What is the difference between a run and a trace?
A run is one recorded step, such as one tool call. A trace is the tree of runs that make up one request, from the top-level agent call down to every model and tool call inside it.
How do evaluators receive their arguments?
The SDK passes arguments by name. Declare the parameters you need, such as outputs, reference_outputs or inputs, and it fills them in. Summary evaluators receive lists of the same values for all examples.
Does @traceable slow my code down?
The decorator records data and sends it in the background, so the main cost is serialising inputs and outputs. Large inputs cost more, which is another reason to use process_inputs to trim what is recorded.
When should I use num_repetitions?
Use it whenever your target is non-deterministic, which includes most agents with sampling or tool use. Three repetitions show whether a pass is stable or lucky, at three times the cost.
Summary
The LangSmith Python SDK released 0.15.0, 0.15.1 and 0.16.0 between 17 and 21 November 2026. The changes we verified are new generated API resources such as read-only SQL over tracing projects, a beta upload_runs flag that keeps evaluations entirely local, and review types for annotation queues. The underlying model is unchanged: @traceable turns functions into nested runs, and evaluate runs a target over examples, scores each row and computes summary metrics. Use local evaluation in CI, upload selectively, mask what you trace, and grow your datasets until a single mistake no longer swings the score.
Sources
Cite this article
Kelahmet, Ö. C. (2026, November 23). LangSmith SDK 0.16 explained: traceable spans, local-only evaluations and review queues. Özer Cem KELAHMET. https://www.ozercemkelahmet.com/articles/langsmith-0-16-tracing-offline-evaluation
BibTeX
@online{kelahmet2026langsmith,
author = {Kelahmet, {\"O}zer Cem},
title = {{LangSmith SDK 0.16 explained: traceable spans, local-only evaluations and review queues}},
year = {2026},
month = {nov},
url = {https://www.ozercemkelahmet.com/articles/langsmith-0-16-tracing-offline-evaluation}
}Version historyfirst version
- Published
Factual corrections are listed here with what changed. Wording and formatting edits are not listed.