Managed Deep Agents is in private beta, available on LangSmith Cloud in the US region only. Join the waitlist to request access.
Set up
Install the SDK for your runtime:LANGSMITH_API_KEY by default. REST requests require the X-Api-Key header:
Find the agent ID
Find the agent ID with the CLI, an SDK, or the REST API.- CLI
- SDK
- API
Create threads and stream runs
You can create threads and stream runs with the SDK or REST API. Currently, there is no CLI command for running Managed Deep Agents. After completing Set up, export the agent ID you retrieved in Find the agent ID:- Python SDK
- TypeScript SDK
- cURL
Create a thread
Create a thread before running the agent. Threads preserve conversation and execution state for long-running work. Theoptions object is optional, and both fields default to false. Set test_run to true to mark the thread as a test run that is filtered out of usage and analytics. By default, skip_memory_write_protection lets the runtime raise a human-in-the-loop interrupt before the agent writes to long-term memory, so you can approve or reject the write. Set it to true to let memory writes proceed immediately, which is useful for headless runs where no human is available to approve the write. For the full field reference, see the API reference.
- Python SDK
- TypeScript SDK
- cURL
Stream a run from a thread
Start work on the thread and stream the result:- Python SDK
- TypeScript SDK
- cURL
text/event-stream). With the stream mode (stream_mode, streamMode) shown, you receive incremental updates and messages-tuple events as the agent works, followed by a final values event with the run’s full state, including the agent’s response. Set stream_subgraphs (streamSubgraphs) to true to also stream events from subgraphs, such as subagents. The optional user_timezone sets the caller’s IANA timezone so the agent reasons about dates in local time, defaulting to the agent’s configured timezone or UTC.
The Python SDK and cURL examples accept a per-run
user_timezone. The TypeScript example streams through the LangGraph client adapter, which has no per-run timezone field, so the agent uses its configured timezone. To set the timezone per run from TypeScript, use the REST endpoint shown in the cURL tab and pass user_timezone in the request body.data: payloads as JSON to drive a UI. The Python and TypeScript SDK examples yield decoded events with event.event and event.data.
Choose a stream mode:
Stream with React useStream
The previous Python SDK and TypeScript SDK examples stream route-level events. The following React useStream example exposes LangGraph projections such as stream.messages, stream.values, and output state for chat UIs.
For React applications, use the TypeScript SDK’s LangGraph client adapter with @langchain/react:
Next steps
SDK reference
SDK configuration details for the Python and TypeScript clients.
API reference
Route-level request and response details.
If a request fails, confirm that your API key is valid, that the workspace has private beta access, and that you are calling the supported region. For response status codes and error shapes, see the API reference.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

