Skip to main content

Context

In May 2026, we released SmithDB, a new observability database built for modern AI agents. SmithDB delivers industry-leading performance across every key observability workload, making core LangSmith experiences dramatically faster. SmithDB-powered methods are now available to SDK users in eligible regions.

Deployment support

Minimum SDK version

The SmithDB-backed methods require a minimum SDK version:

Migrate with an AI agent

This guide is written to be fetched and applied directly by an AI coding agent. Copy the following prompt into your agent to migrate your codebase to the SmithDB-backed methods.

Exceptions

The SmithDB-backed methods raise new exception classes instead of the legacy langsmith.utils exception classes.

Runs: query

Query runs from a project with optional filtering and field projection. Returns a paginated result set.

Main changes

Method name

client.runs.query() is now async. Call it with await.

Query parameters

project_name is not supported in runs.query. Pass project_ids with the project UUID instead. To look up a UUID by name, use client.read_project(project_name="my-project"), or await client.aread_project(project_name="my-project") in async code.
min_start_time defaults to 1 day ago when omitted. list_runs with no start_time returned all historical runs; runs.query without min_start_time silently scopes the query to the last 24 hours. Pass an explicit min_start_time if you need a wider window.

Response fields

Pass SCREAMING_SNAKE_CASE strings to selects (eg. "ID", "NAME", "STATUS") to control which fields are populated on each Run; only selected fields are non-None. Default selects contains only "ID".

Examples

List all runs in a project

runs.query does not accept a project name directly. Resolve the project UUID with client.aread_project() first, then pass it as a string in project_ids.
Before

Selecting fields

list_runs returns a default set of fields with no selection needed. runs.query returns only id by default—pass selects=[...] to request more. Field names are now uppercase ("name""NAME").
Before

Filter by run type and time range

start_time is renamed to min_start_time, and run_type values are now uppercase ("llm""LLM").
Before

Filter root runs only

is_root is unchanged.
Before

Fetch runs by ID list

id=[...] is renamed to ids=[...]. project_ids is now required even when filtering by run IDs—v1 allowed omitting the project context.
Before

Iterate through runs

list_runs auto-paginates transparently, fetching up to 100 runs per API call and stopping once limit results are returned. runs.query does not accept a total limit; iterate with async for and break once you have enough, or use the returned page’s has_next_page()/get_next_page() for manual page-by-page control.
Before

Filter runs with errors

error=True/False is renamed to has_error=True/False.
Before

Filter by metadata

The filter string syntax is unchanged: eq(metadata_key, ...) checks for key presence, combined with eq(metadata_value, ...) to match a specific value.
Before

Complex boolean filters

Nested and() / or() filter expressions are unchanged.
Before

Scoped filters: filter, trace_filter, tree_filter

filter, trace_filter, and tree_filter are unchanged. filter applies to the matched run, trace_filter to the root of its trace, and tree_filter to other runs in the trace tree (siblings and children).
Before

Runs: retrieve

Fetch a single run by ID. Returns only the run ID by default—specify a field selection list to retrieve additional data.

Main changes

Method name

client.runs.retrieve() is now async. Call it with await.

Query parameters

runs.retrieve requires two new fields—project_id and start_time—that read_run did not need. Both are required to locate the run in SmithDB.

Response fields

Pass SCREAMING_SNAKE_CASE strings to selects (eg. "ID", "NAME", "STATUS") to control which fields are populated on the returned Run; only selected fields are non-None. Default selects contains only "ID".

Examples

Fetch a single run by ID

runs.retrieve requires two additional parameters that read_run did not need: project_id (UUID) and start_time. Both are required by the SmithDB storage model to locate a run efficiently. Resolve the project UUID via client.aread_project() first.
Before

Selecting fields

read_run returns a full run object with no selection needed. runs.retrieve returns only id by default—pass selects=[...] to request more.
Before

Handle a not-found run

read_run raised LangSmithNotFoundError from langsmith.utils for a missing run. runs.retrieve raises NotFoundError from langsmith instead.
Before

Dataset experiment runs: query

Query dataset examples together with the experiment runs recorded against each example. Accepts one or more experiment_ids so you can view runs from multiple experiments side by side; results are returned as a cursor-paginated page.

Main changes

Method name

Query parameters

experiment_ids is required and replaces session_ids. Values are still experiment tracing-project UUIDs—if you only know the experiment’s name, resolve it first: client.read_project(project_name="my-experiment").id, or await client.aread_project(project_name="my-experiment") in async code.

Response fields

Each page item is a dataset example paired with the runs produced for it—not a bare Run. Its runs field holds the same Run objects returned by Querying runs; see that section for the per-run fields. The tables below describe the rest of the item: the example fields alongside runs.
get_experiment_results returned experiment results with an examples_with_runs iterator. datasets.experiment_runs.query returns a paginated page object (page.items, page.next_cursor); each item has:

Examples

Query experiment runs and request preview fields

preview=True returned truncated inputs/outputs automatically. In the new API, request that explicitly: pass INPUTS_PREVIEW and OUTPUTS_PREVIEW in selects for the same truncated shape, or INPUTS/OUTPUTS for the untruncated values. Omitting selects returns only id.
Before

Page through results

Both examples below fetch up to 100 results across as many pages as that takes, then stop—so the two are comparable operations, not “one page” vs. “everything.” Adjust the 100/page_size values for your own use case.
get_experiment_results paginates internally and stops once limit total results are returned. datasets.experiment_runs.query has no total-count limit; iterate the returned page with async for and break once you have enough.
Before

Sort by feedback score

Sort dataset examples by a feedback score, supported only when you query a single experiment. In Go and Java, this replaces the legacy sort_params.sort_by/sort_params.sort_order (now sort.by/sort.order); Python and TypeScript gain sorting for the first time in the new API.
get_experiment_results did not support sorting by feedback score.