Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.langchain.com/llms.txt

Use this file to discover all available pages before exploring further.

Use this quickstart to deploy a first Managed Deep Agent with the CLI, then run it with the REST API.
Managed Deep Agents is in private preview. Join the waitlist to request access.

Prerequisites

Before you start, make sure you have:
  • Managed Deep Agents private preview access.
  • A LangSmith API key for a workspace with private preview access.
  • The beta release of deepagents-cli.
The Managed Deep Agents deploy flow requires the beta release of deepagents-cli. The stable Deep Agents deploy experience remains available and unchanged while Managed Deep Agents is in private preview.

CLI: deploy a first agent

1

Install the CLI

Install or upgrade the beta CLI with uv:
uv tool install --prerelease allow deepagents-cli
If you already installed the tool, upgrade it:
uv tool upgrade --prerelease allow deepagents-cli
If you were given an exact beta version, pin that version:
uv tool install --force "deepagents-cli==<version>"
As a fallback, install the CLI with pip:
pip install -U --pre deepagents-cli
2

Set your API key

Set a LangSmith API key for a workspace with private preview access:
export LANGSMITH_API_KEY="<LANGSMITH_API_KEY>"
3

Create a project

Scaffold a project:
deepagents init my-agent
cd my-agent
The command creates agent.json, AGENTS.md, skills/, and .gitignore.
4

Edit the agent

Edit AGENTS.md to define the agent’s behavior.The generated agent.json uses the readable local CLI shape:
{
  "name": "my-agent",
  "description": "A managed deep agent.",
  "model": "anthropic:claude-sonnet-4-6",
  "backend": {
    "type": "thread_scoped_sandbox"
  }
}
The generated project uses a LangSmith sandbox backend by default. Keep thread_scoped_sandbox unless the agent needs a different sandbox scope. LangSmith sandboxes give the agent an isolated environment for code execution, filesystem work, and long-running tasks. For other options, see Choose a backend.If the agent calls MCP tools, connect tools before you deploy.
5

Deploy the agent

Deploy the project:
deepagents deploy
On success, the CLI prints the agent name, agent ID, short revision, agent URL, and deploy health check. Save the agent_id for the run step.
If deepagents init, deploy, agents, or mcp-servers are missing or behave unexpectedly, confirm the beta is active with deepagents --version. A previously installed stable deepagents can shadow the beta release on your PATH.

API: run the agent

Running a Managed Deep Agent is currently available through the REST API. Set request defaults:
export LANGSMITH_API_KEY="<LANGSMITH_API_KEY>"
export LANGSMITH_API_URL="https://api.smith.langchain.com"
export DEEPAGENTS_BASE_URL="$LANGSMITH_API_URL/v1/deepagents"
export AGENT_ID="<agent_id>"
Create a thread:
curl --request POST \
  --url "$DEEPAGENTS_BASE_URL/threads" \
  --header "X-Api-Key: $LANGSMITH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "agent_id": "'"$AGENT_ID"'",
    "options": {
      "test_run": false,
      "skip_memory_write_protection": false
    }
  }'
Set the returned thread ID:
export THREAD_ID="<thread_id>"
Stream a run:
curl --request POST \
  --url "$DEEPAGENTS_BASE_URL/threads/$THREAD_ID/runs/stream" \
  --header "X-Api-Key: $LANGSMITH_API_KEY" \
  --header 'Accept: text/event-stream' \
  --header 'Content-Type: application/json' \
  --data '{
    "agent_id": "'"$AGENT_ID"'",
    "messages": [
      {
        "role": "user",
        "content": "Research recent approaches to agent memory and summarize the main tradeoffs."
      }
    ],
    "stream_mode": ["values", "updates", "messages-tuple"],
    "stream_subgraphs": true,
    "user_timezone": "America/Los_Angeles"
  }'
For Python and JavaScript examples, see Run an agent.

Next steps

Connect tools

Add MCP-backed tools before deploying an agent that needs external capabilities.

Deploy an agent

Learn the full CLI and REST API deploy workflow.

CLI reference

Review all commands, flags, project files, and validation rules.

API reference

Review generated endpoint reference pages and common REST commands.