Managed Deep Agents is in public beta and available on LangSmith Cloud in the US region only.
Decide whether to move
Managed Deep Agents runs the same harness, so the agent itself behaves the same. Tools, middleware, and subagents work as they do today. Moving adds the layer around the agent: Slack and other chat surfaces, OAuth for end users, scheduled runs, a managed sandbox, and durable memory become declarations in a project file rather than services you build and operate. Move an agent when you want that layer without running it. Stay on Deep Agents when you need to own it.
The harness is the same either way, so building on Deep Agents first and moving when the agent is ready for production is a normal path. See Going to production.
Understand what changes
create_deep_agent compiles an agent in your process, so it takes the backend, store, and checkpointer as parameters.define_deep_agent returns a definition instead, and the managed runtime compiles it. The definition is configuration rather than a runnable agent: the mda CLI consumes it on mda dev and mda deploy, and the runtime supplies the managed pieces at that point. For the full picture, see Relationship to Deep Agents.
Check what does not carry over
Most agents move without changes beyond the entry file. Four cases need a decision first:- Custom backends: A hand-written
BackendProtocolimplementation has no equivalent. The runtime owns the backend, and the managed sandbox is the only choice for giving the agent a filesystem and shell. - Your own store or checkpointer: Threads, runs, and persistence come from Agent Server. An agent that depends on a specific store implementation needs that logic moved into a tool or middleware.
- Custom application code and routes: Managed Deep Agents hosts the agent, not an arbitrary web application. For custom routes, advanced authentication, or application code around the agent, use a LangSmith deployment instead.
- Custom state schemas in Python:
define_deep_agentdoes not acceptstate_schema, so an agent that extendsDeepAgentStatecannot move as is. The TypeScriptdefineDeepAgentdoes acceptstateSchema.
Convert a Deep Agents project into a Managed Deep Agents project.
Map the parameters
Most of the surface transfers todefine_deep_agent unchanged, under the same names: model, tools, middleware, subagents, interrupt_on, response_format, context_schema, cache, and debug. Leave the tool and middleware modules where they already live and keep importing them from the agent entry.
define_deep_agent adds one required parameter. Pass name a static string that starts with a letter and contains only letters, numbers, underscores, or hyphens. Managed Deep Agents uses it as the agent’s graph ID and the default deployment name.
The rest move to a project file or become the runtime’s job:
Deep Agents backends are pluggable, and the managed runtime supplies its own. A project that declares
sandbox/ gets a managed sandbox for the agent filesystem and shell. A project without one gets thread-scoped agent state, alongside read-only Context Hub mounts for instructions, skills, and memory. There is no other choice of backend, so an agent that depends on a specific one stays on Deep Agents.
Move an agent
Convert the project in place. The existing layout, module structure, and dependencies stay as they are:mda build merges the dependencies it needs into the project manifest rather than replacing it.
To install the mda CLI first, see the quickstart.
1
Add the SDK to the project
mda --version reports.If the project builds with Hatchling, allow direct references in pyproject.toml:pyproject.toml
mda build rewrites the managed-deepagents requirement into a path reference to the runtime it stages, and Hatchling rejects that by default. Without the setting, mda build still succeeds and mda dev fails while installing the project, with Dependency #N of field project.dependencies cannot be a direct reference. Projects scaffolded by mda init declare no build backend, so the setting only comes up when converting an existing project.Leave every dependency the project already declares in place. Tools and middleware keep importing what they always did.2
Rewrite the agent entry
Convert the call site using the table above, in a file named The entry must export a variable named
agent.py at the project root:agent.py (before)
agent.py (after)
agent, and the definition call itself has to live in this file. A root entry that re-exports the definition from another module fails, and the error names name rather than the real problem.A src/ layout is otherwise fine. Keep the packages where they are and import them from the root entry.3
Move the prompt, skills, and memory into files
Put the system prompt in Durable memory is opt-in, and a project without the file mounts none. The scope is the only knob:
instructions.md at the project root. Give each skill its own directory under skills/ with a SKILL.md.If the agent needs memory that persists across threads, declare it in a root file exporting a variable named memory:memory.py
"agent" mounts one tree that every caller of the deployment shares. To control what the agent keeps there, write a memory policy into instructions.md. See Guide what to remember.4
Declare a sandbox
An agent that passed a sandbox To provision a snapshot, add
backend needs a managed sandbox declaration instead. Create the directory and declare it:sandbox/__init__.py
sandbox/setup.sh. Skip this step for an agent that had no sandbox backend. See Sandboxes.5
Declare identity
(Optional) To give each caller private threads and downstream credentials, add a root identity declaration:Without the file the deployment runs with no managed auth, which
identity.py
mda dev reports as Identity none. See Identity.6
Set credentials and ignore the build output
Put the model and tool API keys in a
.env file at the project root. A value exported in your shell is not read. For shared workspace secrets and OAuth, use connections instead.Add the build directory to .gitignore:.gitignore
mda build copies the whole project root into .mda/build, and mda deploy uploads it. Anything sitting next to the agent entry ships with the agent, so move what the deployment does not need out of the project root.7
Compile, then run
Compile without deploying:Then start it locally:See Local development.
mda build does not inspect the definition call, so it exits 0 even when a managed parameter is still there. A leftover parameter surfaces when the graph loads under mda dev.8
Deploy
See also
- Relationship to Deep Agents: why the two entry points differ.
- Agent definition: the full parameter reference.
- Project structure: where each file goes.
- Going to production: deployment options for Deep Agents.
Connect these docs to your agent of choice via MCP for real-time answers.

