deepagents 0.3.5__py3-none-any.whl → 0.3.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,26 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepagents
3
- Version: 0.3.5
3
+ Version: 0.3.7
4
4
  Summary: General purpose 'deep agent' with sub-agent spawning, todo list capabilities, and mock file system. Built on LangGraph.
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://docs.langchain.com/oss/python/deepagents/overview
7
7
  Project-URL: Documentation, https://reference.langchain.com/python/deepagents/
8
8
  Project-URL: Source, https://github.com/langchain-ai/deepagents
9
- Project-URL: Twitter, https://x.com/LangChainAI
9
+ Project-URL: Twitter, https://x.com/LangChain
10
10
  Project-URL: Slack, https://www.langchain.com/join-community
11
11
  Project-URL: Reddit, https://www.reddit.com/r/LangChain/
12
12
  Requires-Python: <4.0,>=3.11
13
13
  Description-Content-Type: text/markdown
14
14
  Requires-Dist: langchain-core<2.0.0,>=1.2.6
15
- Requires-Dist: langchain<2.0.0,>=1.2.3
15
+ Requires-Dist: langchain<2.0.0,>=1.2.4
16
16
  Requires-Dist: langchain-anthropic<2.0.0,>=1.3.1
17
17
  Requires-Dist: langchain-google-genai<5.0.0,>=4.1.3
18
18
  Requires-Dist: wcmatch
19
19
 
20
20
  # 🧠🤖Deep Agents
21
21
 
22
- Using an LLM to call tools in a loop is the simplest form of an agent.
23
- This architecture, however, can yield agents that are “shallow” and fail to plan and act over longer, more complex tasks.
22
+ Using an LLM to call tools in a loop is the simplest form of an agent.
23
+ This architecture, however, can yield agents that are “shallow” and fail to plan and act over longer, more complex tasks.
24
24
 
25
25
  Applications like “Deep Research”, "Manus", and “Claude Code” have gotten around this limitation by implementing a combination of four things:
26
26
  a **planning tool**, **sub agents**, access to a **file system**, and a **detailed prompt**.
@@ -46,7 +46,9 @@ poetry add deepagents
46
46
 
47
47
  ## Usage
48
48
 
49
- (To run the example below, you will need to `pip install tavily-python`).
49
+ > **Note:** `deepagents` requires using a LLM that supports [tool calling](https://docs.langchain.com/oss/python/langchain/overview).
50
+
51
+ This example uses [Tavily](https://tavily.com/) as an example search provider, but you can substitute any search API (e.g., DuckDuckGo, SerpAPI, Brave Search). To run the example below, you will need to `pip install tavily-python`.
50
52
 
51
53
  Make sure to set `TAVILY_API_KEY` in your environment. You can generate one [here](https://www.tavily.com/).
52
54
 
@@ -100,21 +102,22 @@ The agent created with `create_deep_agent` is just a LangGraph graph - so you ca
100
102
  in the same way you would any LangGraph agent.
101
103
 
102
104
  ## Core Capabilities
105
+
103
106
  **Planning & Task Decomposition**
104
107
 
105
- Deep Agents include a built-in `write_todos` tool that enables agents to break down complex tasks into discrete steps, track progress, and adapt plans as new information emerges.
108
+ Deep Agents include a built-in `write_todos` tool that enables agents to break down complex tasks into discrete steps, track progress, and adapt plans as new information emerges.
106
109
 
107
110
  **Context Management**
108
111
 
109
- File system tools (`ls`, `read_file`, `write_file`, `edit_file`, `glob`, `grep`) allow agents to offload large context to memory, preventing context window overflow and enabling work with variable-length tool results.
112
+ File system tools (`ls`, `read_file`, `write_file`, `edit_file`, `glob`, `grep`) allow agents to offload large context to memory, preventing context window overflow and enabling work with variable-length tool results.
110
113
 
111
114
  **Subagent Spawning**
112
115
 
113
- A built-in `task` tool enables agents to spawn specialized subagents for context isolation. This keeps the main agents context clean while still going deep on specific subtasks.
116
+ A built-in `task` tool enables agents to spawn specialized subagents for context isolation. This keeps the main agent's context clean while still going deep on specific subtasks.
114
117
 
115
118
  **Long-term Memory**
116
119
 
117
- Extend agents with persistent memory across threads using LangGraphs Store. Agents can save and retrieve information from previous conversations.
120
+ Extend agents with persistent memory across threads using LangGraph's `BaseStore`. Agents can save and retrieve information from previous conversations.
118
121
 
119
122
  ## Customizing Deep Agents
120
123
 
@@ -122,19 +125,20 @@ There are several parameters you can pass to `create_deep_agent` to create your
122
125
 
123
126
  ### `model`
124
127
 
125
- 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/).
128
+ By default, `deepagents` uses `claude-sonnet-4-5-20250929`. You can customize this by passing any [LangChain model object](https://docs.langchain.com/oss/python/integrations/providers/overview).
129
+
130
+ > **Tip:** Use the `provider:model` format (e.g., `openai:gpt-5`) to quickly switch between models. See the [reference](https://reference.langchain.com/python/langchain/models/#langchain.chat_models.init_chat_model(model)) for more info.
126
131
 
127
132
  ```python
128
133
  from langchain.chat_models import init_chat_model
129
134
  from deepagents import create_deep_agent
130
135
 
131
- model = init_chat_model("openai:gpt-4o")
132
- agent = create_deep_agent(
133
- model=model,
134
- )
136
+ model = init_chat_model(model="openai:gpt-5")
137
+ agent = create_deep_agent(model=model)
135
138
  ```
136
139
 
137
140
  ### `system_prompt`
141
+
138
142
  Deep Agents come with a built-in system prompt. This is relatively detailed prompt that is heavily based on and inspired by [attempts](https://github.com/kn1026/cc/blob/main/claudecode.md) to [replicate](https://github.com/asgeirtj/system_prompts_leaks/blob/main/Anthropic/claude-code.md)
139
143
  Claude Code's system prompt. It was made more general purpose than Claude Code's system prompt. The default prompt contains detailed instructions for how to use the built-in planning tool, file system tools, and sub agents.
140
144
 
@@ -153,7 +157,7 @@ agent = create_deep_agent(
153
157
 
154
158
  ### `tools`
155
159
 
156
- Just like with tool-calling agents, you can provide a deep agent with a set of tools that it has access to.
160
+ In addition to custom tools you provide, `deepagents` include built-in tools for planning (`write_todos`), file management (`ls`, `read_file`, `write_file`, `edit_file`, `glob`, `grep`), and subagent spawning (`task`).
157
161
 
158
162
  ```python
159
163
  import os
@@ -183,7 +187,8 @@ agent = create_deep_agent(
183
187
  ```
184
188
 
185
189
  ### `middleware`
186
- `create_deep_agent` is implemented with middleware that can be customized. You can provide additional middleware to extend functionality, add tools, or implement custom hooks.
190
+
191
+ `create_deep_agent` is implemented with middleware that can be customized. You can provide additional middleware to extend functionality, add tools, or implement custom hooks.
187
192
 
188
193
  ```python
189
194
  from langchain_core.tools import tool
@@ -231,7 +236,8 @@ class CompiledSubAgent(TypedDict):
231
236
  runnable: Runnable
232
237
  ```
233
238
 
234
- **SubAgent fields:**
239
+ **`SubAgent` fields:**
240
+
235
241
  - **name**: This is the name of the subagent, and how the main agent will call the subagent
236
242
  - **description**: This is the description of the subagent that is shown to the main agent
237
243
  - **system_prompt**: This is the system prompt used for the subagent
@@ -241,11 +247,12 @@ class CompiledSubAgent(TypedDict):
241
247
  - **interrupt_on** A custom interrupt config that specifies human-in-the-loop interactions for your tools.
242
248
 
243
249
  **CompiledSubAgent fields:**
250
+
244
251
  - **name**: This is the name of the subagent, and how the main agent will call the subagent
245
252
  - **description**: This is the description of the subagent that is shown to the main agent
246
- - **runnable**: A pre-built LangGraph graph/agent that will be used as the subagent
253
+ - **runnable**: A pre-built LangGraph graph/agent that will be used as the subagent. **Important:** The runnable's state schema must include a `messages` key. This is required for the subagent to communicate results back to the main agent.
247
254
 
248
- #### Using SubAgent
255
+ #### Using `SubAgent`
249
256
 
250
257
  ```python
251
258
  import os
@@ -284,9 +291,9 @@ agent = create_deep_agent(
284
291
  )
285
292
  ```
286
293
 
287
- #### Using CustomSubAgent
294
+ #### Using `CompiledSubAgent`
288
295
 
289
- For more complex use cases, you can provide your own pre-built LangGraph graph as a subagent:
296
+ For complex workflows, use a pre-built LangGraph graph:
290
297
 
291
298
  ```python
292
299
  # Create a custom agent graph
@@ -296,7 +303,7 @@ custom_graph = create_agent(
296
303
  prompt="You are a specialized agent for data analysis..."
297
304
  )
298
305
 
299
- # Use it as a custom subagent
306
+ # Use it as a compiled subagent
300
307
  custom_subagent = CompiledSubAgent(
301
308
  name="data-analyzer",
302
309
  description="Specialized agent for complex data analysis tasks",
@@ -314,7 +321,10 @@ agent = create_deep_agent(
314
321
  ```
315
322
 
316
323
  ### `interrupt_on`
317
- A common reality for agents is that some tool operations may be sensitive and require human approval before execution. Deep Agents supports human-in-the-loop workflows through LangGraph’s interrupt capabilities. You can configure which tools require approval using a checkpointer.
324
+
325
+ The harness can pause agent execution at specified tool calls to allow human approval or modification. This feature is opt-in via the `interrupt_on` parameter.
326
+
327
+ Pass `interrupt_on` to `create_deep_agent` with a mapping of tool names to interrupt configurations. Example: `interrupt_on={"edit_file": True}` pauses before every edit.
318
328
 
319
329
  These tool configs are passed to our prebuilt [HITL middleware](https://docs.langchain.com/oss/python/langchain/middleware#human-in-the-loop) so that the agent pauses execution and waits for feedback from the user before executing configured tools.
320
330
 
@@ -342,6 +352,7 @@ agent = create_deep_agent(
342
352
  ## Deep Agents Middleware
343
353
 
344
354
  Deep Agents are built with a modular middleware architecture. As a reminder, Deep Agents have access to:
355
+
345
356
  - A planning tool
346
357
  - A filesystem for storing context and long-term memories
347
358
  - The ability to spawn subagents
@@ -350,11 +361,11 @@ Each of these features is implemented as separate middleware. When you create a
350
361
 
351
362
  Middleware is a composable concept, and you can choose to add as many or as few middleware to an agent depending on your use case. That means that you can also use any of the aforementioned middleware independently!
352
363
 
353
- ### TodoListMiddleware
364
+ ### `TodoListMiddleware`
354
365
 
355
- Planning is integral to solving complex problems. If youve used claude code recently, youll notice how it writes out a To-Do list before tackling complex, multi-part tasks. Youll also notice how it can adapt and update this To-Do list on the fly as more information comes in.
366
+ Planning is integral to solving complex problems. If you've used Claude Code recently, you'll notice how it writes out a to-do list before tackling complex, multi-part tasks. You'll also notice how it can adapt and update this to-do list on the fly as more information comes in.
356
367
 
357
- **TodoListMiddleware** provides your agent with a tool specifically for updating this To-Do list. Before, and while it executes a multi-part task, the agent is prompted to use the write_todos tool to keep track of what its doing, and what still needs to be done.
368
+ `TodoListMiddleware` provides your agent with a tool specifically for updating this to-do list. Before, and while it executes a multi-part task, the agent is prompted to use the `write_todos` tool to keep track of what it's doing, and what still needs to be done.
358
369
 
359
370
  ```python
360
371
  from langchain.agents import create_agent
@@ -373,14 +384,15 @@ agent = create_agent(
373
384
  )
374
385
  ```
375
386
 
376
- ### FilesystemMiddleware
387
+ ### `FilesystemMiddleware`
388
+
389
+ Context engineering is one of the main challenges in building effective agents. This can be particularly hard when using tools that can return variable length results (e.g., `web_search`, RAG), as long tool results can quickly fill up your context window.
390
+ `FilesystemMiddleware` provides four tools to your agent to interact with both short-term and long-term memory:
377
391
 
378
- Context engineering is one of the main challenges in building effective agents. This can be particularly hard when using tools that can return variable length results (ex. web_search, rag), as long ToolResults can quickly fill up your context window.
379
- **FilesystemMiddleware** provides four tools to your agent to interact with both short-term and long-term memory.
380
- - **ls**: List the files in your filesystem
381
- - **read_file**: Read an entire file, or a certain number of lines from a file
382
- - **write_file**: Write a new file to your filesystem
383
- - **edit_file**: Edit an existing file in your filesystem
392
+ - `ls`: List the files in your filesystem
393
+ - `read_file`: Read an entire file, or a certain number of lines from a file
394
+ - `write_file`: Write a new file to your filesystem
395
+ - `edit_file`: Edit an existing file in your filesystem
384
396
 
385
397
  ```python
386
398
  from langchain.agents import create_agent
@@ -404,9 +416,9 @@ agent = create_agent(
404
416
  )
405
417
  ```
406
418
 
407
- ### SubAgentMiddleware
419
+ ### `SubAgentMiddleware`
408
420
 
409
- Handing off tasks to subagents is a great way to isolate context, keeping the context window of the main (supervisor) agent clean while still going deep on a task. The subagents middleware allows you supply subagents through a task tool.
421
+ Handing off tasks to subagents is a great way to isolate context, keeping the context window of the main (supervisor) agent clean while still going deep on a task. `SubAgentMiddleware` allows you to supply subagents through a `task` tool.
410
422
 
411
423
  A subagent is defined with a name, description, system prompt, and tools. You can also provide a subagent with a custom model, or with additional middleware. This can be particularly useful when you want to give the subagent an additional state key to share with the main agent.
412
424
 
@@ -446,14 +458,16 @@ For more complex use cases, you can also provide your own pre-built LangGraph gr
446
458
 
447
459
  ```python
448
460
  # Create a custom LangGraph graph
461
+ # Important: Your state must include a 'messages' key
449
462
  def create_weather_graph():
450
463
  workflow = StateGraph(...)
451
464
  # Build your custom graph
465
+ # Make sure your state schema includes 'messages'
452
466
  return workflow.compile()
453
467
 
454
468
  weather_graph = create_weather_graph()
455
469
 
456
- # Wrap it in a CompiledSubAgent
470
+ # Wrap it in a `CompiledSubAgent`
457
471
  weather_subagent = CompiledSubAgent(
458
472
  name="weather",
459
473
  description="This subagent can get weather in cities.",
@@ -474,13 +488,12 @@ agent = create_agent(
474
488
 
475
489
  ## Sync vs Async
476
490
 
477
- Prior versions of deepagents separated sync and async agent factories.
491
+ Prior versions of deepagents separated sync and async agent factories.
478
492
 
479
493
  `async_create_deep_agent` has been folded in to `create_deep_agent`.
480
494
 
481
495
  **You should use `create_deep_agent` as the factory for both sync and async agents**
482
496
 
483
-
484
497
  ## MCP
485
498
 
486
499
  The `deepagents` library can be ran with MCP tools. This can be achieved by using the [Langchain MCP Adapter library](https://github.com/langchain-ai/langchain-mcp-adapters).
@@ -0,0 +1,22 @@
1
+ deepagents/__init__.py,sha256=LHQm0v_7N9Gd4pmpRjhnlOCMIK2O0jQ4cEU8RiXEI8k,447
2
+ deepagents/graph.py,sha256=czbV_e5wMyt7K83LwcpKzKdJq8Tr9Ha7iSmAh32WC_4,10520
3
+ deepagents/backends/__init__.py,sha256=BOKu2cQ1OdMyO_l2rLqZQiXppYFmQbx7OIQb7WYwvZc,457
4
+ deepagents/backends/composite.py,sha256=WZ_dnn63BmrU19ZJ5-m728f99pSa0Uq_CnwZjwmxz1U,26198
5
+ deepagents/backends/filesystem.py,sha256=hiWSxatfJrLqBqVlj22CnXsDxjHB1oX5NJBogGBPiXM,26713
6
+ deepagents/backends/protocol.py,sha256=HUmIrwYGduPfDcs_wtOzVU2QPA9kICZuGO-sUwxzz5I,15997
7
+ deepagents/backends/sandbox.py,sha256=PE4-DkVRU5Z3zp4NViHCkNHUHKiFUKh55UAXCicBvRo,10884
8
+ deepagents/backends/state.py,sha256=Qq4uRjKg6POEqLl4tNnWnXzbmLBpu3bZdMkcUROIgHw,7899
9
+ deepagents/backends/store.py,sha256=9gdUQqPWChYgHVoopOUaocUdyUbFBpf-PxhTiXRXCto,18219
10
+ deepagents/backends/utils.py,sha256=CE_HXddNTr954auqFIVgYLLD4Gdsfr9U8b384g07Wuc,13932
11
+ deepagents/middleware/__init__.py,sha256=tATwi3JI-90-Wuf3Wg-szWkSBuKO9F2iyc5NoHP9q4g,566
12
+ deepagents/middleware/_utils.py,sha256=ojy62kQLASQ2GabevWJaPGLItyccdNxLMPpYV25Lf20,687
13
+ deepagents/middleware/filesystem.py,sha256=ZFy1ROZFHN7Qv_PPlLMO3sjuUKFoo3SSz-SMGWLYJRw,54301
14
+ deepagents/middleware/memory.py,sha256=D6CNDeh5wUGLuY0CZWubFn_cfW81XuzxEZGJK02vFiU,15860
15
+ deepagents/middleware/patch_tool_calls.py,sha256=PdNhxPaQqwnFkhEAZEE2kEzadTNAOO3_iJRA30WqpGE,1981
16
+ deepagents/middleware/skills.py,sha256=0nOj7knAzPC9FmFK7Po3bsZeMAQJ8VJU6K1BEvoj3NM,24181
17
+ deepagents/middleware/subagents.py,sha256=2pIwqC_0MUptX2TsBtTpr4tFDdQYkOWCG6lwAgPO_cw,27273
18
+ deepagents/middleware/summarization.py,sha256=64exG7rsnxT9EZ7JaJ9DLi5CQNd8xWDfDf2GUhARngY,29011
19
+ deepagents-0.3.7.dist-info/METADATA,sha256=QVdTXBnU35VMVRufuScZUgwrqoUcBWkK5I8h6gbeJGM,19762
20
+ deepagents-0.3.7.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
21
+ deepagents-0.3.7.dist-info/top_level.txt,sha256=drAzchOzPNePwpb3_pbPuvLuayXkN7SNqeIKMBWJoAo,11
22
+ deepagents-0.3.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,20 +0,0 @@
1
- deepagents/__init__.py,sha256=LHQm0v_7N9Gd4pmpRjhnlOCMIK2O0jQ4cEU8RiXEI8k,447
2
- deepagents/graph.py,sha256=TmMBtFZP9uT5KrzT6XRFIUCAD2_BCvfGLbd6zCMaWM8,8622
3
- deepagents/backends/__init__.py,sha256=BOKu2cQ1OdMyO_l2rLqZQiXppYFmQbx7OIQb7WYwvZc,457
4
- deepagents/backends/composite.py,sha256=WZ_dnn63BmrU19ZJ5-m728f99pSa0Uq_CnwZjwmxz1U,26198
5
- deepagents/backends/filesystem.py,sha256=kGBFuW3ie0LLz4wXCPGJm3WAiYpimJTgEwodJSnXWCs,21477
6
- deepagents/backends/protocol.py,sha256=HUmIrwYGduPfDcs_wtOzVU2QPA9kICZuGO-sUwxzz5I,15997
7
- deepagents/backends/sandbox.py,sha256=8Bi8itqjW2PpXORlIfT8thMN1aBXExgHz8cm8xwVaxI,10864
8
- deepagents/backends/state.py,sha256=Qq4uRjKg6POEqLl4tNnWnXzbmLBpu3bZdMkcUROIgHw,7899
9
- deepagents/backends/store.py,sha256=0mmeTsim4J8bjcf62dljwNrDv4PavT2KHdGbaBzVzRE,15197
10
- deepagents/backends/utils.py,sha256=Iyk2jW-gfoLvMnz-W_2FRCoJW_j3r1zoumU9iww-jd0,13973
11
- deepagents/middleware/__init__.py,sha256=2smUxjwghA3Eml_wp0kd4dAY-rwLyW-XQPBE3dAoo50,467
12
- deepagents/middleware/filesystem.py,sha256=XrES4aPaeOliNfcECpmT7Zw4CFa1QQfNylNhW2vsXp0,47228
13
- deepagents/middleware/memory.py,sha256=E1UAtBAyIxkyNHuG2-j_X_fClMbbSwobdKa3e_P0FDk,15883
14
- deepagents/middleware/patch_tool_calls.py,sha256=PdNhxPaQqwnFkhEAZEE2kEzadTNAOO3_iJRA30WqpGE,1981
15
- deepagents/middleware/skills.py,sha256=EABvIq4ES_NHGFL9USUnlH1WwiZgnAacoOLz2kkkVkw,24043
16
- deepagents/middleware/subagents.py,sha256=Gpky0NsQehZ-iyXIetczmu4CkBuxAnDQv6pZXIDHp8M,24427
17
- deepagents-0.3.5.dist-info/METADATA,sha256=Due_n90XpZX-mI-tkk9h8BKfQnD2qcn-He6ZkaMfyzg,18823
18
- deepagents-0.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- deepagents-0.3.5.dist-info/top_level.txt,sha256=drAzchOzPNePwpb3_pbPuvLuayXkN7SNqeIKMBWJoAo,11
20
- deepagents-0.3.5.dist-info/RECORD,,