Help deploying createDeepAgent based agent on LangGraph Cloud

Hi,

TLDR: Any docs related to deploying an agent created with createDeepAgent on LangGraph Cloud?

Context: I already have a conventional LangGraph workflow agent deployed on LangGraph Cloud. However I am creating a new graph but want to use the createDeepAgent because I want to build a more sophisticated agent with subagents, memory etc.

Is there a way to host such an agent via LangGraph cloud, if so where are the docs to do so. I am using the JS/TS version of LangChain/LangGraph

Thanks!

Hiya! A deep agent is a compiled Pregel object, same as any LangGraph workflow, meaning that you can deploy it directly by pointing to the agent variable directly in the config, pushing that to a repo, and connecting to that repo for auto deployment.

A longer response from Chat LangChain that happens to be mostly correct is below:

Example Project Structure

my-deep-agent/
├── src/
│   └── agent.ts          # Your createDeepAgent code
├── package.json
└── langgraph.json

1. Create Your Deep Agent

// src/agent.ts
import { createDeepAgent, CompositeBackend, StateBackend, StoreBackend } from "deepagents";
import { ChatAnthropic } from "@langchain/anthropic";

// Define subagents for your sophisticated agent
const researchSubagent = {
  name: "research-agent",
  description: "Conducts in-depth research using web search",
  systemPrompt: "You are a thorough researcher...",
  tools: [internetSearch],
};

// Create and export the deep agent with memory
export const agent = createDeepAgent({
  model: new ChatAnthropic({ model: "claude-sonnet-4-5-20250929" }),
  subagents: [researchSubagent],
  // CompositeBackend gives you both ephemeral and persistent memory
  backend: (rt) => new CompositeBackend(
    new StateBackend(rt),  // Ephemeral (single thread)
    { "/memories/": new StoreBackend(rt) }  // Persistent (across threads)
  ),
  systemPrompt: "You are a sophisticated agent with memory and subagents...",
});

2. Configure langgraph.json

{
  "node_version": "20",
  "dependencies": ["."],
  "graphs": {
    "deep_agent": "./src/agent.ts:agent"
  },
  "env": ".env"
}

The key is the graphs entry - it references your exported agent variable with the format ./path/to/file.ts:exportedVariableName.

3. Deploy via LangSmith Deployment

From your project directory:

# Test locally first
npx @langchain/langgraph-cli dev

# Then deploy to LangSmith
# (Connect your GitHub repo via the LangSmith UI)

Some relevant links:

1 Like