deepagents 0.1.5rc1__py3-none-any.whl → 0.2.0__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.
- deepagents/backends/__init__.py +1 -2
- deepagents/backends/composite.py +1 -13
- deepagents/middleware/filesystem.py +0 -7
- {deepagents-0.1.5rc1.dist-info → deepagents-0.2.0.dist-info}/METADATA +6 -42
- {deepagents-0.1.5rc1.dist-info → deepagents-0.2.0.dist-info}/RECORD +8 -8
- {deepagents-0.1.5rc1.dist-info → deepagents-0.2.0.dist-info}/WHEEL +0 -0
- {deepagents-0.1.5rc1.dist-info → deepagents-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {deepagents-0.1.5rc1.dist-info → deepagents-0.2.0.dist-info}/top_level.txt +0 -0
deepagents/backends/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Memory backends for pluggable file storage."""
|
|
2
2
|
|
|
3
|
-
from deepagents.backends.composite import CompositeBackend
|
|
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",
|
deepagents/backends/composite.py
CHANGED
|
@@ -220,16 +220,4 @@ class CompositeBackend:
|
|
|
220
220
|
return res
|
|
221
221
|
|
|
222
222
|
|
|
223
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
|
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...",
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
deepagents/__init__.py,sha256=9BVNn4lfF5N8l2KY8Ttxi82zO609I-fGqoSIF7DAxiU,342
|
|
2
2
|
deepagents/graph.py,sha256=6hXBwvQDwbUtiF8Tgwf1jbvRHwJGLEJq89fy-DpVez0,6106
|
|
3
|
-
deepagents/backends/__init__.py,sha256=
|
|
4
|
-
deepagents/backends/composite.py,sha256=
|
|
3
|
+
deepagents/backends/__init__.py,sha256=qb2dt2axTQsh8BGqW2EDyJq8GazC8_z87MQYo_VXhBw,457
|
|
4
|
+
deepagents/backends/composite.py,sha256=1FLJQS2jAqeCwz-Zat4QQRLiklwgbKDZkkztZUJAgSA,8514
|
|
5
5
|
deepagents/backends/filesystem.py,sha256=oq3oI9W5kfmEXItOqKIGHx_PTKxjQTDh8IqVuV5ZFzw,17067
|
|
6
6
|
deepagents/backends/protocol.py,sha256=fwqJa_Ec6F4BoNYz0bcPHL_fiKksxw2RoyA6x5wr7dc,4181
|
|
7
7
|
deepagents/backends/state.py,sha256=Mm2U5IcTDxvJMhG3K1HGODCW70Qseb2arjPe5JewnO0,5439
|
|
8
8
|
deepagents/backends/store.py,sha256=NuxQK5znhbR5uz1PH6BfiWu9mGHWSk6TcKgb5ZuoJaM,12209
|
|
9
9
|
deepagents/backends/utils.py,sha256=0VK5_NJbolZs4iPzB53I6kyFpDdjgxLYGl4ob8pKYyw,13347
|
|
10
10
|
deepagents/middleware/__init__.py,sha256=J7372TNGR27OU4C3uuQMryHHpXOBjFV_4aEZ_AoQ6n0,284
|
|
11
|
-
deepagents/middleware/filesystem.py,sha256
|
|
11
|
+
deepagents/middleware/filesystem.py,sha256=IggpI5ENGy5ykB4HCtTq0l5mM618eUDaFiLYArTUi94,26897
|
|
12
12
|
deepagents/middleware/patch_tool_calls.py,sha256=Cu8rUpt1GjrYgfMvZG6wOowvnmFeYTCauOJhlltNPmo,2045
|
|
13
13
|
deepagents/middleware/subagents.py,sha256=hYW0cJV36fryu67S3H70VnM3SessiOz_vm3gSScC4a4,23535
|
|
14
|
-
deepagents-0.
|
|
15
|
-
deepagents-0.
|
|
16
|
-
deepagents-0.
|
|
17
|
-
deepagents-0.
|
|
18
|
-
deepagents-0.
|
|
14
|
+
deepagents-0.2.0.dist-info/licenses/LICENSE,sha256=c__BaxUCK69leo2yEKynf8lWndu8iwYwge1CbyqAe-E,1071
|
|
15
|
+
deepagents-0.2.0.dist-info/METADATA,sha256=KrdEh98Ptx0WBE3L5bMqjBPyouCW7D3jazb566Vu4ZY,18660
|
|
16
|
+
deepagents-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
17
|
+
deepagents-0.2.0.dist-info/top_level.txt,sha256=drAzchOzPNePwpb3_pbPuvLuayXkN7SNqeIKMBWJoAo,11
|
|
18
|
+
deepagents-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|