Skip to content

Commit 01dc60e

Browse files
sydney-runklemdrxy
andauthored
feat(cli): deepagents deploy (#2491)
# deepagents deploy ## Project layout ``` src/ AGENTS.md # required — system prompt + read-only /memories/AGENTS.md skills/ # optional — seeded under /skills/ mcp.json # optional — HTTP/SSE MCP servers deepagents.toml ``` ## `deepagents.toml` ```toml [agent] name = "my-agent" model = "anthropic:claude-sonnet-4-6" # [sandbox] is optional — omit to run tools in-process. [sandbox] provider = "langsmith" # none | langsmith | daytona | modal | runloop scope = "thread" # thread | assistant # template = "deepagents-deploy" # image = "python:3" ``` That's the entire surface. Skills, MCP servers, and model deps are auto-detected. ## CLI ```bash deepagents init # scaffold deepagents.toml in cwd deepagents dev --config src/deepagents.toml [--port 2024] deepagents deploy --config src/deepagents.toml [--dry-run] ``` ## Runtime - **System prompt:** `src/AGENTS.md` verbatim, baked in at build time. - **Memories:** `/memories/AGENTS.md` in the LangGraph store, namespace `(assistant_id, "memories")`. Read-only at runtime — edit the source file and redeploy. - **Skills:** `/skills/<skill>/...` in the store, namespace `(assistant_id, "skills")`. Also read-only. - **Sandbox:** default backend. Per-thread cache by default; set `[sandbox].scope = "assistant"` to share one sandbox across all threads of an assistant. Omit `[sandbox]` entirely to fall back to an in-process `StateBackend`. - **MCP:** HTTP/SSE only. Stdio is rejected at bundle time. ## Gotchas - `/memories/` and `/skills/` are read-only. Edit source files and redeploy. - `deepagents deploy` creates a new revision on every invocation (full cloud rebuild). Use `deepagents dev` for iteration. - The in-process sandbox cache does not survive process restarts; thread-scoped sandboxes get re-provisioned if the server recycles. - Custom Python tools are not supported — use MCP servers. --------- Co-authored-by: Mason Daugherty <github@mdrxy.com> Co-authored-by: Mason Daugherty <mason@langchain.dev>
1 parent c4f5989 commit 01dc60e

26 files changed

Lines changed: 2390 additions & 3 deletions

File tree

deepagents-deploy.md

Lines changed: 348 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,348 @@
1+
---
2+
name: deepagents-deploy
3+
description: Deploy a model-agnostic, open source agent harness to production with a single command.
4+
---
5+
6+
# Deep Agents Deploy (Beta)
7+
8+
> **Note:** `deepagents deploy` is currently in beta. APIs, configuration format, and behavior may change between releases.
9+
10+
Deploy a model-agnostic, open source agent to production with a single command.
11+
12+
Deep Agents Deploy is built on [Deep Agents](https://github.com/langchain-ai/deepagents) — an open source, model-agnostic agent harness. It handles orchestration, sandboxing, and endpoint setup so you can go from a local agent to a deployed service without managing infrastructure.
13+
14+
## What you're deploying
15+
16+
`deepagents deploy` takes your agent configuration and deploys it as a [LangSmith Deployment](https://docs.langchain.com/langsmith/deployment) — a horizontally scalable server with 30+ endpoints including MCP, A2A, Agent Protocol, human-in-the-loop, and memory APIs.
17+
18+
You configure your agent with a few parameters:
19+
20+
| Parameter | Description |
21+
| --- | --- |
22+
| **`model`** | The LLM to use. Any provider works — see [Supported Models](#supported-models). |
23+
| **`AGENTS.md`** | The system prompt, loaded at the start of each session. |
24+
| **`skills`** | [Agent Skills](https://agentskills.io/) for specialized knowledge and actions. Skills are synced into the sandbox so the agent can execute them at runtime. See [Skills docs](https://docs.langchain.com/oss/python/deepagents/skills). |
25+
| **`mcp.json`** | MCP tools (HTTPS/SSE). |
26+
| **`sandbox`** | Optional execution environment. See [Sandboxes](#sandboxes). |
27+
28+
## Project layout
29+
30+
```
31+
my-agent/
32+
.env # API keys and secrets
33+
AGENTS.md # required — system prompt
34+
skills/ # optional — agent skills
35+
mcp.json # optional — HTTP/SSE MCP servers
36+
deepagents.toml # agent configuration
37+
```
38+
39+
### `deepagents.toml`
40+
41+
```toml
42+
[agent]
43+
name = "my-agent"
44+
model = "anthropic:claude-sonnet-4-6"
45+
46+
# [sandbox] is optional — omit if not needed for skills or code execution.
47+
[sandbox]
48+
provider = "langsmith" # langsmith | daytona | modal | runloop
49+
scope = "thread" # thread | assistant
50+
```
51+
52+
Skills, MCP servers, and model dependencies are auto-detected.
53+
54+
### `.env`
55+
56+
Place a `.env` file alongside `deepagents.toml` with your API keys:
57+
58+
```bash
59+
cp .env.example .env
60+
```
61+
62+
```bash
63+
# Required — your model provider key
64+
ANTHROPIC_API_KEY=sk-...
65+
66+
# Required for deploy and LangSmith sandbox
67+
LANGSMITH_API_KEY=lsv2_...
68+
69+
# Optional — sandbox provider keys (only needed if using that provider)
70+
DAYTONA_API_KEY=...
71+
MODAL_TOKEN_ID=...
72+
MODAL_TOKEN_SECRET=...
73+
RUNLOOP_API_KEY=...
74+
```
75+
76+
## CLI
77+
78+
```bash
79+
deepagents init my-agent # scaffold my-agent/ with full project layout
80+
deepagents dev [--config deepagents.toml] [--port 2024]
81+
deepagents deploy [--config deepagents.toml] [--dry-run]
82+
```
83+
84+
### `deepagents init`
85+
86+
Scaffolds a new agent project with the full layout:
87+
88+
```bash
89+
deepagents init my-agent
90+
```
91+
92+
This creates:
93+
94+
| File | Purpose |
95+
| --- | --- |
96+
| `deepagents.toml` | Agent config — name, model, optional sandbox |
97+
| `AGENTS.md` | System prompt loaded at session start |
98+
| `.env` | API key template (`ANTHROPIC_API_KEY`, `LANGSMITH_API_KEY`) |
99+
| `mcp.json` | MCP server configuration (empty by default) |
100+
| `skills/` | Directory for [Agent Skills](https://agentskills.io/) |
101+
102+
After init, edit `AGENTS.md` with your agent's instructions and run `deepagents deploy`.
103+
104+
## Supported models
105+
106+
Deep Agents works with any model provider. Use the `provider:model-name` format in `deepagents.toml`.
107+
108+
### Anthropic
109+
110+
```toml
111+
model = "anthropic:claude-opus-4-6"
112+
model = "anthropic:claude-sonnet-4-6"
113+
model = "anthropic:claude-haiku-4-5-20251001"
114+
```
115+
116+
### OpenAI
117+
118+
```toml
119+
model = "openai:gpt-5.4"
120+
model = "openai:gpt-5.4-mini"
121+
model = "openai:o3"
122+
model = "openai:o4-mini"
123+
model = "openai:gpt-4.1"
124+
model = "openai:gpt-4o"
125+
```
126+
127+
### Google
128+
129+
```toml
130+
model = "google_genai:gemini-3.1-pro-preview"
131+
model = "google_genai:gemini-3-flash-preview"
132+
model = "google_genai:gemini-2.5-pro"
133+
model = "google_genai:gemini-2.5-flash"
134+
```
135+
136+
### Azure OpenAI
137+
138+
```toml
139+
model = "azure_openai:my-gpt4-deployment"
140+
```
141+
142+
### Amazon Bedrock
143+
144+
```toml
145+
model = "google_vertexai:claude-sonnet-4-6"
146+
```
147+
148+
### xAI
149+
150+
```toml
151+
model = "xai:grok-4"
152+
model = "xai:grok-3-mini-fast"
153+
```
154+
155+
### Fireworks
156+
157+
```toml
158+
model = "fireworks:fireworks/deepseek-v3p2"
159+
model = "fireworks:fireworks/qwen3-vl-235b-a22b-thinking"
160+
model = "fireworks:fireworks/minimax-m2p5"
161+
model = "fireworks:fireworks/kimi-k2p5"
162+
model = "fireworks:fireworks/glm-5"
163+
```
164+
165+
### Baseten
166+
167+
```toml
168+
model = "baseten:Qwen/Qwen3-Coder-480B-A35B-Instruct"
169+
model = "baseten:MiniMaxAI/MiniMax-M2.5"
170+
model = "baseten:moonshotai/Kimi-K2.5"
171+
model = "baseten:nvidia/Nemotron-120B-A12B"
172+
```
173+
174+
### Groq
175+
176+
```toml
177+
model = "groq:qwen/qwen3-32b"
178+
model = "groq:moonshotai/kimi-k2-instruct"
179+
```
180+
181+
### NVIDIA
182+
183+
```toml
184+
model = "nvidia:nvidia/nemotron-3-super-120b-a12b"
185+
```
186+
187+
### OpenRouter
188+
189+
```toml
190+
model = "openrouter:minimax/minimax-m2.7"
191+
model = "openrouter:nvidia/nemotron-3-super-120b-a12b"
192+
```
193+
194+
### Ollama (local models)
195+
196+
```toml
197+
model = "ollama:deepseek-v3.2:cloud"
198+
model = "ollama:qwen3-coder:480b-cloud"
199+
model = "ollama:nemotron-3-super"
200+
model = "ollama:glm-5"
201+
```
202+
203+
### Additional providers
204+
205+
Deep Agents also supports **Cohere**, **DeepSeek**, **Hugging Face**, **IBM**, **LiteLLM**, **Mistral AI**, **Perplexity**, and **Together AI**. Any provider supported by LangChain's `init_chat_model()` works out of the box.
206+
207+
| Provider | Environment Variable |
208+
| --- | --- |
209+
| Anthropic | `ANTHROPIC_API_KEY` |
210+
| OpenAI | `OPENAI_API_KEY` |
211+
| Google | `GOOGLE_API_KEY` |
212+
| Azure OpenAI | `AZURE_OPENAI_API_KEY` |
213+
| xAI | `XAI_API_KEY` |
214+
| Fireworks | `FIREWORKS_API_KEY` |
215+
| Baseten | `BASETEN_API_KEY` |
216+
| Groq | `GROQ_API_KEY` |
217+
| NVIDIA | `NVIDIA_API_KEY` |
218+
| OpenRouter | `OPENROUTER_API_KEY` |
219+
| Cohere | `COHERE_API_KEY` |
220+
| DeepSeek | `DEEPSEEK_API_KEY` |
221+
| Mistral AI | `MISTRAL_API_KEY` |
222+
| Together AI | `TOGETHER_API_KEY` |
223+
| Perplexity | `PERPLEXITYAI_API_KEY` |
224+
225+
## Sandboxes
226+
227+
Sandboxes provide isolated execution environments for your agent to run code and scripts.
228+
229+
### LangSmith (default)
230+
231+
No additional setup beyond your LangSmith API key.
232+
233+
```toml
234+
[sandbox]
235+
provider = "langsmith"
236+
template = "deepagents-cli"
237+
image = "python:3.12"
238+
```
239+
240+
```bash
241+
# .env
242+
LANGSMITH_API_KEY=lsv2_...
243+
```
244+
245+
Install: `pip install 'deepagents-cli[langsmith]'`
246+
247+
### Daytona
248+
249+
Cloud development environments with full workspace isolation.
250+
251+
```toml
252+
[sandbox]
253+
provider = "daytona"
254+
```
255+
256+
```bash
257+
# .env
258+
DAYTONA_API_KEY=...
259+
```
260+
261+
Install: `pip install 'deepagents-cli[daytona]'`
262+
263+
### Modal
264+
265+
Serverless compute — sandboxes spin up on demand.
266+
267+
```toml
268+
[sandbox]
269+
provider = "modal"
270+
```
271+
272+
```bash
273+
# .env (optional — can also use default Modal auth)
274+
MODAL_TOKEN_ID=...
275+
MODAL_TOKEN_SECRET=...
276+
```
277+
278+
Install: `pip install 'deepagents-cli[modal]'`
279+
280+
### Runloop
281+
282+
Isolated DevBox environments for agent execution.
283+
284+
```toml
285+
[sandbox]
286+
provider = "runloop"
287+
```
288+
289+
```bash
290+
# .env
291+
RUNLOOP_API_KEY=...
292+
```
293+
294+
Install: `pip install 'deepagents-cli[runloop]'`
295+
296+
### Sandbox scope
297+
298+
By default, each thread gets its own sandbox (`scope = "thread"`). Set `scope = "assistant"` to share one sandbox across all threads for the same assistant.
299+
300+
```toml
301+
[sandbox]
302+
provider = "langsmith"
303+
scope = "assistant" # shared across threads
304+
```
305+
306+
### No sandbox
307+
308+
Omit the `[sandbox]` section entirely if not needed for skills or code execution.
309+
310+
## Deployment endpoints
311+
312+
The deployed server exposes:
313+
314+
- **MCP** — call your agent as a tool from other agents
315+
- **A2A** — multi-agent orchestration via [A2A protocol](https://a2a-protocol.org/latest/)
316+
- **[Agent Protocol](https://github.com/langchain-ai/agent-protocol)** — standard API for building UIs
317+
- **[Human-in-the-loop](https://docs.langchain.com/oss/python/deepagents/human-in-the-loop)** — approval gates for sensitive actions
318+
- **[Memory](https://docs.langchain.com/oss/python/deepagents/memory)** — short-term and long-term memory access
319+
320+
## Open ecosystem
321+
322+
- **Open source harness** — MIT licensed, available for [Python](https://github.com/langchain-ai/deepagents) and [TypeScript](https://github.com/langchain-ai/deepagentsjs)
323+
- **[AGENTS.md](https://agents.md/)** — open standard for agent instructions
324+
- **[Agent Skills](https://agentskills.io/)** — open standard for agent knowledge and actions
325+
- **Any model, any sandbox** — no provider lock-in
326+
- **Open protocols** — MCP, A2A, Agent Protocol
327+
- **Self-hostable** — LangSmith Deployments can be self-hosted so memory stays in your infrastructure
328+
329+
## Comparing to Claude Managed Agents
330+
331+
| | Deep Agents Deploy | Claude Managed Agents |
332+
| --- | --- | --- |
333+
| Model Support | OpenAI, Anthropic, Google, Bedrock, Azure, Fireworks, Baseten, OpenRouter, many more | Anthropic only |
334+
| Harness | Open source (MIT) | Proprietary, closed source |
335+
| Sandbox | LangSmith, Daytona, Modal, Runloop, or custom | Built in |
336+
| MCP Support | Yes | Yes |
337+
| Skill Support | Yes | Yes |
338+
| AGENTS.md Support | Yes | No |
339+
| Agent Endpoints | MCP, A2A, Agent Protocol | Proprietary |
340+
| Self Hosting | Yes | No |
341+
342+
## Gotchas
343+
344+
- **Read-only at runtime:** `/memories/` and `/skills/` are synced into the sandbox but cannot be edited at runtime. Edit source files and redeploy.
345+
- **Full rebuild on deploy:** `deepagents deploy` creates a new revision on every invocation. Use `deepagents dev` for local iteration.
346+
- **Sandbox lifecycle:** Thread-scoped sandboxes are provisioned per thread and will be re-created if the server restarts. Use `scope = "assistant"` if you need sandbox state that persists across threads.
347+
- **MCP: HTTP/SSE only.** Stdio transports are rejected at bundle time.
348+
- **No custom Python tools.** Use MCP servers to expose custom tool logic.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Model provider API key (required)
2+
ANTHROPIC_API_KEY=
3+
4+
# LangSmith API key (required for deploy and sandbox)
5+
LANGSMITH_API_KEY=

0 commit comments

Comments
 (0)