You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add user-scoped memory docs to deepagents deploy page
Mirrors the user memory feature spec from langchain-ai/deepagents#2708
into the docs site, covering project layout, configuration, permissions,
and runtime behavior.
Co-authored-by: Sydney Runkle <54324534+sydney-runkle@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/oss/deepagents/deploy.mdx
+68-12Lines changed: 68 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@ Deep Agents Deploy takes your agent configuration and deploys it as a [LangSmith
38
38
|**`model`**| The LLM to use. Any provider works β see [supported models](/oss/deepagents/models#supported-models). |
39
39
|**`AGENTS.md`**| The system prompt, loaded at the start of each session. |
40
40
|**`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). |
41
+
|**`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. |
41
42
|**`mcp.json`**| MCP tools (HTTP/SSE). See [MCP docs](/oss/langchain/mcp). |
42
43
|**`sandbox`**| Optional execution environment. See [sandbox providers](#sandbox-providers). |
43
44
@@ -87,7 +88,7 @@ This creates the following files:
87
88
|`mcp.json`| MCP server configuration (empty by default) |
88
89
|`skills/`| Directory for [Agent Skills](https://agentskills.io/), with an example `review` skill |
89
90
90
-
After init, edit `AGENTS.md` with your agent's instructions and run `deepagents deploy`.
91
+
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).
91
92
92
93
## Project layout
93
94
@@ -99,17 +100,20 @@ my-agent/
99
100
βββ AGENTS.md
100
101
βββ .env
101
102
βββ mcp.json
102
-
βββ skills/
103
-
βββ code-review/
104
-
β βββ SKILL.md
105
-
βββ data-analysis/
106
-
βββ SKILL.md
103
+
βββ skills/
104
+
β βββ code-review/
105
+
β β βββ SKILL.md
106
+
β βββ data-analysis/
107
+
β βββ SKILL.md
108
+
βββ user/
109
+
βββ AGENTS.md
107
110
```
108
111
109
112
| File/directory | Purpose | Required |
110
113
| --- | --- | --- |
111
-
|`AGENTS.md`|[Memory](/oss/deepagents/memory) for the agent. Provides persistent context (project conventions, instructions, preferences) that is always loaded at startup. | Yes |
112
-
|`skills/`| Directory of [skill](/oss/deepagents/skills) definitions. Each subdirectory should contain a `SKILL.md` file. | No |
114
+
|`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 |
115
+
|`skills/`| Directory of [skill](/oss/deepagents/skills) definitions. Each subdirectory should contain a `SKILL.md` file. Read-only at runtime. | No |
116
+
|`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 |
113
117
|`mcp.json`|[MCP](https://modelcontextprotocol.io/) server configuration. Only `http` and `sse` transports are supported in deployed contexts. | No |
114
118
|`.env`| Environment variables (API keys, secrets). Placed alongside `deepagents.toml` at the project root. | No |
115
119
@@ -147,9 +151,10 @@ model = "anthropic:claude-sonnet-4-6"
147
151
The `name` field is the only required value in the entire configuration file. Everything else has defaults.
148
152
</Note>
149
153
150
-
Skills, MCP servers, and model dependencies are auto-detected from the project layout β you don't declare them in `deepagents.toml`:
154
+
Skills, user memories, MCP servers, and model dependencies are auto-detected from the project layout β you don't declare them in `deepagents.toml`:
151
155
152
156
-**Skills**: the bundler recursively scans `skills/`, skipping hidden dotfiles, and bundles the rest.
157
+
-**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.
153
158
-**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).
154
159
-**Model dependencies**: the `provider:` prefix in the `model` field determines the required `langchain-*` package (e.g., `anthropic` -> `langchain-anthropic`).
155
160
-**Sandbox dependencies**: the `[sandbox].provider` value maps to its partner package (e.g., `daytona` -> `langchain-daytona`).
@@ -217,23 +222,74 @@ The deployed server exposes:
217
222
218
223
## Examples
219
224
220
-
A content writing agent that only needs a model and system prompt, with no code execution:
225
+
A content writing agent with per-user preferences that the agent can update:
221
226
222
227
```toml deepagents.toml
223
228
[agent]
224
229
name = "deepagents-deploy-content-writer"
225
-
model = "anthropic:claude-sonnet-4-6"
230
+
model = "openai:gpt-4.1"
231
+
```
232
+
233
+
```txt
234
+
my-content-writer/
235
+
βββ deepagents.toml
236
+
βββ AGENTS.md
237
+
βββ skills/
238
+
β βββ blog-post/SKILL.md
239
+
β βββ social-media/SKILL.md
240
+
βββ user/
241
+
βββ AGENTS.md # writable β agent learns user preferences
226
242
```
227
243
228
244
A coding agent with a LangSmith sandbox for running code:
229
245
230
246
```toml deepagents.toml
231
247
[agent]
232
248
name = "deepagents-deploy-coding-agent"
233
-
model = "anthropic:claude-sonnet-4-6"
249
+
model = "anthropic:claude-sonnet-4-5"
234
250
235
251
[sandbox]
236
252
provider = "langsmith"
237
253
template = "coding-agent"
238
254
image = "python:3.12"
239
255
```
256
+
257
+
## User Memory
258
+
259
+
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:
260
+
261
+
```txt
262
+
user/
263
+
βββ AGENTS.md # optional β seeded as empty if not provided
264
+
```
265
+
266
+
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.
267
+
268
+
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.
269
+
270
+
### How it works
271
+
272
+
1.**Bundle time** β the bundler reads `user/AGENTS.md` (or uses an empty string) and includes it in the seed payload.
273
+
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.
274
+
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.
275
+
4.**Writable** β the agent can update it via `edit_file`. The shared `AGENTS.md` and skills are read-only.
276
+
277
+
### Permissions
278
+
279
+
| Path | Writable | Scope |
280
+
| --- | --- | --- |
281
+
|`/memories/AGENTS.md`| No | Shared (assistant-scoped) |
282
+
|`/memories/skills/**`| No | Shared (assistant-scoped) |
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.
288
+
289
+
## Gotchas
290
+
291
+
-**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.
292
+
-**Full rebuild on deploy:**`deepagents deploy` creates a new revision on every invocation. Use `deepagents dev` for local iteration.
293
+
-**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.
294
+
-**MCP: HTTP/SSE only.** Stdio transports are rejected at bundle time.
295
+
-**No custom Python tools.** Use MCP servers to expose custom tool logic.
0 commit comments