> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-docsby-1791319236-3be7a15.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Managed Deep Agents

> Build your agent as a directory of files while LangSmith runs the harness and runtime.

Managed Deep Agents (MDA) is the simplest way to build and deploy production agents. You focus on what your agent does. MDA runs it. There are no servers to run and no infrastructure to wire together.

You write the agent's intelligence: its instructions, the tools it can call, the skills it follows, and you select the model that drives it. MDA provides everything underneath:

* **The Deep Agents harness**: The agent loop that plans, calls tools, manages a filesystem, and delegates to subagents. See [Deep Agents](/oss/javascript/deepagents/overview).
* **A managed runtime**: Every deployment runs on [LangSmith Agent Server](/langsmith/agent-server-overview). You get the Agent Server API, threads, runs, streaming, and the [MCP endpoint](/langsmith/javascript/managed-deep-agents-mcp-endpoint) without operating the server yourself.

```mermaid actions={false} theme={null}
%%{init: {"theme":"base","themeVariables":{"fontFamily":"Inter, system-ui, sans-serif","lineColor":"#40668D","primaryColor":"#E5F4FF","primaryTextColor":"#030710","primaryBorderColor":"#006DDD","clusterBkg":"transparent"}}}%%
flowchart LR
    subgraph you["<b>You provide</b>"]
        Logic("<div style='text-align:left;padding:2px 6px'><b>Business logic</b><br/>&nbsp;•&nbsp; Instructions<br/>&nbsp;•&nbsp; Tools<br/>&nbsp;•&nbsp; Skills<br/>&nbsp;•&nbsp; Model</div>")
    end
    subgraph mda["<b>Managed Deep Agents</b>"]
        direction TB
        Harness("<div style='text-align:left;padding:2px 6px'><b>Deep Agents harness</b><br/>&nbsp;•&nbsp; Agent loop<br/>&nbsp;•&nbsp; Filesystem<br/>&nbsp;•&nbsp; Subagents</div>")
        Runtime("<div style='text-align:left;padding:2px 6px'><b>Managed runtime</b><br/>&nbsp;•&nbsp; Agent Server<br/>&nbsp;•&nbsp; Sandboxes<br/>&nbsp;•&nbsp; Schedules</div>")
        Harness --> Runtime
    end

    Logic ==> mda

    classDef neutral fill:#F2FAFF,stroke:#40668D,stroke-width:2px,color:#2F4B68,rx:10,ry:10
    classDef process fill:#E5F4FF,stroke:#006DDD,stroke-width:2px,color:#030710,rx:10,ry:10

    class Logic neutral
    class Harness,Runtime process

    style you fill:none,stroke:#40668D,stroke-width:1.5px,stroke-dasharray:5 4
    style mda fill:none,stroke:#40668D,stroke-width:1.5px,stroke-dasharray:5 4
```

## Example agent

A managed deep agent consists of a project folder that contains the business logic for its behavior:

When you upload this folder with the `mda` CLI, it will automatically run on managed LangSmith infrastructure.
You provide the business logic, and Managed Deep Agents provides the agent harness and production infrastructure.

To get started, see the [Managed Deep Agents quickstart](/langsmith/javascript/managed-deep-agents-quickstart).

## Core capabilities

Each part of the agent maps to a file or directory. Add the ones your agent needs:

| Capability | Path | Description |
| - | - | - |
| [Model and configuration](/langsmith/javascript/managed-deep-agents-agent-definition) | `agent.ts` | The model and core options. Required. |
| [Instructions](/langsmith/javascript/managed-deep-agents-instructions) | `instructions.md` | The system prompt that defines how the agent behaves. |
| [Skills](/langsmith/javascript/managed-deep-agents-skills) | `skills/` | Task-specific playbooks the agent loads when they are relevant. |
| [Tools](/langsmith/javascript/managed-deep-agents-tools) | `tools/` | Functions the agent calls to run your application logic or reach external services. |
| [MCP connectors](/langsmith/javascript/managed-deep-agents-mcp-connectors) | `tools/mcp.ts` | Remote MCP servers that provide tools to the agent. |
| [Middleware](/langsmith/javascript/managed-deep-agents-middleware) | `middleware/` | Custom logic that runs around model and tool calls. |
| [Sandbox](/langsmith/javascript/managed-deep-agents-sandboxes) | `sandbox/` | An isolated filesystem and shell for running agent-written code. |
| [Memory](/langsmith/javascript/managed-deep-agents-memory) | `memory.ts` | Preferences and knowledge that persist across threads. |
| [Identity](/langsmith/javascript/managed-deep-agents-identity) | `identity.ts` | Per-caller private threads, memory, and credentials for multi-user deployments. |
| [Channels](/langsmith/javascript/managed-deep-agents-channels) | `channels/` | Connections to messaging services, such as Slack, that start runs and receive responses. |
| [Schedules](/langsmith/javascript/managed-deep-agents-schedules) | `schedules/` | Managed cron schedules that run the agent on a recurring basis. |
| [Evals](/langsmith/javascript/managed-deep-agents-evals) | `evals/` | Harbor tasks that test the agent. |

For the full layout, see [Project structure](/langsmith/javascript/managed-deep-agents-project-structure). Instructions, skills, and optional durable memory are stored in [Context Hub](/langsmith/javascript/managed-deep-agents-context-hub).

## Relationship to Deep Agents

Managed Deep Agents runs the open source [Deep Agents](/oss/javascript/deepagents/overview) harness rather than a second framework. The agent loop, filesystem tools, subagents, and skills are the same, so there is no second API to learn and an agent you already built keeps working.

Managed Deep Agents adds the layer around the agent. The sandbox, durable memory, channels, and schedules above are declarations in a project file rather than services you build and operate. [Connections](/langsmith/javascript/managed-deep-agents-connections) run OAuth, so end users authorize their own accounts instead of you provisioning credentials for each one. LangSmith hosts the result on [Agent Server](/langsmith/agent-server-overview). In the code, the difference is narrower: who compiles the agent.

* [createDeepAgent](https://reference.langchain.com/javascript/deepagents/agent/createDeepAgent) returns a compiled agent. You run it, and you own the backend, store, checkpointer, and server around it.
* `defineDeepAgent` returns a definition. The `mda` CLI hands it to the managed runtime, which supplies those pieces along with memory, skills, and the system prompt, then compiles the agent with [createDeepAgent](https://reference.langchain.com/javascript/deepagents/agent/createDeepAgent).

So `defineDeepAgent` takes the same options minus the managed ones, plus a required static `name`. Every `define*` function works this way: declare what the agent needs, and leave the lifecycle to the runtime.

Stay on Deep Agents when you run the agent yourself or need a [backend](/oss/javascript/deepagents/backends), store, or checkpointer of your own. For a side-by-side comparison of the two, and the steps to convert an agent you already built, see [Move from Deep Agents](/langsmith/javascript/managed-deep-agents-migrate).

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/langsmith/javascript/managed-deep-agents-quickstart">
    Create and deploy your first Managed Deep Agent with the `mda` CLI.
  </Card>

  <Card title="Tutorial" icon="book" href="/langsmith/javascript/managed-deep-agents-tutorial">
    Add a custom search tool, durable memory, and a daily schedule.
  </Card>

  <Card title="Agent Server" icon="server" href="/langsmith/agent-server-overview">
    Explore the runtime that hosts Managed Deep Agents deployments.
  </Card>

  <Card title="MCP endpoint" icon="plug" href="/langsmith/javascript/managed-deep-agents-mcp-endpoint">
    Call a deployed agent as a tool from Claude Code or another MCP client.
  </Card>
</CardGroup>

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to your agent of choice via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/managed-deep-agents-overview.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
