langchain-deepagents-tensorlake 0.1.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.

Potentially problematic release.


This version of langchain-deepagents-tensorlake might be problematic. Click here for more details.

Files changed (25) hide show
  1. langchain_deepagents_tensorlake-0.1.0/.github/workflows/ci.yml +41 -0
  2. langchain_deepagents_tensorlake-0.1.0/.github/workflows/publish.yml +33 -0
  3. langchain_deepagents_tensorlake-0.1.0/.gitignore +14 -0
  4. langchain_deepagents_tensorlake-0.1.0/LICENSE +184 -0
  5. langchain_deepagents_tensorlake-0.1.0/Makefile +64 -0
  6. langchain_deepagents_tensorlake-0.1.0/PKG-INFO +177 -0
  7. langchain_deepagents_tensorlake-0.1.0/README.md +157 -0
  8. langchain_deepagents_tensorlake-0.1.0/langchain_deepagents_tensorlake/__init__.py +6 -0
  9. langchain_deepagents_tensorlake-0.1.0/langchain_deepagents_tensorlake/_utils.py +44 -0
  10. langchain_deepagents_tensorlake-0.1.0/langchain_deepagents_tensorlake/_version.py +3 -0
  11. langchain_deepagents_tensorlake-0.1.0/langchain_deepagents_tensorlake/backends/__init__.py +7 -0
  12. langchain_deepagents_tensorlake-0.1.0/langchain_deepagents_tensorlake/backends/filesystem.py +434 -0
  13. langchain_deepagents_tensorlake-0.1.0/langchain_deepagents_tensorlake/py.typed +0 -0
  14. langchain_deepagents_tensorlake-0.1.0/langchain_deepagents_tensorlake/sandbox.py +209 -0
  15. langchain_deepagents_tensorlake-0.1.0/pypi.txt +1 -0
  16. langchain_deepagents_tensorlake-0.1.0/pyproject.toml +95 -0
  17. langchain_deepagents_tensorlake-0.1.0/tests/integration_tests/__init__.py +0 -0
  18. langchain_deepagents_tensorlake-0.1.0/tests/integration_tests/test_filesystem.py +85 -0
  19. langchain_deepagents_tensorlake-0.1.0/tests/integration_tests/test_integration.py +36 -0
  20. langchain_deepagents_tensorlake-0.1.0/tests/unit_tests/__init__.py +0 -0
  21. langchain_deepagents_tensorlake-0.1.0/tests/unit_tests/test_backend_contract.py +224 -0
  22. langchain_deepagents_tensorlake-0.1.0/tests/unit_tests/test_deepagents_compatibility.py +195 -0
  23. langchain_deepagents_tensorlake-0.1.0/tests/unit_tests/test_filesystem.py +177 -0
  24. langchain_deepagents_tensorlake-0.1.0/tests/unit_tests/test_import.py +81 -0
  25. langchain_deepagents_tensorlake-0.1.0/uv.lock +2343 -0
@@ -0,0 +1,41 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ python-version: ["3.11", "3.12", "3.13"]
14
+ deepagents: ["locked"]
15
+ include:
16
+ - python-version: "3.11"
17
+ deepagents: "0.7.0"
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: astral-sh/setup-uv@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ - run: uv sync --locked --all-groups
24
+ - if: matrix.deepagents != 'locked'
25
+ run: uv pip install "deepagents==${{ matrix.deepagents }}"
26
+ - run: make test PYTEST_EXTRA="-n auto -q"
27
+ env:
28
+ UV_NO_SYNC: true
29
+
30
+ lint:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - uses: astral-sh/setup-uv@v5
35
+ with:
36
+ python-version: "3.11"
37
+ - run: uv sync --locked --all-groups
38
+ - run: uv run ruff check .
39
+ - run: uv run ruff format --check .
40
+ - run: uv run ty check langchain_deepagents_tensorlake
41
+ - run: uv build
@@ -0,0 +1,33 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v5
14
+ with:
15
+ python-version: "3.11"
16
+ - run: uv build
17
+ - uses: actions/upload-artifact@v4
18
+ with:
19
+ name: dist
20
+ path: dist/
21
+
22
+ publish:
23
+ needs: build
24
+ runs-on: ubuntu-latest
25
+ environment: pypi
26
+ permissions:
27
+ id-token: write
28
+ steps:
29
+ - uses: actions/download-artifact@v4
30
+ with:
31
+ name: dist
32
+ path: dist/
33
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,14 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ .env
8
+ .env.*
9
+ *.so
10
+ .pytest_cache/
11
+ .ruff_cache/
12
+ .coverage
13
+ htmlcov/
14
+ .tensorlake/
@@ -0,0 +1,184 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submitted" means any form of electronic, verbal,
51
+ or written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source code control systems, and issue tracking systems that are managed
54
+ by, or on behalf of, the Licensor for the purpose of developing and
55
+ improving the Work, but excluding communication that is conspicuously
56
+ marked or designated in writing by the copyright owner as "Not a
57
+ Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and included
61
+ within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by the combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You
79
+ institute patent litigation against any entity (including a cross-claim
80
+ or counterclaim in a lawsuit) alleging that the Work or any such
81
+ Contribution constitutes direct or contributory patent infringement,
82
+ then any patent licenses granted to You under this License for that
83
+ Work shall terminate as of the date such litigation is filed.
84
+
85
+ 4. Redistribution. You may reproduce and distribute copies of the
86
+ Work or Derivative Works thereof in any medium, with or without
87
+ modifications, and in Source or Object form, provided that You
88
+ meet the following conditions:
89
+
90
+ (a) You must give any other recipients of the Work or Derivative
91
+ Works a copy of this License; and
92
+
93
+ (b) You must cause any modified files to carry prominent notices
94
+ stating that You changed the files; and
95
+
96
+ (c) You must retain, in the Source form of any Derivative Works
97
+ that You distribute, all copyright, patent, trademark, and
98
+ attribution notices from the Source form of the Work,
99
+ excluding those notices that do not pertain to any part of
100
+ the Derivative Works; and
101
+
102
+ (d) If the Work includes a "NOTICE" text file as part of its
103
+ distribution, You must include a readable copy of the
104
+ attribution notices contained within such NOTICE file, in
105
+ at least one of the following places: within a NOTICE text
106
+ file distributed as part of the Derivative Works; within
107
+ the Source form or documentation, if provided along with the
108
+ Derivative Works; or, within a display generated by the
109
+ Derivative Works, if and wherever such third-party notices
110
+ normally appear. The contents of the NOTICE file are for
111
+ informational purposes only and do not modify the License.
112
+ You may add Your own attribution notices within Derivative
113
+ Works that You distribute, alongside or in addition to the
114
+ NOTICE text from the Work, provided that such additional
115
+ attribution notices cannot be construed as modifying the License.
116
+
117
+ You may add Your own license statement for Your modifications and
118
+ may provide additional grant of rights to use, copy, modify, merge,
119
+ publish, distribute, sublicense, and/or sell copies of Your
120
+ Contributions, either on a standalone basis or together with the
121
+ Work, provided Your use, reproduction, and distribution of the Work
122
+ otherwise complies with the conditions stated in this License.
123
+
124
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
125
+ any Contribution intentionally submitted for inclusion in the Work
126
+ by You to the Licensor shall be under the terms and conditions of
127
+ this License, without any additional terms or conditions.
128
+ Notwithstanding the above, nothing herein shall supersede or modify
129
+ the terms of any separate license agreement you may have executed
130
+ with Licensor regarding such Contributions.
131
+
132
+ 6. Trademarks. This License does not grant permission to use the trade
133
+ names, trademarks, service marks, or product names of the Licensor,
134
+ except as required for reasonable and customary use in describing the
135
+ origin of the Work and reproducing the content of the NOTICE file.
136
+
137
+ 7. Disclaimer of Warranty. Unless required by applicable law or
138
+ agreed to in writing, Licensor provides the Work (and each
139
+ Contributor provides its Contributions) on an "AS IS" BASIS,
140
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
141
+ implied, including, without limitation, any conditions of TITLE,
142
+ NONINFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
143
+ PURPOSE. You are solely responsible for determining the
144
+ appropriateness of using or reproducing the Work and assume any
145
+ risks associated with Your exercise of permissions under this License.
146
+
147
+ 8. Limitation of Liability. In no event and under no legal theory,
148
+ whether in tort (including negligence), contract, or otherwise,
149
+ unless required by applicable law (such as deliberate and grossly
150
+ negligent acts) or agreed to in writing, shall any Contributor be
151
+ liable to You for damages, including any direct, indirect, special,
152
+ incidental, or exemplary damages of any character arising as a
153
+ result of this License or out of the use or inability to use the
154
+ Work (including but not limited to damages for loss of goodwill,
155
+ work stoppage, computer failure or malfunction, or all other
156
+ commercial damages or losses), even if such Contributor has been
157
+ advised of the possibility of such damages.
158
+
159
+ 9. Accepting Warranty or Liability. While redistributing the Work or
160
+ Derivative Works thereof, You may choose to offer, and charge a fee
161
+ for, acceptance of support, warranty, indemnity, or other liability
162
+ obligations and/or rights consistent with this License. However, in
163
+ accepting such obligations, You may offer such conditions only on
164
+ Your own behalf and on Your sole responsibility, not on behalf of
165
+ any other Contributor, and only if You agree to indemnify, defend,
166
+ and hold each Contributor harmless for any liability incurred by,
167
+ or claims asserted against, such Contributor by reason of your
168
+ accepting any such warranty or additional liability.
169
+
170
+ END OF TERMS AND CONDITIONS
171
+
172
+ Copyright 2025 Tensorlake, Inc.
173
+
174
+ Licensed under the Apache License, Version 2.0 (the "License");
175
+ you may not use this file except in compliance with the License.
176
+ You may obtain a copy of the License at
177
+
178
+ http://www.apache.org/licenses/LICENSE-2.0
179
+
180
+ Unless required by applicable law or agreed to in writing, software
181
+ distributed under the License is distributed on an "AS IS" BASIS,
182
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183
+ See the License for the specific language governing permissions and
184
+ limitations under the License.
@@ -0,0 +1,64 @@
1
+ .PHONY: format lint type typecheck test tests integration_test integration_tests test_watch benchmark help lint_package
2
+
3
+ .DEFAULT_GOAL := help
4
+
5
+ .EXPORT_ALL_VARIABLES:
6
+ UV_FROZEN = true
7
+
8
+ ######################
9
+ # TESTING
10
+ ######################
11
+
12
+ TEST_FILE ?= tests/unit_tests/
13
+ PYTEST_EXTRA ?=
14
+
15
+ integration_test integration_tests: TEST_FILE=tests/integration_tests/
16
+
17
+ test: ## Run unit tests
18
+ test tests:
19
+ uv run --group test pytest -vvv $(PYTEST_EXTRA) --disable-socket --allow-unix-socket $(TEST_FILE)
20
+
21
+ integration_test: ## Run integration tests
22
+ integration_test integration_tests:
23
+ uv run --group test pytest -vvv --timeout 30 $(TEST_FILE)
24
+
25
+ test_watch: ## Run tests in watch mode
26
+ uv run --group test ptw --now . -- -vv $(TEST_FILE)
27
+
28
+ benchmark: ## Run benchmark tests
29
+ uv run --group test pytest ./tests -m benchmark
30
+
31
+ ######################
32
+ # LINTING AND FORMATTING
33
+ ######################
34
+
35
+ PYTHON_FILES=.
36
+ lint format: PYTHON_FILES=.
37
+ lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/partners/tensorlake --name-only --diff-filter=d main | grep -E '\.py$$|\.ipynb$$')
38
+ lint_package: ## Lint only the package
39
+ lint_package: PYTHON_FILES=langchain_deepagents_tensorlake
40
+
41
+ lint: ## Run linters and type checker
42
+ lint lint_diff lint_package:
43
+ [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff check $(PYTHON_FILES)
44
+ [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff format $(PYTHON_FILES) --diff
45
+ $(MAKE) type
46
+
47
+ type: ## Run type checker
48
+ type typecheck:
49
+ uv run --all-groups ty check langchain_deepagents_tensorlake
50
+
51
+ format: ## Run code formatters
52
+ format format_diff:
53
+ [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff format $(PYTHON_FILES)
54
+ [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff check --fix $(PYTHON_FILES)
55
+
56
+ ######################
57
+ # HELP
58
+ ######################
59
+
60
+ help: ## Show this help message
61
+ @echo "Usage: make [target] [TEST_FILE=path/to/tests/]"
62
+ @echo ""
63
+ @echo "Targets:"
64
+ @awk 'BEGIN {FS = ":.*##"} /^[a-zA-Z_-]+:.*##/ {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.5
2
+ Name: langchain-deepagents-tensorlake
3
+ Version: 0.1.0
4
+ Summary: Tensorlake sandbox and Cloud Volume filesystem backends for Deep Agents
5
+ Project-URL: Homepage, https://github.com/tensorlakeai/langchain-deepagents-tensorlake
6
+ Project-URL: Repository, https://github.com/tensorlakeai/langchain-deepagents-tensorlake
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Requires-Python: <4.0,>=3.11
17
+ Requires-Dist: deepagents>=0.7
18
+ Requires-Dist: tensorlake<0.6,>=0.5.151
19
+ Description-Content-Type: text/markdown
20
+
21
+ # langchain-deepagents-tensorlake
22
+
23
+ [Tensorlake](https://tensorlake.ai) sandbox provider and Cloud Volume filesystem backends
24
+ for [Deep Agents](https://github.com/langchain-ai/deepagents).
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install langchain-deepagents-tensorlake
30
+ ```
31
+
32
+ To use this checkout, including the merged filesystem backend:
33
+
34
+ ```bash
35
+ uv sync --locked --all-groups
36
+ ```
37
+
38
+ Requires Python 3.11+ and Deep Agents `>=0.7`. Both backends are included
39
+ in this distribution; a separate `langchain-tensorlake-backend` installation is
40
+ not needed. Existing filesystem users should change their import to
41
+ `from langchain_deepagents_tensorlake import TensorlakeFilesystemBackend`.
42
+
43
+ ## Sandbox
44
+
45
+ Use `TensorlakeSandbox` for shell execution and file tools inside a Tensorlake
46
+ sandbox:
47
+
48
+ ```python
49
+ from tensorlake.sandbox import Sandbox
50
+ from langchain_deepagents_tensorlake import TensorlakeSandbox
51
+ from deepagents.backends import CompositeBackend
52
+
53
+ # Create a Tensorlake sandbox
54
+ sandbox = Sandbox.create(api_key="your-api-key")
55
+ backend = TensorlakeSandbox(sandbox=sandbox)
56
+
57
+ # Use directly as a DeepAgents backend
58
+ # or wrap with CompositeBackend for routing
59
+ ```
60
+
61
+ With the Deep Agents CLI (`deepagents-code`), set:
62
+
63
+ ```bash
64
+ export TENSORLAKE_API_KEY=your-api-key
65
+ deepagents-code --sandbox tensorlake
66
+ ```
67
+
68
+ > **Note:** CLI integration requires `deepagents-code` to be configured with
69
+ > a custom `sandbox_factory` that maps `"tensorlake"` to `TensorlakeSandbox`.
70
+ > See the [examples](examples/) directory for a complete setup.
71
+
72
+ The caller manages sandbox creation and termination. Mounting a Cloud Volume
73
+ inside a sandbox and coordinating access with a filesystem backend are also
74
+ application responsibilities.
75
+
76
+ ## Cloud Volume filesystem
77
+
78
+ Use `TensorlakeFilesystemBackend` for file tools backed by an existing Cloud
79
+ Volume, including when no sandbox is running. Set `TENSORLAKE_API_KEY` in the
80
+ trusted application environment, then select the volume:
81
+
82
+ ```python
83
+ from deepagents import create_deep_agent
84
+ from tensorlake.filesystem import FilesystemClient
85
+
86
+ from langchain_deepagents_tensorlake import TensorlakeFilesystemBackend
87
+
88
+ filesystem = FilesystemClient().get("agent-workspace")
89
+ backend = TensorlakeFilesystemBackend(filesystem)
90
+ agent = create_deep_agent(model="openai:gpt-4.1", backend=backend)
91
+
92
+ # You can also use the backend directly.
93
+ result = backend.read("/report.md")
94
+ if result.error:
95
+ raise RuntimeError(result.error)
96
+ print(result.file_data["content"])
97
+ ```
98
+
99
+ The backend supports `ls`, `read`, `write`, `edit`, `delete`, `glob`, `grep`, binary
100
+ upload/download, and their async counterparts. `write` creates a new file; use
101
+ `edit` or upload to replace an existing file. It accepts either a `Filesystem`
102
+ instance or a synchronous resolver. The application selects and manages volumes,
103
+ shared locks, and retained snapshots.
104
+
105
+ File operations return native Deep Agents result types, including pagination
106
+ metadata and search truncation. Deletion is available directly, through
107
+ `CompositeBackend`, and through the agent's built-in file tools.
108
+
109
+ It can also be mounted under a virtual prefix:
110
+
111
+ ```python
112
+ from deepagents.backends import CompositeBackend, StateBackend
113
+
114
+ combined = CompositeBackend(default=StateBackend(), routes={"/workspace/": backend})
115
+ agent = create_deep_agent(model="openai:gpt-4.1", backend=combined)
116
+ ```
117
+
118
+ ### Paths and file operations
119
+
120
+ Use absolute POSIX paths within the supplied volume. Traversal paths are
121
+ rejected; dotfiles are supported, and symlinks are skipped in listings and
122
+ searches. Root is only valid for directory operations.
123
+
124
+ - Text reads support pagination; binary previews are limited to 500 KiB.
125
+ Use downloads for raw bytes. Reads and searches use a fixed volume version.
126
+ - `write` creates files; `edit` requires a unique exact match unless
127
+ `replace_all=True`. Uploads can replace existing files.
128
+ - Uploads validate the batch before one SDK write; downloads return a result
129
+ for each path.
130
+
131
+ ### Ownership, limits, and errors
132
+
133
+ The caller manages volumes, credentials, sandbox lifecycle, and retained
134
+ snapshots. Keep credentials outside agent-visible files.
135
+
136
+ The backend does not lock file operations. Callers must coordinate conflicting
137
+ access: `write` existence checks and `edit` read-modify-write are not atomic.
138
+ Async methods use worker threads; supplied filesystems and resolvers must
139
+ support concurrent calls or be serialized by the caller.
140
+
141
+ Constructor limits must be positive integers:
142
+
143
+ | Option | Default | Limit |
144
+ | --- | --- | --- |
145
+ | `max_file_bytes` | 32 MiB | Bytes read or written by one file operation |
146
+ | `max_search_files` | 10,000 | Entries visited during a search |
147
+ | `max_search_bytes` | 64 MiB | Content bytes inspected by grep |
148
+
149
+ These are processing limits, not storage quotas. Files are downloaded in full
150
+ before read-size checks. Storage errors omit raw provider details; authentication
151
+ and permission failures remain distinct from missing files.
152
+
153
+ See the [Deep Agents backend documentation](https://docs.langchain.com/oss/python/deepagents/backends),
154
+ [Tensorlake Cloud Volume HTTP API](https://docs.tensorlake.ai/filesystems/http-api),
155
+ and [Tensorlake authentication](https://docs.tensorlake.ai/platform/authentication)
156
+ for the underlying APIs.
157
+
158
+ ## Development
159
+
160
+ ```bash
161
+ uv sync --locked --all-groups
162
+ make test
163
+ make lint
164
+ uv build
165
+ ```
166
+
167
+ The default `uv run --group test pytest` runs unit tests only, without creating
168
+ remote resources. Real-service tests are selected explicitly and create and
169
+ clean up temporary volumes or sandboxes:
170
+
171
+ ```bash
172
+ uv run --group test --env-file .env pytest tests/integration_tests/
173
+ ```
174
+
175
+ ## License
176
+
177
+ Apache 2.0
@@ -0,0 +1,157 @@
1
+ # langchain-deepagents-tensorlake
2
+
3
+ [Tensorlake](https://tensorlake.ai) sandbox provider and Cloud Volume filesystem backends
4
+ for [Deep Agents](https://github.com/langchain-ai/deepagents).
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ pip install langchain-deepagents-tensorlake
10
+ ```
11
+
12
+ To use this checkout, including the merged filesystem backend:
13
+
14
+ ```bash
15
+ uv sync --locked --all-groups
16
+ ```
17
+
18
+ Requires Python 3.11+ and Deep Agents `>=0.7`. Both backends are included
19
+ in this distribution; a separate `langchain-tensorlake-backend` installation is
20
+ not needed. Existing filesystem users should change their import to
21
+ `from langchain_deepagents_tensorlake import TensorlakeFilesystemBackend`.
22
+
23
+ ## Sandbox
24
+
25
+ Use `TensorlakeSandbox` for shell execution and file tools inside a Tensorlake
26
+ sandbox:
27
+
28
+ ```python
29
+ from tensorlake.sandbox import Sandbox
30
+ from langchain_deepagents_tensorlake import TensorlakeSandbox
31
+ from deepagents.backends import CompositeBackend
32
+
33
+ # Create a Tensorlake sandbox
34
+ sandbox = Sandbox.create(api_key="your-api-key")
35
+ backend = TensorlakeSandbox(sandbox=sandbox)
36
+
37
+ # Use directly as a DeepAgents backend
38
+ # or wrap with CompositeBackend for routing
39
+ ```
40
+
41
+ With the Deep Agents CLI (`deepagents-code`), set:
42
+
43
+ ```bash
44
+ export TENSORLAKE_API_KEY=your-api-key
45
+ deepagents-code --sandbox tensorlake
46
+ ```
47
+
48
+ > **Note:** CLI integration requires `deepagents-code` to be configured with
49
+ > a custom `sandbox_factory` that maps `"tensorlake"` to `TensorlakeSandbox`.
50
+ > See the [examples](examples/) directory for a complete setup.
51
+
52
+ The caller manages sandbox creation and termination. Mounting a Cloud Volume
53
+ inside a sandbox and coordinating access with a filesystem backend are also
54
+ application responsibilities.
55
+
56
+ ## Cloud Volume filesystem
57
+
58
+ Use `TensorlakeFilesystemBackend` for file tools backed by an existing Cloud
59
+ Volume, including when no sandbox is running. Set `TENSORLAKE_API_KEY` in the
60
+ trusted application environment, then select the volume:
61
+
62
+ ```python
63
+ from deepagents import create_deep_agent
64
+ from tensorlake.filesystem import FilesystemClient
65
+
66
+ from langchain_deepagents_tensorlake import TensorlakeFilesystemBackend
67
+
68
+ filesystem = FilesystemClient().get("agent-workspace")
69
+ backend = TensorlakeFilesystemBackend(filesystem)
70
+ agent = create_deep_agent(model="openai:gpt-4.1", backend=backend)
71
+
72
+ # You can also use the backend directly.
73
+ result = backend.read("/report.md")
74
+ if result.error:
75
+ raise RuntimeError(result.error)
76
+ print(result.file_data["content"])
77
+ ```
78
+
79
+ The backend supports `ls`, `read`, `write`, `edit`, `delete`, `glob`, `grep`, binary
80
+ upload/download, and their async counterparts. `write` creates a new file; use
81
+ `edit` or upload to replace an existing file. It accepts either a `Filesystem`
82
+ instance or a synchronous resolver. The application selects and manages volumes,
83
+ shared locks, and retained snapshots.
84
+
85
+ File operations return native Deep Agents result types, including pagination
86
+ metadata and search truncation. Deletion is available directly, through
87
+ `CompositeBackend`, and through the agent's built-in file tools.
88
+
89
+ It can also be mounted under a virtual prefix:
90
+
91
+ ```python
92
+ from deepagents.backends import CompositeBackend, StateBackend
93
+
94
+ combined = CompositeBackend(default=StateBackend(), routes={"/workspace/": backend})
95
+ agent = create_deep_agent(model="openai:gpt-4.1", backend=combined)
96
+ ```
97
+
98
+ ### Paths and file operations
99
+
100
+ Use absolute POSIX paths within the supplied volume. Traversal paths are
101
+ rejected; dotfiles are supported, and symlinks are skipped in listings and
102
+ searches. Root is only valid for directory operations.
103
+
104
+ - Text reads support pagination; binary previews are limited to 500 KiB.
105
+ Use downloads for raw bytes. Reads and searches use a fixed volume version.
106
+ - `write` creates files; `edit` requires a unique exact match unless
107
+ `replace_all=True`. Uploads can replace existing files.
108
+ - Uploads validate the batch before one SDK write; downloads return a result
109
+ for each path.
110
+
111
+ ### Ownership, limits, and errors
112
+
113
+ The caller manages volumes, credentials, sandbox lifecycle, and retained
114
+ snapshots. Keep credentials outside agent-visible files.
115
+
116
+ The backend does not lock file operations. Callers must coordinate conflicting
117
+ access: `write` existence checks and `edit` read-modify-write are not atomic.
118
+ Async methods use worker threads; supplied filesystems and resolvers must
119
+ support concurrent calls or be serialized by the caller.
120
+
121
+ Constructor limits must be positive integers:
122
+
123
+ | Option | Default | Limit |
124
+ | --- | --- | --- |
125
+ | `max_file_bytes` | 32 MiB | Bytes read or written by one file operation |
126
+ | `max_search_files` | 10,000 | Entries visited during a search |
127
+ | `max_search_bytes` | 64 MiB | Content bytes inspected by grep |
128
+
129
+ These are processing limits, not storage quotas. Files are downloaded in full
130
+ before read-size checks. Storage errors omit raw provider details; authentication
131
+ and permission failures remain distinct from missing files.
132
+
133
+ See the [Deep Agents backend documentation](https://docs.langchain.com/oss/python/deepagents/backends),
134
+ [Tensorlake Cloud Volume HTTP API](https://docs.tensorlake.ai/filesystems/http-api),
135
+ and [Tensorlake authentication](https://docs.tensorlake.ai/platform/authentication)
136
+ for the underlying APIs.
137
+
138
+ ## Development
139
+
140
+ ```bash
141
+ uv sync --locked --all-groups
142
+ make test
143
+ make lint
144
+ uv build
145
+ ```
146
+
147
+ The default `uv run --group test pytest` runs unit tests only, without creating
148
+ remote resources. Real-service tests are selected explicitly and create and
149
+ clean up temporary volumes or sandboxes:
150
+
151
+ ```bash
152
+ uv run --group test --env-file .env pytest tests/integration_tests/
153
+ ```
154
+
155
+ ## License
156
+
157
+ Apache 2.0
@@ -0,0 +1,6 @@
1
+ """Tensorlake sandbox and Cloud Volume filesystem backends for Deep Agents."""
2
+
3
+ from langchain_deepagents_tensorlake.backends import TensorlakeFilesystemBackend
4
+ from langchain_deepagents_tensorlake.sandbox import TensorlakeSandbox
5
+
6
+ __all__ = ["TensorlakeFilesystemBackend", "TensorlakeSandbox"]