Skip to content

Commit aa4f4af

Browse files
authored
add mermaids to deepagent docs (#1556)
Fixes DOC-461
1 parent 03d0385 commit aa4f4af

File tree

7 files changed

+103
-0
lines changed

7 files changed

+103
-0
lines changed

src/oss/deepagents/backends.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ description: Choose and configure filesystem backends for deep agents. You can s
55

66
Deep agents expose a filesystem surface to the agent via tools like `ls`, `read_file`, `write_file`, `edit_file`, `glob`, and `grep`. These tools operate through a pluggable backend.
77

8+
```mermaid
9+
graph TB
10+
Tools[Filesystem Tools] --> Backend[Backend]
11+
12+
Backend --> State[State]
13+
Backend --> Disk[Filesystem]
14+
Backend --> Store[Store]
15+
Backend --> Composite[Composite]
16+
Backend --> Custom[Custom]
17+
18+
Composite --> Router{Routes}
19+
Router --> State
20+
Router --> Disk
21+
Router --> Store
22+
```
23+
824
This page explains how to [choose a backend](#specify-a-backend), [route different paths to different backends](#route-to-different-backends), [implement your own virtual filesystem](#use-a-virtual-filesystem) (e.g., S3 or Postgres), [add policy hooks](#add-policy-hooks), and [comply with the backend protocol](#protocol-reference).
925

1026
## Quickstart

src/oss/deepagents/customization.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ sidebarTitle: Customization
44
description: Learn how to customize deep agents with system prompts, tools, subagents, and more
55
---
66

7+
```mermaid
8+
graph LR
9+
Create[create_deep_agent] --> Core[Core Config]
10+
Create --> Features[Features]
11+
12+
Core --> Model[Model]
13+
Core --> Prompt[System Prompt]
14+
Core --> Tools[Tools]
15+
16+
Features --> Backend[Backend]
17+
Features --> Sub[Subagents]
18+
Features --> Interrupt[Interrupts]
19+
20+
Model --> Agent[Customized Agent]
21+
Prompt --> Agent
22+
Tools --> Agent
23+
Backend --> Agent
24+
Sub --> Agent
25+
Interrupt --> Agent
26+
```
27+
728
## Model
829

930
By default, `deepagents` uses `"claude-sonnet-4-5-20250929"`. You can customize this by passing any [LangChain model object](https://python.langchain.com/docs/integrations/chat/).

src/oss/deepagents/harness.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ sidebarTitle: Agent harness
55

66
We think of `deepagents` as an "agent harness". It is the same core tool calling loop as other agent frameworks, but with built-in tools and capabilities.
77

8+
```mermaid
9+
graph TB
10+
Agent[Deep Agent] --> Tools[File System Tools]
11+
Agent --> Todo[To-Do List]
12+
Agent --> Sub[Subagents]
13+
14+
Tools --> Backend[Storage Backend]
15+
Backend --> State[State]
16+
Backend --> Disk[Filesystem]
17+
Backend --> Store[Store]
18+
19+
Sub --> |isolated work| Result[Final Result]
20+
Result --> Agent
21+
```
22+
823
This page lists out the components that make up the agent harness.
924

1025
## File system access

src/oss/deepagents/human-in-the-loop.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ description: Learn how to configure human approval for sensitive tool operations
55

66
Some tool operations may be sensitive and require human approval before execution. Deep agents support human-in-the-loop workflows through LangGraph's interrupt capabilities. You can configure which tools require approval using the `interrupt_on` parameter.
77

8+
```mermaid
9+
graph LR
10+
Agent[Agent] --> Check{Interrupt?}
11+
Check --> |no| Execute[Execute]
12+
Check --> |yes| Human{Human}
13+
14+
Human --> |approve| Execute
15+
Human --> |edit| Execute
16+
Human --> |reject| Cancel[Cancel]
17+
18+
Execute --> Agent
19+
Cancel --> Agent
20+
```
21+
822
## Basic configuration
923

1024
The `interrupt_on` parameter accepts a dictionary mapping tool names to interrupt configurations. Each tool can be configured with:

src/oss/deepagents/long-term-memory.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ Deep agents come with a local filesystem to offload memory. By default, this fil
77

88
You can extend deep agents with **long-term memory** by using a **CompositeBackend** that routes specific paths to persistent storage. This enables hybrid storage where some files persist across threads while others remain ephemeral.
99

10+
```mermaid
11+
graph LR
12+
Agent[Deep Agent] --> Router{Path Router}
13+
14+
Router --> |/memories/*| Store[Store Backend]
15+
Router --> |other| State[State Backend]
16+
17+
Store --> Persist[(Persistent<br/>across threads)]
18+
State --> Ephemeral[(Ephemeral<br/>single thread)]
19+
```
20+
1021
## Setup
1122

1223
Configure long-term memory by using a `CompositeBackend` that routes the `/memories/` path to a `StoreBackend`:

src/oss/deepagents/middleware.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ Deep agents are built with a modular middleware architecture. Deep agents have a
1212

1313
Each feature is implemented as separate middleware. When you create a deep agent with `create_deep_agent`, we automatically attach `TodoListMiddleware`, `FilesystemMiddleware`, and `SubAgentMiddleware` to your agent.
1414

15+
```mermaid
16+
graph LR
17+
Agent[create_deep_agent] --> Todo[TodoList]
18+
Agent --> FS[Filesystem]
19+
Agent --> Sub[SubAgent]
20+
21+
Todo --> Tools[Agent Tools]
22+
FS --> Tools
23+
Sub --> Tools
24+
```
25+
1526
Middleware is composable—you can add as many or as few middleware to an agent as needed. You can use any middleware independently.
1627

1728
The following sections explain what each middleware provides.

src/oss/deepagents/subagents.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ description: Learn how to use subagents to delegate work and keep context clean
55

66
Deep agents can create subagents to delegate work. You can specify custom subagents in the `subagents` parameter. Subagents are useful for [context quarantine](https://www.dbreunig.com/2025/06/26/how-to-fix-your-context.html#context-quarantine) (keeping the main agent's context clean) and for providing specialized instructions.
77

8+
```mermaid
9+
graph TB
10+
Main[Main Agent] --> |task tool| Sub[Subagent]
11+
12+
Sub --> Research[Research]
13+
Sub --> Code[Code]
14+
Sub --> General[General]
15+
16+
Research --> |isolated work| Result[Final Result]
17+
Code --> |isolated work| Result
18+
General --> |isolated work| Result
19+
20+
Result --> Main
21+
```
22+
823
## Why use subagents?
924

1025
Subagents solve the **context bloat problem**. When agents use tools with large outputs (web search, file reads, database queries), the context window fills up quickly with intermediate results. Subagents isolate this detailed work—the main agent receives only the final result, not the dozens of tool calls that produced it.

0 commit comments

Comments
 (0)