Skip to main content
Create an agent project, test it locally in LangSmith Studio, and deploy it to managed LangSmith infrastructure with the mda CLI. The project folder contains your agent’s model, instructions, and tools. Managed Deep Agents supplies the Deep Agents harness and hosted runtime.
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.
  • Node.js and npm.
  • An API key for your model provider of choice.

Create and deploy an agent

1

Install the package

Install managed-deepagents. The package includes the mda CLI.
2

Create a project

Create a project and open its directory:
The files you edit in this quickstart are:
  • agent.ts: Defines and exports the agent. See Agent definition.
  • instructions.md: Contains the prompt that 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 chat 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 provider key to the deployment.
4

Configure the agent

Open agent.ts and set the agent name and model:
agent.ts
The model handles the agent’s language understanding and reasoning. The agent name is also the default deployment name. For model concepts and provider options, see Models.
5

Edit the instructions

Open instructions.md and describe how the agent should behave:
instructions.md
When you deploy, Managed Deep Agents syncs these instructions to LangSmith Context Hub, where you can update them without redeploying the agent.
6

Add an internet search tool

A tool is a function the agent can call to retrieve data or take an action. Choose your model provider’s server-side search or create a custom LangChain tool with Tavily.
For more information, see Custom tools.
7

Run locally

Install the project dependencies and start the agent:
mda dev loads the API keys from .env, starts a local Agent Server, and opens the agent in LangSmith Studio. Send messages in Studio to inspect model responses and tool calls. For more information, see Develop locally with LangSmith Studio.
8

Deploy the agent

Deploy the project:
Managed Deep Agents packages the project and runs it as a hosted deployment on LangSmith Agent Server. When deployment finishes, the CLI prints the deployment dashboard URL. Open it to view and test the deployed agent.For deployment options and secrets handling, see Deploy a Managed Deep Agent. To inspect the agent’s execution after it runs, use LangSmith observability.

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

Author Harbor tasks and compile the managed agent for Harbor.

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.

CLI reference

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