Skip to main content
Create, test, and deploy a hosted agent with the mda CLI. You configure the model and instructions, run the agent locally, then deploy it to LangSmith.
Managed Deep Agents is in public beta and available on LangSmith Cloud in the US region only.

Prerequisites

Before you start, make sure you have:
  • An organization with Managed Deep Agents public beta access.
  • A LangSmith API key.
  • Python and uv for Python projects, or Node.js and npm for TypeScript projects.
  • An API key for your model provider of choice.

Create and deploy an agent

1

Install the package

Install managed-deepagents for Python or TypeScript. Both packages include the mda CLI.
2

Create a project

Create a project and open its directory:
The files you edit in this quickstart are:
  • agent.py or agent.ts: Configures the agent.
  • instructions.md: Describes how the agent should behave.
  • .env: Stores API keys for local development and deployment. Do not commit this file.
For all generated files, see Project structure.
3

Add API keys

Add your LangSmith API key and model provider API key to .env:
.env
This example uses an OpenAI model. If you choose another model provider, add the API key required by that provider instead. mda deploy uses the LangSmith API key to deploy the agent and adds the model provider key to the deployment.
4

Configure the agent

Open agent.py or agent.ts and set the agent name and model:
The agent name is also the default deployment name.
5

Edit the instructions

Open instructions.md and describe how the agent should behave:
instructions.md
6

Run locally

Install the project dependencies and start the agent:
mda dev loads the API keys from .env. Open the URL printed by the CLI to test the agent.
7

Deploy the agent

Deploy the project:
When deployment finishes, the CLI prints a LangSmith URL. Open it to view and test the deployed agent.

Next steps

Tutorial

Build a scheduled research agent from an empty directory.

Identity

Authenticate callers and provide private threads.

Memory

Persist preferences across threads with Context Hub /memories.

Evals

Compile a Harbor handoff and run Harbor-style tasks.

Custom tools

Add authored LangChain tools from your project source.

Custom middleware

Add built-in or custom middleware around model and tool calls.

Schedules

Run agents on managed cron schedules.

Deploy an agent

Test and deploy Managed Deep Agents with mda.

Examples

Explore a complete project that combines common features.

CLI reference

Review mda init, mda evals, mda dev, and mda deploy.