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

# Managed Deep Agents quickstart

> Create and deploy your first Managed Deep Agent with the mda CLI.

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.

<Note>
  Managed Deep Agents is in **public [beta](/langsmith/release-stages)** and available on [LangSmith Cloud](/langsmith/cloud) in the US region only.
</Note>

## Prerequisites

Before you start, make sure you have:

* An organization with Managed Deep Agents public beta access.
* A [LangSmith API key](/langsmith/create-account-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

<Steps>
  <Step title="Install the package" id="install-the-package">
    Install `managed-deepagents` for Python or TypeScript. Both packages include the `mda` CLI.

    <CodeGroup>
      ```bash uv theme={null}
      uv tool install --prerelease allow managed-deepagents
      ```

      ```bash npm theme={null}
      npm install -g managed-deepagents@dev
      ```
    </CodeGroup>
  </Step>

  <Step title="Create a project" id="create-a-project">
    Create a project and open its directory:

    ```bash theme={null}
    mda init research-assistant
    cd research-assistant
    ```

    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](/langsmith/managed-deep-agents-project-structure).
  </Step>

  <Step title="Add API keys" id="add-api-keys">
    Add your LangSmith API key and model provider API key to `.env`:

    ```text .env theme={null}
    LANGSMITH_API_KEY=<LANGSMITH_API_KEY>
    OPENAI_API_KEY=<OPENAI_API_KEY>
    ```

    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.
  </Step>

  <Step title="Configure the agent" id="configure-the-agent">
    Open `agent.py` or `agent.ts` and set the agent name and model:

    <CodeGroup>
      ```python agent.py theme={null}
      from managed_deepagents import define_deep_agent

      agent = define_deep_agent(
          name="research-assistant",
          model="openai:gpt-5.5",
      )
      ```

      ```ts agent.ts theme={null}
      import { defineDeepAgent } from "managed-deepagents";

      export const agent = defineDeepAgent({
        name: "research-assistant",
        model: "openai:gpt-5.5",
      });
      ```
    </CodeGroup>

    The agent name is also the default deployment name.
  </Step>

  <Step title="Edit the instructions" id="edit-the-instructions">
    Open `instructions.md` and describe how the agent should behave:

    ```markdown instructions.md theme={null}
    # Research assistant

    You are a careful research assistant. Search for sources, keep notes, and return
    concise answers with citations.
    ```
  </Step>

  <Step title="Run locally" id="run-locally">
    Install the project dependencies and start the agent:

    <CodeGroup>
      ```bash uv theme={null}
      uv sync
      mda dev .
      ```

      ```bash npm theme={null}
      npm install
      mda dev .
      ```
    </CodeGroup>

    `mda dev` loads the API keys from `.env`. Open the URL printed by the CLI to test the agent.
  </Step>

  <Step title="Deploy the agent" id="deploy-the-agent">
    Deploy the project:

    ```bash theme={null}
    mda deploy .
    ```

    When deployment finishes, the CLI prints a LangSmith URL. Open it to view and test the deployed agent.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Tutorial" icon="book" href="/langsmith/managed-deep-agents-tutorial">
    Build a scheduled research agent from an empty directory.
  </Card>

  <Card title="Identity" icon="fingerprint" href="/langsmith/managed-deep-agents-identity">
    Authenticate callers and provide private threads.
  </Card>

  <Card title="Memory" icon="brain" href="/langsmith/managed-deep-agents-memory">
    Persist preferences across threads with Context Hub `/memories`.
  </Card>

  <Card title="Evals" icon="flask" href="/langsmith/managed-deep-agents-evals">
    Compile a Harbor handoff and run Harbor-style tasks.
  </Card>

  <Card title="Custom tools" icon="tool" href="/langsmith/managed-deep-agents-tools">
    Add authored LangChain tools from your project source.
  </Card>

  <Card title="Custom middleware" icon="code" href="/langsmith/managed-deep-agents-middleware">
    Add built-in or custom middleware around model and tool calls.
  </Card>

  <Card title="Schedules" icon="calendar" href="/langsmith/managed-deep-agents-schedules">
    Run agents on managed cron schedules.
  </Card>

  <Card title="Deploy an agent" icon="upload" href="/langsmith/managed-deep-agents-deploy">
    Test and deploy Managed Deep Agents with `mda`.
  </Card>

  <Card title="Examples" icon="apps" href="/langsmith/managed-deep-agents-examples">
    Explore a complete project that combines common features.
  </Card>

  <Card title="CLI reference" icon="terminal" href="/langsmith/managed-deep-agents-cli">
    Review `mda init`, `mda evals`, `mda dev`, and `mda deploy`.
  </Card>
</CardGroup>

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more 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-quickstart.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
