Skip to main content
Deploying a Managed Deep Agent compiles a code-first project into a managed LangGraph app, syncs deploy-owned context to Context Hub, uploads the compiled source, and triggers a LangSmith hosted deployment build.
Managed Deep Agents is in public beta and available on LangSmith Cloud in the US region only.
This page covers secrets routing and deploy options. To test the agent before deploying, see Develop locally with LangSmith Studio. For command flags, the deploy step list, and troubleshooting, see the CLI reference.

Prerequisites

Before you deploy, make sure you have:
  • A workspace with Managed Deep Agents public beta access.
  • A LangSmith API key for that workspace, either in .env or your shell environment.
  • The mda CLI installed from managed-deepagents.
  • Project dependencies installed with uv sync for generated Python projects.
  • Model provider credentials, such as OPENAI_API_KEY, in .env, your shell environment, or LangSmith workspace secrets.
The CLI targets US LangSmith Cloud by default.

Deploy to LangSmith

Deploy the local project:
mda deploy routes local project inputs to different managed surfaces:
Set the deployment name explicitly when the directory name is not the name you want:
Use --deployment-type prod when creating a production deployment:
Use --no-wait to trigger the build without polling for completion:
When --no-wait is set, schedule reconciliation is skipped for that deploy invocation because the CLI exits before the deployment reaches DEPLOYED. On success, the CLI prints the LangSmith deployment dashboard URL. For the full deploy step list, see the CLI reference.

Secrets and environment files

mda deploy reads project .env values before shell environment variables. Use .env for the LangSmith API key that authenticates the deploy and for runtime secrets the hosted deployment needs:
.env
LANGSMITH_API_KEY, LANGGRAPH_HOST_API_KEY, LANGCHAIN_API_KEY, and other platform variables are reserved. They can authenticate the deploy, but they are not uploaded as user-managed deployment secrets. Non-reserved .env entries, such as model provider keys, MCP tokens, and custom tool credentials, are forwarded as hosted deployment secrets when mda deploy creates or updates the deployment. If the configured model requires a provider key, deploy fails before upload unless that key is available from .env, the shell environment, or LangSmith workspace secrets. When the provider key is only in the shell environment, mda deploy forwards it as a secret for that deploy. Reserved platform variables, empty values, .env, and .env.* files are not copied into the compiled build archive. For authentication key order and reserved variables, see the CLI reference.

Troubleshoot a deploy

For deploy troubleshooting, see the CLI reference. If a deployment reaches BUILD_FAILED or DEPLOY_FAILED, open the printed deployment URL in LangSmith and inspect the revision logs.

Next steps

Identity

Authenticate callers and provide private threads.

Schedules

Run agents on managed cron schedules.

Custom tools

Add authored LangChain tools to the agent definition.

CLI reference

Look up every mda command and flag.