deepagents 0.1.4__py3-none-any.whl → 0.1.5rc1__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 +16 -0
- deepagents/backends/composite.py +235 -0
- deepagents/backends/filesystem.py +452 -0
- deepagents/backends/protocol.py +122 -0
- deepagents/backends/state.py +161 -0
- deepagents/backends/store.py +350 -0
- deepagents/backends/utils.py +424 -0
- deepagents/graph.py +10 -13
- deepagents/middleware/filesystem.py +249 -712
- deepagents/middleware/subagents.py +1 -1
- {deepagents-0.1.4.dist-info → deepagents-0.1.5rc1.dist-info}/METADATA +31 -11
- deepagents-0.1.5rc1.dist-info/RECORD +18 -0
- deepagents-0.1.4.dist-info/RECORD +0 -11
- {deepagents-0.1.4.dist-info → deepagents-0.1.5rc1.dist-info}/WHEEL +0 -0
- {deepagents-0.1.4.dist-info → deepagents-0.1.5rc1.dist-info}/licenses/LICENSE +0 -0
- {deepagents-0.1.4.dist-info → deepagents-0.1.5rc1.dist-info}/top_level.txt +0 -0
|
@@ -319,7 +319,7 @@ def _create_task_tool(
|
|
|
319
319
|
return Command(
|
|
320
320
|
update={
|
|
321
321
|
**state_update,
|
|
322
|
-
"messages": [ToolMessage(result["messages"][-1].
|
|
322
|
+
"messages": [ToolMessage(result["messages"][-1].text, tool_call_id=tool_call_id)],
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepagents
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5rc1
|
|
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
|
|
@@ -15,6 +15,7 @@ Requires-Dist: pytest-cov; extra == "dev"
|
|
|
15
15
|
Requires-Dist: build; extra == "dev"
|
|
16
16
|
Requires-Dist: twine; extra == "dev"
|
|
17
17
|
Requires-Dist: langchain-openai; extra == "dev"
|
|
18
|
+
Requires-Dist: wcmatch; extra == "dev"
|
|
18
19
|
Dynamic: license-file
|
|
19
20
|
|
|
20
21
|
# 🧠🤖Deep Agents
|
|
@@ -128,9 +129,7 @@ By default, `deepagents` uses `"claude-sonnet-4-5-20250929"`. You can customize
|
|
|
128
129
|
from langchain.chat_models import init_chat_model
|
|
129
130
|
from deepagents import create_deep_agent
|
|
130
131
|
|
|
131
|
-
model = init_chat_model(
|
|
132
|
-
model="openai:gpt-5",
|
|
133
|
-
)
|
|
132
|
+
model = init_chat_model("openai:gpt-4o")
|
|
134
133
|
agent = create_deep_agent(
|
|
135
134
|
model=model,
|
|
136
135
|
)
|
|
@@ -315,19 +314,30 @@ agent = create_deep_agent(
|
|
|
315
314
|
)
|
|
316
315
|
```
|
|
317
316
|
|
|
318
|
-
### `
|
|
319
|
-
Deep agents come with a local filesystem to offload memory to.
|
|
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).
|
|
320
319
|
|
|
321
|
-
You can
|
|
320
|
+
You can configure persistent long-term memory using a composite backend that routes a path prefix (for example, `/memories/`) to a persistent store.
|
|
322
321
|
|
|
323
322
|
```python
|
|
324
323
|
from deepagents import create_deep_agent
|
|
324
|
+
from deepagents.backends import build_composite_state_backend, StoreBackend
|
|
325
325
|
from langgraph.store.memory import InMemoryStore
|
|
326
326
|
|
|
327
|
-
store = InMemoryStore() # Or any other Store
|
|
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
|
+
|
|
328
338
|
agent = create_deep_agent(
|
|
339
|
+
backend=backend_factory,
|
|
329
340
|
store=store,
|
|
330
|
-
use_longterm_memory=True
|
|
331
341
|
)
|
|
332
342
|
```
|
|
333
343
|
|
|
@@ -403,6 +413,11 @@ Context engineering is one of the main challenges in building effective agents.
|
|
|
403
413
|
```python
|
|
404
414
|
from langchain.agents import create_agent
|
|
405
415
|
from deepagents.middleware.filesystem import FilesystemMiddleware
|
|
416
|
+
from deepagents.backends import (
|
|
417
|
+
StateBackend,
|
|
418
|
+
CompositeBackend,
|
|
419
|
+
StoreBackend,
|
|
420
|
+
)
|
|
406
421
|
|
|
407
422
|
# FilesystemMiddleware is included by default in create_deep_agent
|
|
408
423
|
# You can customize it if building a custom agent
|
|
@@ -410,8 +425,13 @@ agent = create_agent(
|
|
|
410
425
|
model="anthropic:claude-sonnet-4-20250514",
|
|
411
426
|
middleware=[
|
|
412
427
|
FilesystemMiddleware(
|
|
413
|
-
|
|
414
|
-
|
|
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
|
+
# )
|
|
434
|
+
system_prompt="Write to the filesystem when...", # Optional custom system prompt override
|
|
415
435
|
custom_tool_descriptions={
|
|
416
436
|
"ls": "Use the ls tool when...",
|
|
417
437
|
"read_file": "Use the read_file tool to..."
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
deepagents/__init__.py,sha256=9BVNn4lfF5N8l2KY8Ttxi82zO609I-fGqoSIF7DAxiU,342
|
|
2
|
+
deepagents/graph.py,sha256=6hXBwvQDwbUtiF8Tgwf1jbvRHwJGLEJq89fy-DpVez0,6106
|
|
3
|
+
deepagents/backends/__init__.py,sha256=F2wSsZZcFeLDVb_thia6I7SviPuFmxhFHDn_VzfJ__U,525
|
|
4
|
+
deepagents/backends/composite.py,sha256=ZJBSXcfx07dk97buA013L7u0TK2EAj8aOITpLsvw8OQ,8985
|
|
5
|
+
deepagents/backends/filesystem.py,sha256=oq3oI9W5kfmEXItOqKIGHx_PTKxjQTDh8IqVuV5ZFzw,17067
|
|
6
|
+
deepagents/backends/protocol.py,sha256=fwqJa_Ec6F4BoNYz0bcPHL_fiKksxw2RoyA6x5wr7dc,4181
|
|
7
|
+
deepagents/backends/state.py,sha256=Mm2U5IcTDxvJMhG3K1HGODCW70Qseb2arjPe5JewnO0,5439
|
|
8
|
+
deepagents/backends/store.py,sha256=NuxQK5znhbR5uz1PH6BfiWu9mGHWSk6TcKgb5ZuoJaM,12209
|
|
9
|
+
deepagents/backends/utils.py,sha256=0VK5_NJbolZs4iPzB53I6kyFpDdjgxLYGl4ob8pKYyw,13347
|
|
10
|
+
deepagents/middleware/__init__.py,sha256=J7372TNGR27OU4C3uuQMryHHpXOBjFV_4aEZ_AoQ6n0,284
|
|
11
|
+
deepagents/middleware/filesystem.py,sha256=-h75Rvy6uJtDL8a-zTilNe8bMKLSxaUHsgtP1j7liqE,27120
|
|
12
|
+
deepagents/middleware/patch_tool_calls.py,sha256=Cu8rUpt1GjrYgfMvZG6wOowvnmFeYTCauOJhlltNPmo,2045
|
|
13
|
+
deepagents/middleware/subagents.py,sha256=hYW0cJV36fryu67S3H70VnM3SessiOz_vm3gSScC4a4,23535
|
|
14
|
+
deepagents-0.1.5rc1.dist-info/licenses/LICENSE,sha256=c__BaxUCK69leo2yEKynf8lWndu8iwYwge1CbyqAe-E,1071
|
|
15
|
+
deepagents-0.1.5rc1.dist-info/METADATA,sha256=gLevYNWRw8o0JkSYK5ic8webpAx7fLjp0wpkLcDZRDw,19822
|
|
16
|
+
deepagents-0.1.5rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
17
|
+
deepagents-0.1.5rc1.dist-info/top_level.txt,sha256=drAzchOzPNePwpb3_pbPuvLuayXkN7SNqeIKMBWJoAo,11
|
|
18
|
+
deepagents-0.1.5rc1.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
deepagents/__init__.py,sha256=9BVNn4lfF5N8l2KY8Ttxi82zO609I-fGqoSIF7DAxiU,342
|
|
2
|
-
deepagents/graph.py,sha256=biCHO7RbtOVkHh2q4u4yP4lv5QkBb6rAPKAg2mJRFwU,6010
|
|
3
|
-
deepagents/middleware/__init__.py,sha256=J7372TNGR27OU4C3uuQMryHHpXOBjFV_4aEZ_AoQ6n0,284
|
|
4
|
-
deepagents/middleware/filesystem.py,sha256=jETA-Z1ZvSAAyhN8LshucEQl5mvGiltKoQSkCIfLoLQ,44484
|
|
5
|
-
deepagents/middleware/patch_tool_calls.py,sha256=Cu8rUpt1GjrYgfMvZG6wOowvnmFeYTCauOJhlltNPmo,2045
|
|
6
|
-
deepagents/middleware/subagents.py,sha256=NH7QEShEPAosc3HLbSFwlgtlZv3SZpkPEAqHRbuqE_c,23538
|
|
7
|
-
deepagents-0.1.4.dist-info/licenses/LICENSE,sha256=c__BaxUCK69leo2yEKynf8lWndu8iwYwge1CbyqAe-E,1071
|
|
8
|
-
deepagents-0.1.4.dist-info/METADATA,sha256=XxJ_T-2NT6MnnSisL1S356_Qnbcjehi5d_f9P0wqJQ0,19093
|
|
9
|
-
deepagents-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
-
deepagents-0.1.4.dist-info/top_level.txt,sha256=drAzchOzPNePwpb3_pbPuvLuayXkN7SNqeIKMBWJoAo,11
|
|
11
|
-
deepagents-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|