deepagents 0.1.5rc1__tar.gz → 0.2.0__tar.gz

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.
Files changed (24) hide show
  1. deepagents-0.1.5rc1/README.md → deepagents-0.2.0/PKG-INFO +24 -40
  2. deepagents-0.1.5rc1/PKG-INFO → deepagents-0.2.0/README.md +4 -60
  3. {deepagents-0.1.5rc1 → deepagents-0.2.0}/pyproject.toml +2 -2
  4. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/backends/__init__.py +1 -2
  5. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/backends/composite.py +1 -13
  6. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/middleware/filesystem.py +0 -7
  7. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents.egg-info/PKG-INFO +6 -42
  8. {deepagents-0.1.5rc1 → deepagents-0.2.0}/tests/test_middleware.py +12 -4
  9. {deepagents-0.1.5rc1 → deepagents-0.2.0}/LICENSE +0 -0
  10. {deepagents-0.1.5rc1 → deepagents-0.2.0}/setup.cfg +0 -0
  11. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/__init__.py +0 -0
  12. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/backends/filesystem.py +0 -0
  13. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/backends/protocol.py +0 -0
  14. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/backends/state.py +0 -0
  15. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/backends/store.py +0 -0
  16. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/backends/utils.py +0 -0
  17. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/graph.py +0 -0
  18. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/middleware/__init__.py +0 -0
  19. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/middleware/patch_tool_calls.py +0 -0
  20. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents/middleware/subagents.py +0 -0
  21. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents.egg-info/SOURCES.txt +0 -0
  22. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents.egg-info/dependency_links.txt +0 -0
  23. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents.egg-info/requires.txt +1 -1
  24. {deepagents-0.1.5rc1 → deepagents-0.2.0}/src/deepagents.egg-info/top_level.txt +0 -0
@@ -1,3 +1,23 @@
1
+ Metadata-Version: 2.4
2
+ Name: deepagents
3
+ Version: 0.2.0
4
+ Summary: General purpose 'deep agent' with sub-agent spawning, todo list capabilities, and mock file system. Built on LangGraph.
5
+ License: MIT
6
+ Requires-Python: <4.0,>=3.11
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: langchain-anthropic<2.0.0,>=1.0.0
10
+ Requires-Dist: langchain<2.0.0,>=1.0.0
11
+ Requires-Dist: langchain-core<2.0.0,>=1.0.0
12
+ Requires-Dist: wcmatch
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest; extra == "dev"
15
+ Requires-Dist: pytest-cov; extra == "dev"
16
+ Requires-Dist: build; extra == "dev"
17
+ Requires-Dist: twine; extra == "dev"
18
+ Requires-Dist: langchain-openai; extra == "dev"
19
+ Dynamic: license-file
20
+
1
21
  # 🧠🤖Deep Agents
2
22
 
3
23
  Using an LLM to call tools in a loop is the simplest form of an agent.
@@ -8,7 +28,7 @@ a **planning tool**, **sub agents**, access to a **file system**, and a **detail
8
28
 
9
29
  <img src="deep_agents.png" alt="deep agent" width="600"/>
10
30
 
11
- `deepagents` is a Python package that implements these in a general purpose way so that you can easily create a Deep Agent for your application.
31
+ `deepagents` is a Python package that implements these in a general purpose way so that you can easily create a Deep Agent for your application. For a full overview and quickstart of `deepagents`, the best resource is our [docs](https://docs.langchain.com/oss/python/deepagents/overview).
12
32
 
13
33
  **Acknowledgements: This project was primarily inspired by Claude Code, and initially was largely an attempt to see what made Claude Code general purpose, and make it even more so.**
14
34
 
@@ -87,7 +107,7 @@ in the same way you would any LangGraph agent.
87
107
 
88
108
  **Context Management**
89
109
 
90
- File system tools (`ls`, `read_file`, `write_file`, `edit_file`) allow agents to offload large context to memory, preventing context window overflow and enabling work with variable-length tool results.
110
+ 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.
91
111
 
92
112
  **Subagent Spawning**
93
113
 
@@ -294,33 +314,6 @@ agent = create_deep_agent(
294
314
  )
295
315
  ```
296
316
 
297
- ### `backend`
298
- Deep agents come with a local filesystem to offload memory to. By default, this filesystem is stored in state (ephemeral, transient to a single thread).
299
-
300
- You can configure persistent long-term memory using a composite backend that routes a path prefix (for example, `/memories/`) to a persistent store.
301
-
302
- ```python
303
- from deepagents import create_deep_agent
304
- from deepagents.backends import build_composite_state_backend, StoreBackend
305
- from langgraph.store.memory import InMemoryStore
306
-
307
- store = InMemoryStore() # Or any other Store implementation
308
-
309
- # Provide a backend factory to the agent/middleware.
310
- # This builds a state-backed composite at runtime and routes /memories/ to StoreBackend.
311
- backend_factory = lambda rt: build_composite_state_backend(
312
- rt,
313
- routes={
314
- "/memories/": (lambda r: StoreBackend(r)),
315
- },
316
- )
317
-
318
- agent = create_deep_agent(
319
- backend=backend_factory,
320
- store=store,
321
- )
322
- ```
323
-
324
317
  ### `interrupt_on`
325
318
  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.
326
319
 
@@ -393,11 +386,7 @@ Context engineering is one of the main challenges in building effective agents.
393
386
  ```python
394
387
  from langchain.agents import create_agent
395
388
  from deepagents.middleware.filesystem import FilesystemMiddleware
396
- from deepagents.backends import (
397
- StateBackend,
398
- CompositeBackend,
399
- StoreBackend,
400
- )
389
+
401
390
 
402
391
  # FilesystemMiddleware is included by default in create_deep_agent
403
392
  # You can customize it if building a custom agent
@@ -405,12 +394,7 @@ agent = create_agent(
405
394
  model="anthropic:claude-sonnet-4-20250514",
406
395
  middleware=[
407
396
  FilesystemMiddleware(
408
- backend=lambda rt: StateBackend(rt), # Optional: customize storage backend (defaults to lambda rt: )
409
- # For persistent memory, use CompositeBackend:
410
- # backend=CompositeBackend(
411
- # default=lambda rt: StateBackend(rt)
412
- # routes={"/memories/": lambda rt: StoreBackend(rt)}
413
- # )
397
+ backend=..., # Optional: customize storage backend
414
398
  system_prompt="Write to the filesystem when...", # Optional custom system prompt override
415
399
  custom_tool_descriptions={
416
400
  "ls": "Use the ls tool when...",
@@ -1,23 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: deepagents
3
- Version: 0.1.5rc1
4
- Summary: General purpose 'deep agent' with sub-agent spawning, todo list capabilities, and mock file system. Built on LangGraph.
5
- License: MIT
6
- Requires-Python: <4.0,>=3.11
7
- Description-Content-Type: text/markdown
8
- License-File: LICENSE
9
- Requires-Dist: langchain-anthropic<2.0.0,>=1.0.0
10
- Requires-Dist: langchain<2.0.0,>=1.0.0
11
- Requires-Dist: langchain-core<2.0.0,>=1.0.0
12
- Provides-Extra: dev
13
- Requires-Dist: pytest; extra == "dev"
14
- Requires-Dist: pytest-cov; extra == "dev"
15
- Requires-Dist: build; extra == "dev"
16
- Requires-Dist: twine; extra == "dev"
17
- Requires-Dist: langchain-openai; extra == "dev"
18
- Requires-Dist: wcmatch; extra == "dev"
19
- Dynamic: license-file
20
-
21
1
  # 🧠🤖Deep Agents
22
2
 
23
3
  Using an LLM to call tools in a loop is the simplest form of an agent.
@@ -28,7 +8,7 @@ a **planning tool**, **sub agents**, access to a **file system**, and a **detail
28
8
 
29
9
  <img src="deep_agents.png" alt="deep agent" width="600"/>
30
10
 
31
- `deepagents` is a Python package that implements these in a general purpose way so that you can easily create a Deep Agent for your application.
11
+ `deepagents` is a Python package that implements these in a general purpose way so that you can easily create a Deep Agent for your application. For a full overview and quickstart of `deepagents`, the best resource is our [docs](https://docs.langchain.com/oss/python/deepagents/overview).
32
12
 
33
13
  **Acknowledgements: This project was primarily inspired by Claude Code, and initially was largely an attempt to see what made Claude Code general purpose, and make it even more so.**
34
14
 
@@ -107,7 +87,7 @@ in the same way you would any LangGraph agent.
107
87
 
108
88
  **Context Management**
109
89
 
110
- File system tools (`ls`, `read_file`, `write_file`, `edit_file`) allow agents to offload large context to memory, preventing context window overflow and enabling work with variable-length tool results.
90
+ 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.
111
91
 
112
92
  **Subagent Spawning**
113
93
 
@@ -314,33 +294,6 @@ agent = create_deep_agent(
314
294
  )
315
295
  ```
316
296
 
317
- ### `backend`
318
- Deep agents come with a local filesystem to offload memory to. By default, this filesystem is stored in state (ephemeral, transient to a single thread).
319
-
320
- You can configure persistent long-term memory using a composite backend that routes a path prefix (for example, `/memories/`) to a persistent store.
321
-
322
- ```python
323
- from deepagents import create_deep_agent
324
- from deepagents.backends import build_composite_state_backend, StoreBackend
325
- from langgraph.store.memory import InMemoryStore
326
-
327
- store = InMemoryStore() # Or any other Store implementation
328
-
329
- # Provide a backend factory to the agent/middleware.
330
- # This builds a state-backed composite at runtime and routes /memories/ to StoreBackend.
331
- backend_factory = lambda rt: build_composite_state_backend(
332
- rt,
333
- routes={
334
- "/memories/": (lambda r: StoreBackend(r)),
335
- },
336
- )
337
-
338
- agent = create_deep_agent(
339
- backend=backend_factory,
340
- store=store,
341
- )
342
- ```
343
-
344
297
  ### `interrupt_on`
345
298
  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.
346
299
 
@@ -413,11 +366,7 @@ Context engineering is one of the main challenges in building effective agents.
413
366
  ```python
414
367
  from langchain.agents import create_agent
415
368
  from deepagents.middleware.filesystem import FilesystemMiddleware
416
- from deepagents.backends import (
417
- StateBackend,
418
- CompositeBackend,
419
- StoreBackend,
420
- )
369
+
421
370
 
422
371
  # FilesystemMiddleware is included by default in create_deep_agent
423
372
  # You can customize it if building a custom agent
@@ -425,12 +374,7 @@ agent = create_agent(
425
374
  model="anthropic:claude-sonnet-4-20250514",
426
375
  middleware=[
427
376
  FilesystemMiddleware(
428
- backend=lambda rt: StateBackend(rt), # Optional: customize storage backend (defaults to lambda rt: )
429
- # For persistent memory, use CompositeBackend:
430
- # backend=CompositeBackend(
431
- # default=lambda rt: StateBackend(rt)
432
- # routes={"/memories/": lambda rt: StoreBackend(rt)}
433
- # )
377
+ backend=..., # Optional: customize storage backend
434
378
  system_prompt="Write to the filesystem when...", # Optional custom system prompt override
435
379
  custom_tool_descriptions={
436
380
  "ls": "Use the ls tool when...",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "deepagents"
3
- version = "0.1.5rc1"
3
+ version = "0.2.0"
4
4
  description = "General purpose 'deep agent' with sub-agent spawning, todo list capabilities, and mock file system. Built on LangGraph."
5
5
  readme = "README.md"
6
6
  license = { text = "MIT" }
@@ -9,6 +9,7 @@ dependencies = [
9
9
  "langchain-anthropic>=1.0.0,<2.0.0",
10
10
  "langchain>=1.0.0,<2.0.0",
11
11
  "langchain-core>=1.0.0,<2.0.0",
12
+ "wcmatch"
12
13
  ]
13
14
 
14
15
  [project.optional-dependencies]
@@ -18,7 +19,6 @@ dev = [
18
19
  "build",
19
20
  "twine",
20
21
  "langchain-openai",
21
- "wcmatch"
22
22
  ]
23
23
 
24
24
  [dependency-groups]
@@ -1,6 +1,6 @@
1
1
  """Memory backends for pluggable file storage."""
2
2
 
3
- from deepagents.backends.composite import CompositeBackend, build_composite_state_backend
3
+ from deepagents.backends.composite import CompositeBackend
4
4
  from deepagents.backends.filesystem import FilesystemBackend
5
5
  from deepagents.backends.state import StateBackend
6
6
  from deepagents.backends.store import StoreBackend
@@ -9,7 +9,6 @@ from deepagents.backends.protocol import BackendProtocol
9
9
  __all__ = [
10
10
  "BackendProtocol",
11
11
  "CompositeBackend",
12
- "build_composite_state_backend",
13
12
  "FilesystemBackend",
14
13
  "StateBackend",
15
14
  "StoreBackend",
@@ -220,16 +220,4 @@ class CompositeBackend:
220
220
  return res
221
221
 
222
222
 
223
- def build_composite_state_backend(
224
- runtime: ToolRuntime,
225
- *,
226
- routes: dict[str, BackendProtocol | BackendFactory],
227
- ) -> BackendProtocol:
228
- built_routes: dict[str, BackendProtocol] = {}
229
- for k, v in routes.items():
230
- if isinstance(v, BackendProtocol):
231
- built_routes[k] = v
232
- else:
233
- built_routes[k] = v(runtime)
234
- default_state = StateBackend(runtime)
235
- return CompositeBackend(default=default_state, routes=built_routes)
223
+
@@ -657,10 +657,3 @@ class FilesystemMiddleware(AgentMiddleware):
657
657
 
658
658
  tool_result = await handler(request)
659
659
  return self._intercept_large_tool_result(tool_result)
660
-
661
- # Back-compat aliases expected by some tests
662
- def _create_file_data(content: str):
663
- return create_file_data(content)
664
-
665
- def _update_file_data(file_data: dict, content: str):
666
- return update_file_data(file_data, content)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepagents
3
- Version: 0.1.5rc1
3
+ Version: 0.2.0
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
  Requires-Python: <4.0,>=3.11
@@ -9,13 +9,13 @@ License-File: LICENSE
9
9
  Requires-Dist: langchain-anthropic<2.0.0,>=1.0.0
10
10
  Requires-Dist: langchain<2.0.0,>=1.0.0
11
11
  Requires-Dist: langchain-core<2.0.0,>=1.0.0
12
+ Requires-Dist: wcmatch
12
13
  Provides-Extra: dev
13
14
  Requires-Dist: pytest; extra == "dev"
14
15
  Requires-Dist: pytest-cov; extra == "dev"
15
16
  Requires-Dist: build; extra == "dev"
16
17
  Requires-Dist: twine; extra == "dev"
17
18
  Requires-Dist: langchain-openai; extra == "dev"
18
- Requires-Dist: wcmatch; extra == "dev"
19
19
  Dynamic: license-file
20
20
 
21
21
  # 🧠🤖Deep Agents
@@ -28,7 +28,7 @@ a **planning tool**, **sub agents**, access to a **file system**, and a **detail
28
28
 
29
29
  <img src="deep_agents.png" alt="deep agent" width="600"/>
30
30
 
31
- `deepagents` is a Python package that implements these in a general purpose way so that you can easily create a Deep Agent for your application.
31
+ `deepagents` is a Python package that implements these in a general purpose way so that you can easily create a Deep Agent for your application. For a full overview and quickstart of `deepagents`, the best resource is our [docs](https://docs.langchain.com/oss/python/deepagents/overview).
32
32
 
33
33
  **Acknowledgements: This project was primarily inspired by Claude Code, and initially was largely an attempt to see what made Claude Code general purpose, and make it even more so.**
34
34
 
@@ -107,7 +107,7 @@ in the same way you would any LangGraph agent.
107
107
 
108
108
  **Context Management**
109
109
 
110
- File system tools (`ls`, `read_file`, `write_file`, `edit_file`) allow agents to offload large context to memory, preventing context window overflow and enabling work with variable-length tool results.
110
+ 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.
111
111
 
112
112
  **Subagent Spawning**
113
113
 
@@ -314,33 +314,6 @@ agent = create_deep_agent(
314
314
  )
315
315
  ```
316
316
 
317
- ### `backend`
318
- Deep agents come with a local filesystem to offload memory to. By default, this filesystem is stored in state (ephemeral, transient to a single thread).
319
-
320
- You can configure persistent long-term memory using a composite backend that routes a path prefix (for example, `/memories/`) to a persistent store.
321
-
322
- ```python
323
- from deepagents import create_deep_agent
324
- from deepagents.backends import build_composite_state_backend, StoreBackend
325
- from langgraph.store.memory import InMemoryStore
326
-
327
- store = InMemoryStore() # Or any other Store implementation
328
-
329
- # Provide a backend factory to the agent/middleware.
330
- # This builds a state-backed composite at runtime and routes /memories/ to StoreBackend.
331
- backend_factory = lambda rt: build_composite_state_backend(
332
- rt,
333
- routes={
334
- "/memories/": (lambda r: StoreBackend(r)),
335
- },
336
- )
337
-
338
- agent = create_deep_agent(
339
- backend=backend_factory,
340
- store=store,
341
- )
342
- ```
343
-
344
317
  ### `interrupt_on`
345
318
  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.
346
319
 
@@ -413,11 +386,7 @@ Context engineering is one of the main challenges in building effective agents.
413
386
  ```python
414
387
  from langchain.agents import create_agent
415
388
  from deepagents.middleware.filesystem import FilesystemMiddleware
416
- from deepagents.backends import (
417
- StateBackend,
418
- CompositeBackend,
419
- StoreBackend,
420
- )
389
+
421
390
 
422
391
  # FilesystemMiddleware is included by default in create_deep_agent
423
392
  # You can customize it if building a custom agent
@@ -425,12 +394,7 @@ agent = create_agent(
425
394
  model="anthropic:claude-sonnet-4-20250514",
426
395
  middleware=[
427
396
  FilesystemMiddleware(
428
- backend=lambda rt: StateBackend(rt), # Optional: customize storage backend (defaults to lambda rt: )
429
- # For persistent memory, use CompositeBackend:
430
- # backend=CompositeBackend(
431
- # default=lambda rt: StateBackend(rt)
432
- # routes={"/memories/": lambda rt: StoreBackend(rt)}
433
- # )
397
+ backend=..., # Optional: customize storage backend
434
398
  system_prompt="Write to the filesystem when...", # Optional custom system prompt override
435
399
  custom_tool_descriptions={
436
400
  "ls": "Use the ls tool when...",
@@ -15,17 +15,25 @@ from deepagents.middleware.filesystem import (
15
15
  FILESYSTEM_SYSTEM_PROMPT,
16
16
  FileData,
17
17
  FilesystemMiddleware,
18
- FilesystemState,
19
- _create_file_data,
20
- _update_file_data,
18
+ FilesystemState
21
19
  )
22
- from deepagents.backends import StoreBackend, CompositeBackend, build_composite_state_backend
20
+ from deepagents.backends import StoreBackend, CompositeBackend, StateBackend
23
21
 
24
22
  from deepagents.backends.utils import create_file_data, update_file_data
25
23
  from deepagents.middleware.patch_tool_calls import PatchToolCallsMiddleware
26
24
  from deepagents.middleware.subagents import DEFAULT_GENERAL_PURPOSE_DESCRIPTION, TASK_SYSTEM_PROMPT, TASK_TOOL_DESCRIPTION, SubAgentMiddleware
27
25
  from deepagents.backends.utils import truncate_if_too_long
28
26
 
27
+ def build_composite_state_backend(runtime: ToolRuntime, *, routes):
28
+ built_routes = {}
29
+ for prefix, backend_or_factory in routes.items():
30
+ if callable(backend_or_factory):
31
+ built_routes[prefix] = backend_or_factory(runtime)
32
+ else:
33
+ built_routes[prefix] = backend_or_factory
34
+ default_state = StateBackend(runtime)
35
+ return CompositeBackend(default=default_state, routes=built_routes)
36
+
29
37
  class TestAddMiddleware:
30
38
  def test_filesystem_middleware(self):
31
39
  middleware = [FilesystemMiddleware()]
File without changes
File without changes
@@ -1,6 +1,7 @@
1
1
  langchain-anthropic<2.0.0,>=1.0.0
2
2
  langchain<2.0.0,>=1.0.0
3
3
  langchain-core<2.0.0,>=1.0.0
4
+ wcmatch
4
5
 
5
6
  [dev]
6
7
  pytest
@@ -8,4 +9,3 @@ pytest-cov
8
9
  build
9
10
  twine
10
11
  langchain-openai
11
- wcmatch