Skip to main content
The Managed Deep Agents SDKs wrap the /v1/deepagents API for creating agents, managing threads, streaming runs, connecting MCP servers, and building React UIs.
The SDK packages are in public beta. Managed Deep Agents still requires preview access on LangSmith Cloud in the US region.

Install

Requirements:
  • Python 3.10 or newer for managed-deepagents.
  • Node.js 20 or newer for @langchain/managed-deepagents.
  • A LangSmith API key for a workspace with Managed Deep Agents access.

Configure a client

Set your API key:
Both SDKs default to https://api.smith.langchain.com/v1/deepagents. To use a compatible endpoint, set LANGSMITH_ENDPOINT or pass the API URL directly:
Do not expose long-lived LangSmith API keys in browser code. For browser applications, call your own backend or pass a custom fetch implementation that proxies requests through your server.

Create an agent

Create-agent requests can use the same top-level model and backend fields used by the Managed Deep Agents CLI:

Run and stream

Create a thread before running the agent. Threads preserve conversation and execution state for long-running work.

Use React useStream

The TypeScript SDK includes a LangGraph client adapter for @langchain/react. Use getLangGraphClient() so useStream owns the thread, run, and state projection behavior while the Managed Deep Agents SDK handles routes, headers, and payload fields.

Resources

The SDK clients expose these resource groups: Python methods use snake_case, such as create_and_run and resolve_interrupt. TypeScript methods use camelCase, such as createAndRun and resolveInterrupt. The SDKs can register MCP servers, complete auth sessions, and discover a registered server’s tool schemas with client.mcp_servers.list_tools(...) in Python or client.mcpServers.listTools(...) in TypeScript. Pass the selected tool entries to client.agents.create(...) or client.agents.update(...).

Handle errors

SDK requests raise SDK-specific errors that include status and response details.
For endpoint-level request and response schemas, see the Managed Deep Agents API reference.