Context
In May 2026, LangChain 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. New SDK methods are required to query your traces with SmithDB. This guide helps you migrate your codebase.On self-hosted, the new methods require LangSmith version 0.16 or later, whether your deployment stores traces in ClickHouse or SmithDB. You do not need to install SmithDB first. Start migrating your code as soon as you upgrade to 0.16. Some operations require a later release or an extra parameter:
- Annotation queue items: The items endpoints need v0.16.14 to v0.17.1, depending on the method. See Annotation queues: add runs and Annotation queues: read runs.
runs.retrieve: On SmithDB-only deployments below v0.18, passstart_time. See Runs: retrieve.- Feedback creation: On SmithDB-only deployments below v0.18, pass the run’s
start_time. See Feedback: create.
Why migrate
- Queries run up to 12x faster on SmithDB. See the benchmarks.
- On LangSmith Cloud, the new query endpoints have higher rate limits than the deprecated ones.
- Dedicated methods for traces and threads replace filtering runs by hand.
- The deprecated methods stop working on January 31, 2027 on LangSmith Cloud, and when ClickHouse is turned off on self-hosted, at the latest with v0.19. Migrating early avoids a last-minute rush.
Migrate with an AI agent
Copy the following prompt into your coding agent. It first sums up the change in plain words and waits for your go. Then it finds every SDK method and direct API call to the deprecated endpoints, waits for your approval, and migrates them locally. It pushes and opens a pull request only if you approve.Migrate off deprecated LangSmith endpoints
Deprecation and removal
Each SDK method and its underlying endpoint share the same deprecation date.
For details on how LangSmith deprecates and removes API endpoints and SDK methods, see API and SDK deprecation policy.
Minimum SDK version
The new SDK methods are available starting at these SDK versions:
The LangSmith CLI queries the same SmithDB-backed endpoints and requires
v0.2.44 or later.
About self-hosted
- The deprecated methods stop working once ClickHouse is disabled.
- Where possible, the SDK raises a warning or error identifying the version to upgrade to, instead of failing without explanation.
Methods by area
The before and after change for each method is documented on the page for its area.Query runs
Search the runs in a project: filters, field projection, sorting, and pagination. The largest surface area in the migration.
Retrieve runs
Fetch one run by ID, load its child runs, and build the URL of a run in the LangSmith UI.
Traces
Query the traces in a project, read their token and cost aggregates, and list the runs that belong to one trace.
Threads
Query the threads in a project and list the traces (turns) that belong to one thread.
Dataset experiment runs
Query the runs recorded by an experiment on a dataset, including pagination and sorting by feedback score.
Feedback and sharing
Create feedback on a run, add runs to an annotation queue, and share, unshare, or read publicly shared runs.
Affected methods and endpoints
Every SDK method and API endpoint below is deprecated and stops working on the removal date above. Search your codebase for all of them. Endpoint paths are relative to/api/v1; the area pages have before/after examples for each one, except where noted.
SDK methods
- Python
- TypeScript
- Java
- Go
Deprecated methods on The
Client and AsyncClient:evaluate() and aevaluate() remain supported. From langsmith 0.15.0, they use POST /api/v2/runs/query wherever SmithDB serves queries. For dual-backend behavior, ClickHouse-only deployments, and the deprecation report, see Evaluate existing experiments.client.<resource> replacements (client.runs, client.threads, …) are async on Client; other Client methods such as create_feedback stay sync. Paginated methods such as client.runs.query() return an AsyncPaginator: use async for to iterate individual runs across all pages, or await it to fetch the first page. You do not need to await the paginator before using async for. Use await for non-paginated methods. In sync code, keep the same Client: put the migrated calls in one async def and run it once with asyncio.run() (see Python troubleshooting). They return only the fields listed in selects, so include "ID".Endpoints
The annotation queue run endpoints move to the queue items API under
/api/v1/platform/annotation-queues. For adding runs to a queue, see Annotation queues: add runs. For listing and counting queue items, see Annotation queues: read runs. For the other endpoints, see the API reference for request and response shapes.
The v2 endpoints take a project ID, not a name. To resolve a name, call
GET /api/v2/sessions?name=<project-name> and read items[0].id.
If you call the API with an organization-scoped service key, send the target workspace on every request. Pass the X-Tenant-Id header, set LANGSMITH_WORKSPACE_ID for the SDK, or pass the workspace ID to the client (Client(workspace_id=...) in Python, new Client({ workspaceId }) in TypeScript). Without it, every v2 call returns 403 Forbidden. For more on key scopes, see Administration overview.
Exceptions
- Python
- TypeScript
- Java
- Go
- cURL
The SmithDB-backed methods raise new exception classes instead of the legacy
langsmith.utils exception classes.Only the new methods (client.runs.* and the other replacements in this guide) raise these classes. Methods called directly on Client or AsyncClient, such as read_project(), still raise the langsmith.utils ones. See Python troubleshooting to catch both.Discontinued
The following methods are discontinued. They call the retired/feedback/formulas endpoints, which return 410 Gone on composite-feedback v2 and are scheduled for removal on 2026-08-20. Composite scores are now managed as composite evaluators, which implement a composite score as a code evaluator plus a run rule. There is no SDK replacement.
Feedback formula methods
Python troubleshooting
Evaluate existing experiments
When you pass an existing experiment toevaluate() or aevaluate(), or compare experiments, the Python SDK loads its runs internally. With langsmith 0.15.0 or later, the SDK uses POST /api/v2/runs/query when SmithDB serves queries, even if ClickHouse also serves queries. Where only ClickHouse serves queries, the SDK still uses list_runs().
Earlier SDK versions can use list_runs() on deployments with both backends enabled. The SDK suppresses the deprecation warning for these internal calls, but they can appear as POST /runs/query in your workspace’s deprecation report.
If SmithDB serves queries, upgrade the SDK to migrate these internal calls. You do not need to change your evaluate() or aevaluate() calls. Migrate any direct list_runs() calls in your own code separately.
Calling the new methods from sync code
Keep the sameClient and pick the pattern that matches where the code runs:
- Sync script: put the migrated calls in one
async defand run it once withasyncio.run(). - Notebooks, async functions, FastAPI
async defhandlers, async LangGraph nodes, …: useasync forfor all pages of paginated results, orawaitfor the first page or non-paginated calls. asyncio.run()where an event loop is already running raisesRuntimeError: asyncio.run() cannot be called from a running event loop. Useasync fororawaitdirectly instead.asyncio.run()from several threads that share aClient(thread pools, FastAPIdefhandlers, sync LangGraph nodes under load, …) can fail withEvent loop is closed. That call path needs a decision: make it async, or batch the calls withasyncio.gather()inside oneasyncio.run().
Catching errors from old and new methods
The two exception families share no base class other thanException. Code that wraps both kinds of call catches both:
Mocking the new methods in tests
Fromlangsmith 0.12.0, the new methods send requests with httpx2, not httpx, so respx, pytest-httpx and httpx.MockTransport do not intercept them. Patch the method on client.runs (or the other resource) with an AsyncMock instead:
Connect these docs to your agent of choice via MCP for real-time answers.

