langchain-deepagents-tensorlake
Tensorlake sandbox provider and Cloud Volume filesystem backends for Deep Agents.
Installation
pip install langchain-deepagents-tensorlake
To use this checkout, including the merged filesystem backend:
uv sync --locked --all-groups
Requires Python 3.11+ and Deep Agents >=0.7. Both backends are included
in this distribution; a separate langchain-tensorlake-backend installation is
not needed. Existing filesystem users should change their import to
from langchain_deepagents_tensorlake import TensorlakeFilesystemBackend.
Sandbox
Use TensorlakeSandbox for shell execution and file tools inside a Tensorlake
sandbox:
from tensorlake.sandbox import Sandbox
from langchain_deepagents_tensorlake import TensorlakeSandbox
from deepagents.backends import CompositeBackend
# Create a Tensorlake sandbox
sandbox = Sandbox.create(api_key="your-api-key")
backend = TensorlakeSandbox(sandbox=sandbox)
# Use directly as a DeepAgents backend
# or wrap with CompositeBackend for routing
With the Deep Agents CLI (deepagents-code), set:
export TENSORLAKE_API_KEY=your-api-key
deepagents-code --sandbox tensorlake
Note: CLI integration requires
deepagents-codeto be configured with a customsandbox_factorythat maps"tensorlake"toTensorlakeSandbox. See the examples directory for a complete setup.
The caller manages sandbox creation and termination. Mounting a Cloud Volume inside a sandbox and coordinating access with a filesystem backend are also application responsibilities.
Cloud Volume filesystem
Use TensorlakeFilesystemBackend for file tools backed by an existing Cloud
Volume, including when no sandbox is running. Set TENSORLAKE_API_KEY in the
trusted application environment, then select the volume:
from deepagents import create_deep_agent
from tensorlake.filesystem import FilesystemClient
from langchain_deepagents_tensorlake import TensorlakeFilesystemBackend
filesystem = FilesystemClient().get("agent-scratch")
backend = TensorlakeFilesystemBackend(filesystem)
agent = create_deep_agent(model="openai:gpt-4.1", backend=backend)
# You can also use the backend directly.
result = backend.read("/report.md")
if result.error:
raise RuntimeError(result.error)
print(result.file_data["content"])
The backend supports ls, read, write, edit, delete, glob, grep, binary
upload/download, and their async counterparts. write creates a new file; use
edit or upload to replace an existing file. It accepts either a Filesystem
instance or a synchronous resolver. The application selects and manages volumes,
shared locks, and retained snapshots.
File operations return native Deep Agents result types, including pagination
metadata and search truncation. Deletion is available directly, through
CompositeBackend, and through the agent's built-in file tools.
It can also be mounted under a virtual prefix:
from deepagents.backends import CompositeBackend, StateBackend
combined = CompositeBackend(default=StateBackend(), routes={"/workspace/": backend})
agent = create_deep_agent(model="openai:gpt-4.1", backend=combined)
Paths and file operations
Use absolute POSIX paths within the supplied volume. Traversal paths are rejected; dotfiles are supported, and symlinks are skipped in listings and searches. Root is only valid for directory operations.
- Text reads support pagination; binary previews are limited to 500 KiB. Use downloads for raw bytes. Reads and searches use a fixed volume version.
writecreates files;editrequires a unique exact match unlessreplace_all=True. Uploads can replace existing files.- Uploads validate the batch before one SDK write; downloads return a result for each path.
Ownership, limits, and errors
The caller manages volumes, credentials, sandbox lifecycle, and retained snapshots. Keep credentials outside agent-visible files.
The backend does not lock file operations. Callers must coordinate conflicting
access: write existence checks and edit read-modify-write are not atomic.
Async methods use worker threads; supplied filesystems and resolvers must
support concurrent calls or be serialized by the caller.
Constructor limits must be positive integers:
| Option | Default | Limit |
|---|---|---|
max_file_bytes |
32 MiB | Bytes read or written by one file operation |
max_search_files |
10,000 | Entries visited during a search |
max_search_bytes |
64 MiB | Content bytes inspected by grep |
These are processing limits, not storage quotas. Files are downloaded in full before read-size checks. Storage errors omit raw provider details; authentication and permission failures remain distinct from missing files.
See the Deep Agents backend documentation, Tensorlake Cloud Volume HTTP API, and Tensorlake authentication for the underlying APIs.
Development
uv sync --locked --all-groups
make test
make lint
uv build
The default uv run --group test pytest runs unit tests only, without creating
remote resources. Real-service tests are selected explicitly and create and
clean up temporary volumes or sandboxes:
uv run --group test --env-file .env pytest tests/integration_tests/
License
Apache 2.0
Metadata
Release files for langchain-deepagents-tensorlake 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_deepagents_tensorlake-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / langchain_deepagents_tensorlake-0.1.1-py3-none-any.whl
| Download URL | langchain_deepagents_tensorlake-0.1.1-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9251555626a5b2447274bcfa2b5d77b5f0a7dc4244045f0a703d43fa46694c32
|
|
BLAKE2b-256 checksum How to use checksums |
746499678b0cbf24c63c20369508e3a932fb403d31ecc90d573b8f144a4636fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for langchain-deepagents-tensorlake 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.