Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 68 additions & 12 deletions src/oss/deepagents/deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Deep Agents Deploy takes your agent configuration and deploys it as a [LangSmith
| **`model`** | The LLM to use. Any provider works — see [supported models](/oss/deepagents/models#supported-models). |
| **`AGENTS.md`** | The system prompt, loaded at the start of each session. |
| **`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](/oss/deepagents/skills). |
| **`user/`** | Per-user writable memory. If present, a single `AGENTS.md` is seeded per user (from `user/AGENTS.md` if provided, otherwise empty). Writable at runtime. Preloaded into the agent's context via the memory middleware. |
Comment thread
sydney-runkle marked this conversation as resolved.
Outdated
| **`mcp.json`** | MCP tools (HTTP/SSE). See [MCP docs](/oss/langchain/mcp). |
| **`sandbox`** | Optional execution environment. See [sandbox providers](#sandbox-providers). |
Comment thread
sydney-runkle marked this conversation as resolved.
Outdated

Expand Down Expand Up @@ -87,7 +88,7 @@ This creates the following files:
| `mcp.json` | MCP server configuration (empty by default) |
| `skills/` | Directory for [Agent Skills](https://agentskills.io/), with an example `review` skill |

After init, edit `AGENTS.md` with your agent's instructions and run `deepagents deploy`.
After init, edit `AGENTS.md` with your agent's instructions and run `deepagents deploy`. Optionally add a `user/` directory with per-user memory templates — see [User Memory](#user-memory).

## Project layout

Expand All @@ -99,17 +100,20 @@ my-agent/
├── AGENTS.md
├── .env
├── mcp.json
└── skills/
├── code-review/
│ └── SKILL.md
└── data-analysis/
└── SKILL.md
├── skills/
│ ├── code-review/
│ │ └── SKILL.md
│ └── data-analysis/
│ └── SKILL.md
└── user/
└── AGENTS.md
```

| File/directory | Purpose | Required |
| --- | --- | --- |
| `AGENTS.md` | [Memory](/oss/deepagents/memory) for the agent. Provides persistent context (project conventions, instructions, preferences) that is always loaded at startup. | Yes |
| `skills/` | Directory of [skill](/oss/deepagents/skills) definitions. Each subdirectory should contain a `SKILL.md` file. | No |
| `AGENTS.md` | [Memory](/oss/deepagents/memory) for the agent. Provides persistent context (project conventions, instructions, preferences) that is always loaded at startup. Read-only at runtime. | Yes |
| `skills/` | Directory of [skill](/oss/deepagents/skills) definitions. Each subdirectory should contain a `SKILL.md` file. Read-only at runtime. | No |
| `user/` | Per-user writable memory. When present, a single `AGENTS.md` is seeded per user (from `user/AGENTS.md` if provided, otherwise empty). Writable at runtime — the agent can update this file as it learns about the user. Preloaded into the agent's context at the start of each session. | No |
Comment thread
sydney-runkle marked this conversation as resolved.
Outdated
| `mcp.json` | [MCP](https://modelcontextprotocol.io/) server configuration. Only `http` and `sse` transports are supported in deployed contexts. | No |
| `.env` | Environment variables (API keys, secrets). Placed alongside `deepagents.toml` at the project root. | No |

Expand Down Expand Up @@ -147,9 +151,10 @@ model = "anthropic:claude-sonnet-4-6"
The `name` field is the only required value in the entire configuration file. Everything else has defaults.
</Note>

Skills, MCP servers, and model dependencies are auto-detected from the project layout — you don't declare them in `deepagents.toml`:
Skills, user memories, MCP servers, and model dependencies are auto-detected from the project layout — you don't declare them in `deepagents.toml`:

- **Skills**: the bundler recursively scans `skills/`, skipping hidden dotfiles, and bundles the rest.
- **User memory**: if `user/` exists, a single `AGENTS.md` is bundled as per-user memory (from `user/AGENTS.md` if present, otherwise empty). At runtime, each user gets their own copy (seeded on first access, never overwritten). The agent can read and write this file.
Comment thread
sydney-runkle marked this conversation as resolved.
Outdated
- **MCP servers**: if `mcp.json` exists, it is included in the deployment and [`langchain-mcp-adapters`](https://pypi.org/project/langchain-mcp-adapters/) is added as a dependency. Only HTTP/SSE transports are supported (stdio is rejected at bundle time).
- **Model dependencies**: the `provider:` prefix in the `model` field determines the required `langchain-*` package (e.g., `anthropic` -> `langchain-anthropic`).
- **Sandbox dependencies**: the `[sandbox].provider` value maps to its partner package (e.g., `daytona` -> `langchain-daytona`).
Expand Down Expand Up @@ -217,23 +222,74 @@ The deployed server exposes:

## Examples

A content writing agent that only needs a model and system prompt, with no code execution:
A content writing agent with per-user preferences that the agent can update:

```toml deepagents.toml
[agent]
name = "deepagents-deploy-content-writer"
model = "anthropic:claude-sonnet-4-6"
model = "openai:gpt-4.1"
Comment thread
sydney-runkle marked this conversation as resolved.
Outdated
```

```txt
my-content-writer/
├── deepagents.toml
├── AGENTS.md
├── skills/
│ ├── blog-post/SKILL.md
│ └── social-media/SKILL.md
└── user/
└── AGENTS.md # writable — agent learns user preferences
```

A coding agent with a LangSmith sandbox for running code:

```toml deepagents.toml
[agent]
name = "deepagents-deploy-coding-agent"
model = "anthropic:claude-sonnet-4-6"
model = "anthropic:claude-sonnet-4-5"
Comment thread
sydney-runkle marked this conversation as resolved.
Outdated

[sandbox]
provider = "langsmith"
template = "coding-agent"
image = "python:3.12"
```

## User Memory

User memory gives each user their own writable `AGENTS.md` that persists across conversations. To enable it, create a `user/` directory at your project root:

```txt
user/
└── AGENTS.md # optional — seeded as empty if not provided
```

If the `user/` directory exists (even if empty), every user gets their own `AGENTS.md` at `/memories/user/AGENTS.md`. If you provide `user/AGENTS.md`, its contents are used as the initial template; otherwise an empty file is seeded.

At runtime, user memory is scoped per user via custom auth (`runtime.server_info.user.identity`). The first time a user interacts with the agent, their namespace is seeded with the template. Subsequent interactions reuse the existing file — the agent's edits persist, and redeployments never overwrite user data.

### How it works

1. **Bundle time** — the bundler reads `user/AGENTS.md` (or uses an empty string) and includes it in the seed payload.
2. **Runtime (first access)** — when a user\_id is seen for the first time, the `AGENTS.md` template is written to the store under that user's namespace. Existing entries are never overwritten.
Comment thread
sydney-runkle marked this conversation as resolved.
Outdated
3. **Preloaded** — the user `AGENTS.md` is passed to the memory middleware, so the agent sees its contents in context at the start of every conversation.
4. **Writable** — the agent can update it via `edit_file`. The shared `AGENTS.md` and skills are read-only.
Comment thread
sydney-runkle marked this conversation as resolved.
Outdated

### Permissions

| Path | Writable | Scope |
| --- | --- | --- |
| `/memories/AGENTS.md` | No | Shared (assistant-scoped) |
| `/memories/skills/**` | No | Shared (assistant-scoped) |
| `/memories/user/**` | Yes | Per-user (user\_id-scoped) |
Comment thread
sydney-runkle marked this conversation as resolved.
Outdated

### User identity

The `user_id` is resolved from custom auth via `runtime.user.identity`. The platform injects the authenticated user's identity automatically — no need to pass it through `configurable`. If no authenticated user is present, user memory features are gracefully skipped for that invocation.

## Gotchas

- **AGENTS.md and skills are read-only at runtime.** Edit source files and redeploy to update them. The per-user `AGENTS.md` at `/memories/user/AGENTS.md` is the exception — it is writable by the agent.
- **Full rebuild on deploy:** `deepagents deploy` creates a new revision on every invocation. Use `deepagents dev` for local iteration.
- **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.
- **MCP: HTTP/SSE only.** Stdio transports are rejected at bundle time.
- **No custom Python tools.** Use MCP servers to expose custom tool logic.
Comment thread
sydney-runkle marked this conversation as resolved.
Loading