Managed Deep Agents is in public beta and available on LangSmith Cloud in the US region only.
Project structure
The agent entry lives at the project root:agent. You can also use agent.tsx.
Define an agent
UsedefineDeepAgent:
Name
name is required. Pass a static string that starts with a letter and contains only letters, numbers, underscores, or hyphens, such as "research-assistant".
MDA uses the name as the LangGraph assistant ID and the default LangSmith deployment name. You can override the deployment name with mda deploy --name without changing the agent definition.
Model
Setmodel to the chat model the agent uses. The simplest option is a provider:model string. Add the provider’s API key to .env so the model works locally and in the deployment.
Using LangSmith Gateway
You can use LangSmith Gateway to control rate limits, fallbacks, and more. In order to use, you should:- Use the ChatOpenAI model directly
- Set a base url of
https://gateway.smith.langchain.com/v1 - Set an environment variable of
LANGSMITH_GATEWAY_API_KEYto be your LangSmith API key.
The model slug should be
provider/model-name when using Gateway. When NOT using Gateway, it is normally provider:model-name--gateway flag when initializing your agent:
Tools
Pass tools in thetools array to let the agent call application logic or external services.
Define tools in local modules, import them into the agent entry, and add them to the definition. See Custom tools.
Middleware
Pass middleware in themiddleware array to add behavior around model calls, tool calls, and the agent lifecycle. Middleware runs in array order.
See Custom middleware.
Subagents
Pass subagent definitions insubagents when the agent should delegate specialized or context-heavy work. Each subagent can have its own prompt, model, and tools. See Subagents.
Permissions
Pass filesystem permission rules inpermissions to control which paths the agent’s built-in filesystem tools can read or write. See Permissions.
Human-in-the-loop
SetinterruptOn to pause before selected tool calls.
Use this for actions that require a person to approve, edit, or reject the call before it runs. See Human-in-the-loop.
Structured output
SetresponseFormat when the agent must return data that matches a schema instead of an unconstrained text response.
See Structured output.
Configure the system prompt, skills, memory, sandbox, identity, channels, and schedules through their project files rather than the agent definition. See Project structure.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

