deepagents-cli 0.0.1__tar.gz → 0.0.3__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.
Potentially problematic release.
This version of deepagents-cli might be problematic. Click here for more details.
- {deepagents_cli-0.0.1/src/deepagents_cli.egg-info → deepagents_cli-0.0.3}/PKG-INFO +26 -30
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/README.md +21 -27
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/pyproject.toml +13 -5
- deepagents_cli-0.0.3/src/deepagents/__init__.py +7 -0
- deepagents_cli-0.0.3/src/deepagents/cli.py +567 -0
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/src/deepagents/default_agent_prompt.md +0 -27
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/src/deepagents/graph.py +16 -40
- deepagents_cli-0.0.3/src/deepagents/memory/__init__.py +17 -0
- deepagents_cli-0.0.3/src/deepagents/memory/backends/__init__.py +15 -0
- deepagents_cli-0.0.3/src/deepagents/memory/backends/composite.py +250 -0
- deepagents_cli-0.0.3/src/deepagents/memory/backends/filesystem.py +330 -0
- deepagents_cli-0.0.3/src/deepagents/memory/backends/state.py +206 -0
- deepagents_cli-0.0.3/src/deepagents/memory/backends/store.py +351 -0
- deepagents_cli-0.0.3/src/deepagents/memory/backends/utils.py +319 -0
- deepagents_cli-0.0.3/src/deepagents/memory/protocol.py +164 -0
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/src/deepagents/middleware/__init__.py +3 -3
- deepagents_cli-0.0.3/src/deepagents/middleware/agent_memory.py +207 -0
- deepagents_cli-0.0.3/src/deepagents/middleware/filesystem.py +615 -0
- deepagents_cli-0.0.3/src/deepagents/middleware/patch_tool_calls.py +44 -0
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/src/deepagents/middleware/subagents.py +7 -6
- deepagents_cli-0.0.3/src/deepagents/pretty_cli.py +289 -0
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3/src/deepagents_cli.egg-info}/PKG-INFO +26 -30
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/src/deepagents_cli.egg-info/SOURCES.txt +12 -7
- deepagents_cli-0.0.3/src/deepagents_cli.egg-info/requires.txt +16 -0
- deepagents_cli-0.0.3/tests/test_middleware.py +837 -0
- deepagents_cli-0.0.1/src/deepagents/__init__.py +0 -18
- deepagents_cli-0.0.1/src/deepagents/cli.py +0 -582
- deepagents_cli-0.0.1/src/deepagents/middleware/common.py +0 -16
- deepagents_cli-0.0.1/src/deepagents/middleware/filesystem.py +0 -1159
- deepagents_cli-0.0.1/src/deepagents/middleware/local_filesystem.py +0 -741
- deepagents_cli-0.0.1/src/deepagents/prompts.py +0 -327
- deepagents_cli-0.0.1/src/deepagents/skills.py +0 -85
- deepagents_cli-0.0.1/src/deepagents_cli.egg-info/requires.txt +0 -14
- deepagents_cli-0.0.1/tests/test_code_execution.py +0 -209
- deepagents_cli-0.0.1/tests/test_middleware.py +0 -173
- deepagents_cli-0.0.1/tests/test_skills.py +0 -189
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/LICENSE +0 -0
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/setup.cfg +0 -0
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/src/deepagents_cli.egg-info/dependency_links.txt +0 -0
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/src/deepagents_cli.egg-info/entry_points.txt +0 -0
- {deepagents_cli-0.0.1 → deepagents_cli-0.0.3}/src/deepagents_cli.egg-info/top_level.txt +0 -0
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepagents-cli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3
|
|
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
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
|
-
Requires-Dist: langchain-anthropic==1.0.0
|
|
10
|
-
Requires-Dist: langchain==1.0.0
|
|
11
|
-
Requires-Dist: langchain-core==1.0.0
|
|
12
9
|
Requires-Dist: tavily-python
|
|
13
10
|
Requires-Dist: python-dotenv
|
|
14
11
|
Requires-Dist: requests
|
|
15
12
|
Requires-Dist: rich>=13.0.0
|
|
13
|
+
Requires-Dist: langchain-anthropic<2.0.0,>=1.0.0
|
|
14
|
+
Requires-Dist: langchain<2.0.0,>=1.0.0
|
|
15
|
+
Requires-Dist: langchain-core<2.0.0,>=1.0.0
|
|
16
|
+
Requires-Dist: wcmatch
|
|
16
17
|
Provides-Extra: dev
|
|
17
18
|
Requires-Dist: pytest; extra == "dev"
|
|
19
|
+
Requires-Dist: pytest-recording; extra == "dev"
|
|
18
20
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
19
21
|
Requires-Dist: build; extra == "dev"
|
|
20
22
|
Requires-Dist: twine; extra == "dev"
|
|
@@ -319,40 +321,30 @@ agent = create_deep_agent(
|
|
|
319
321
|
)
|
|
320
322
|
```
|
|
321
323
|
|
|
322
|
-
### `
|
|
323
|
-
Deep agents come with a local filesystem to offload memory to.
|
|
324
|
+
### `memory_backend`
|
|
325
|
+
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).
|
|
324
326
|
|
|
325
|
-
You can
|
|
327
|
+
You can configure persistent long-term memory using a CompositeBackend with StoreBackend:
|
|
326
328
|
|
|
327
329
|
```python
|
|
328
330
|
from deepagents import create_deep_agent
|
|
331
|
+
from deepagents.memory.backends import StateBackend, StoreBackend, CompositeBackend
|
|
329
332
|
from langgraph.store.memory import InMemoryStore
|
|
330
333
|
|
|
331
334
|
store = InMemoryStore() # Or any other Store object
|
|
332
|
-
agent = create_deep_agent(
|
|
333
|
-
store=store,
|
|
334
|
-
use_longterm_memory=True
|
|
335
|
-
)
|
|
336
|
-
```
|
|
337
335
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
336
|
+
# Create a hybrid backend: ephemeral files in / and persistent files in /memories/
|
|
337
|
+
backend = CompositeBackend(
|
|
338
|
+
default=StateBackend(),
|
|
339
|
+
routes={"/memories/": StoreBackend()}
|
|
340
|
+
)
|
|
343
341
|
|
|
344
342
|
agent = create_deep_agent(
|
|
345
|
-
|
|
346
|
-
|
|
343
|
+
memory_backend=backend,
|
|
344
|
+
store=store
|
|
347
345
|
)
|
|
348
346
|
```
|
|
349
347
|
|
|
350
|
-
Notes:
|
|
351
|
-
- Local filesystem mode injects `ls`, `read_file`, `write_file`, `edit_file`, plus `glob` and `grep` (ripgrep-powered) for discovery/search.
|
|
352
|
-
- Long-term memory is not supported in local mode; attempting to set both `use_local_filesystem=True` and `use_longterm_memory=True` raises a ValueError.
|
|
353
|
-
- Large tool outputs are automatically evicted to the in-memory filesystem state as files under `/large_tool_results/{tool_call_id}`; use `read_file` with `offset`/`limit` to page through results.
|
|
354
|
-
- Be careful when enabling local mode in sensitive environments — tools can read and write files on disk.
|
|
355
|
-
|
|
356
348
|
### `interrupt_on`
|
|
357
349
|
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.
|
|
358
350
|
|
|
@@ -416,17 +408,16 @@ agent = create_agent(
|
|
|
416
408
|
### FilesystemMiddleware
|
|
417
409
|
|
|
418
410
|
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.
|
|
419
|
-
**FilesystemMiddleware** provides four tools to your agent to interact with short-term
|
|
411
|
+
**FilesystemMiddleware** provides four tools to your agent to interact with both short-term and long-term memory.
|
|
420
412
|
- **ls**: List the files in your filesystem
|
|
421
413
|
- **read_file**: Read an entire file, or a certain number of lines from a file
|
|
422
414
|
- **write_file**: Write a new file to your filesystem
|
|
423
415
|
- **edit_file**: Edit an existing file in your filesystem
|
|
424
416
|
|
|
425
|
-
If you want these tools to operate on your host filesystem instead of the agent state, use `create_deep_agent(..., use_local_filesystem=True)` or attach `LocalFilesystemMiddleware` directly. Local mode also provides `glob` and `grep` helpers for file discovery and content search.
|
|
426
|
-
|
|
427
417
|
```python
|
|
428
418
|
from langchain.agents import create_agent
|
|
429
419
|
from deepagents.middleware.filesystem import FilesystemMiddleware
|
|
420
|
+
from deepagents.memory.backends import StateBackend, StoreBackend, CompositeBackend
|
|
430
421
|
|
|
431
422
|
# FilesystemMiddleware is included by default in create_deep_agent
|
|
432
423
|
# You can customize it if building a custom agent
|
|
@@ -434,8 +425,13 @@ agent = create_agent(
|
|
|
434
425
|
model="anthropic:claude-sonnet-4-20250514",
|
|
435
426
|
middleware=[
|
|
436
427
|
FilesystemMiddleware(
|
|
437
|
-
|
|
438
|
-
|
|
428
|
+
memory_backend=StateBackend(), # Optional: customize storage backend (defaults to StateBackend)
|
|
429
|
+
# For persistent memory, use CompositeBackend:
|
|
430
|
+
# memory_backend=CompositeBackend(
|
|
431
|
+
# default=StateBackend(),
|
|
432
|
+
# routes={"/memories/": StoreBackend()}
|
|
433
|
+
# )
|
|
434
|
+
system_prompt="Write to the filesystem when...", # Optional custom system prompt override
|
|
439
435
|
custom_tool_descriptions={
|
|
440
436
|
"ls": "Use the ls tool when...",
|
|
441
437
|
"read_file": "Use the read_file tool to..."
|
|
@@ -296,40 +296,30 @@ agent = create_deep_agent(
|
|
|
296
296
|
)
|
|
297
297
|
```
|
|
298
298
|
|
|
299
|
-
### `
|
|
300
|
-
Deep agents come with a local filesystem to offload memory to.
|
|
299
|
+
### `memory_backend`
|
|
300
|
+
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).
|
|
301
301
|
|
|
302
|
-
You can
|
|
302
|
+
You can configure persistent long-term memory using a CompositeBackend with StoreBackend:
|
|
303
303
|
|
|
304
304
|
```python
|
|
305
305
|
from deepagents import create_deep_agent
|
|
306
|
+
from deepagents.memory.backends import StateBackend, StoreBackend, CompositeBackend
|
|
306
307
|
from langgraph.store.memory import InMemoryStore
|
|
307
308
|
|
|
308
309
|
store = InMemoryStore() # Or any other Store object
|
|
309
|
-
agent = create_deep_agent(
|
|
310
|
-
store=store,
|
|
311
|
-
use_longterm_memory=True
|
|
312
|
-
)
|
|
313
|
-
```
|
|
314
310
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
311
|
+
# Create a hybrid backend: ephemeral files in / and persistent files in /memories/
|
|
312
|
+
backend = CompositeBackend(
|
|
313
|
+
default=StateBackend(),
|
|
314
|
+
routes={"/memories/": StoreBackend()}
|
|
315
|
+
)
|
|
320
316
|
|
|
321
317
|
agent = create_deep_agent(
|
|
322
|
-
|
|
323
|
-
|
|
318
|
+
memory_backend=backend,
|
|
319
|
+
store=store
|
|
324
320
|
)
|
|
325
321
|
```
|
|
326
322
|
|
|
327
|
-
Notes:
|
|
328
|
-
- Local filesystem mode injects `ls`, `read_file`, `write_file`, `edit_file`, plus `glob` and `grep` (ripgrep-powered) for discovery/search.
|
|
329
|
-
- Long-term memory is not supported in local mode; attempting to set both `use_local_filesystem=True` and `use_longterm_memory=True` raises a ValueError.
|
|
330
|
-
- Large tool outputs are automatically evicted to the in-memory filesystem state as files under `/large_tool_results/{tool_call_id}`; use `read_file` with `offset`/`limit` to page through results.
|
|
331
|
-
- Be careful when enabling local mode in sensitive environments — tools can read and write files on disk.
|
|
332
|
-
|
|
333
323
|
### `interrupt_on`
|
|
334
324
|
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.
|
|
335
325
|
|
|
@@ -393,17 +383,16 @@ agent = create_agent(
|
|
|
393
383
|
### FilesystemMiddleware
|
|
394
384
|
|
|
395
385
|
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.
|
|
396
|
-
**FilesystemMiddleware** provides four tools to your agent to interact with short-term
|
|
386
|
+
**FilesystemMiddleware** provides four tools to your agent to interact with both short-term and long-term memory.
|
|
397
387
|
- **ls**: List the files in your filesystem
|
|
398
388
|
- **read_file**: Read an entire file, or a certain number of lines from a file
|
|
399
389
|
- **write_file**: Write a new file to your filesystem
|
|
400
390
|
- **edit_file**: Edit an existing file in your filesystem
|
|
401
391
|
|
|
402
|
-
If you want these tools to operate on your host filesystem instead of the agent state, use `create_deep_agent(..., use_local_filesystem=True)` or attach `LocalFilesystemMiddleware` directly. Local mode also provides `glob` and `grep` helpers for file discovery and content search.
|
|
403
|
-
|
|
404
392
|
```python
|
|
405
393
|
from langchain.agents import create_agent
|
|
406
394
|
from deepagents.middleware.filesystem import FilesystemMiddleware
|
|
395
|
+
from deepagents.memory.backends import StateBackend, StoreBackend, CompositeBackend
|
|
407
396
|
|
|
408
397
|
# FilesystemMiddleware is included by default in create_deep_agent
|
|
409
398
|
# You can customize it if building a custom agent
|
|
@@ -411,8 +400,13 @@ agent = create_agent(
|
|
|
411
400
|
model="anthropic:claude-sonnet-4-20250514",
|
|
412
401
|
middleware=[
|
|
413
402
|
FilesystemMiddleware(
|
|
414
|
-
|
|
415
|
-
|
|
403
|
+
memory_backend=StateBackend(), # Optional: customize storage backend (defaults to StateBackend)
|
|
404
|
+
# For persistent memory, use CompositeBackend:
|
|
405
|
+
# memory_backend=CompositeBackend(
|
|
406
|
+
# default=StateBackend(),
|
|
407
|
+
# routes={"/memories/": StoreBackend()}
|
|
408
|
+
# )
|
|
409
|
+
system_prompt="Write to the filesystem when...", # Optional custom system prompt override
|
|
416
410
|
custom_tool_descriptions={
|
|
417
411
|
"ls": "Use the ls tool when...",
|
|
418
412
|
"read_file": "Use the read_file tool to..."
|
|
@@ -529,4 +523,4 @@ async def main():
|
|
|
529
523
|
chunk["messages"][-1].pretty_print()
|
|
530
524
|
|
|
531
525
|
asyncio.run(main())
|
|
532
|
-
```
|
|
526
|
+
```
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "deepagents-cli"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.3"
|
|
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" }
|
|
7
7
|
requires-python = ">=3.11,<4.0"
|
|
8
8
|
dependencies = [
|
|
9
|
-
"langchain-anthropic==1.0.0",
|
|
10
|
-
"langchain==1.0.0",
|
|
11
|
-
"langchain-core==1.0.0",
|
|
12
9
|
"tavily-python",
|
|
13
10
|
"python-dotenv",
|
|
14
11
|
"requests",
|
|
15
|
-
"rich>=13.0.0"
|
|
12
|
+
"rich>=13.0.0",
|
|
13
|
+
"langchain-anthropic>=1.0.0,<2.0.0",
|
|
14
|
+
"langchain>=1.0.0,<2.0.0",
|
|
15
|
+
"langchain-core>=1.0.0,<2.0.0",
|
|
16
|
+
"wcmatch"
|
|
16
17
|
]
|
|
17
18
|
|
|
18
19
|
[project.scripts]
|
|
@@ -21,6 +22,7 @@ deepagents = "deepagents.cli:cli_main"
|
|
|
21
22
|
[project.optional-dependencies]
|
|
22
23
|
dev = [
|
|
23
24
|
"pytest",
|
|
25
|
+
"pytest-recording",
|
|
24
26
|
"pytest-cov",
|
|
25
27
|
"build",
|
|
26
28
|
"twine",
|
|
@@ -100,3 +102,9 @@ enable_error_code = ["deprecated"]
|
|
|
100
102
|
# Optional: reduce strictness if needed
|
|
101
103
|
disallow_any_generics = false
|
|
102
104
|
warn_return_any = false
|
|
105
|
+
|
|
106
|
+
[tool.pytest.ini_options]
|
|
107
|
+
markers = [
|
|
108
|
+
"vcr: record/replay HTTP via VCR"
|
|
109
|
+
]
|
|
110
|
+
addopts = "--record-mode=once"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"""DeepAgents package."""
|
|
2
|
+
|
|
3
|
+
from deepagents.graph import create_deep_agent
|
|
4
|
+
from deepagents.middleware.filesystem import FilesystemMiddleware
|
|
5
|
+
from deepagents.middleware.subagents import CompiledSubAgent, SubAgent, SubAgentMiddleware
|
|
6
|
+
|
|
7
|
+
__all__ = ["CompiledSubAgent", "FilesystemMiddleware", "SubAgent", "SubAgentMiddleware", "create_deep_agent"]
|