Summary
@langchain/langgraph-sdk is a dedicated HTTP client SDK for the LangGraph Platform (LangGraph Cloud / hosted agent service). It is a completely separate npm package from the @langchain/langgraph local framework and from @langchain/core. As of v1.9.25 it is actively maintained with its own release cadence.
This package is not instrumented today. The existing langchain.ts config only hooks into @langchain/core's CallbackManager (the local framework callback system). Calls made through @langchain/langgraph-sdk bypass that system entirely.
Gap Details
Package: @langchain/langgraph-sdk
Current latest: v1.9.25
Source: https://github.com/langchain-ai/langgraphjs/tree/main/libs/sdk
Zero matches for langgraph-sdk anywhere in js/src/ (confirmed via grep).
Key execution surfaces
| Method |
Description |
client.runs.create(threadId, assistantId, options) |
Start a background run on a thread |
client.runs.stream(threadId, assistantId, options) |
Stream a run's output (returns AsyncGenerator) |
client.threads.stream(threadId, options) |
Stream from a thread checkpoint |
client.runs.wait(threadId, runId) |
Wait for a run to complete and return final output |
These are the primary generative-AI execution calls that users make against a deployed LangGraph Platform agent. None are traced.
Why the existing instrumentation does not cover this
The langchain.ts config targets:
// js/src/auto-instrumentations/configs/langchain.ts
module: { name: "@langchain/core", filePath: "dist/callbacks/manager.js" }
functionQuery: { className: "CallbackManager", methodName: "configure" }
@langchain/langgraph-sdk makes direct HTTP requests (via its own BaseClient) to the LangGraph Platform REST API. It does not instantiate @langchain/core models or invoke CallbackManager. The two packages share only a namespace prefix, not a runtime dependency path.
Braintrust Docs Status
The Braintrust LangGraph integration page covers only the local framework (@langchain/langgraph + @langchain/core callbacks). There is no mention of @langchain/langgraph-sdk or LangGraph Platform/Cloud. Users running agents on LangGraph Platform through the SDK will see no spans in Braintrust today.
Suggested Approach
Instrument BaseClient or the specific streaming/run methods in @langchain/langgraph-sdk:
- Entry file to target:
dist/root.cjs or dist/index.cjs (CommonJS) / dist/root.js (ESM) — the file where Client, RunsClient, and ThreadsClient are defined
- Methods:
RunsClient.stream, RunsClient.create, RunsClient.wait, ThreadsClient.stream
- Channel pattern: consistent with existing naming, e.g.
orchestrion:@langchain/langgraph-sdk:runs.stream
Alternatively, a source-replacement patch (similar to the Mastra approach) could wrap the Client constructor to inject tracing.
Summary
@langchain/langgraph-sdkis a dedicated HTTP client SDK for the LangGraph Platform (LangGraph Cloud / hosted agent service). It is a completely separate npm package from the@langchain/langgraphlocal framework and from@langchain/core. As of v1.9.25 it is actively maintained with its own release cadence.This package is not instrumented today. The existing
langchain.tsconfig only hooks into@langchain/core'sCallbackManager(the local framework callback system). Calls made through@langchain/langgraph-sdkbypass that system entirely.Gap Details
Package:
@langchain/langgraph-sdkCurrent latest: v1.9.25
Source: https://github.com/langchain-ai/langgraphjs/tree/main/libs/sdk
Zero matches for
langgraph-sdkanywhere injs/src/(confirmed via grep).Key execution surfaces
client.runs.create(threadId, assistantId, options)client.runs.stream(threadId, assistantId, options)AsyncGenerator)client.threads.stream(threadId, options)client.runs.wait(threadId, runId)These are the primary generative-AI execution calls that users make against a deployed LangGraph Platform agent. None are traced.
Why the existing instrumentation does not cover this
The
langchain.tsconfig targets:@langchain/langgraph-sdkmakes direct HTTP requests (via its ownBaseClient) to the LangGraph Platform REST API. It does not instantiate@langchain/coremodels or invokeCallbackManager. The two packages share only a namespace prefix, not a runtime dependency path.Braintrust Docs Status
The Braintrust LangGraph integration page covers only the local framework (
@langchain/langgraph+@langchain/corecallbacks). There is no mention of@langchain/langgraph-sdkor LangGraph Platform/Cloud. Users running agents on LangGraph Platform through the SDK will see no spans in Braintrust today.Suggested Approach
Instrument
BaseClientor the specific streaming/run methods in@langchain/langgraph-sdk:dist/root.cjsordist/index.cjs(CommonJS) /dist/root.js(ESM) — the file whereClient,RunsClient, andThreadsClientare definedRunsClient.stream,RunsClient.create,RunsClient.wait,ThreadsClient.streamorchestrion:@langchain/langgraph-sdk:runs.streamAlternatively, a source-replacement patch (similar to the Mastra approach) could wrap the
Clientconstructor to inject tracing.