Metadata-Version: 2.4
Name: langchain-superserve
Version: 0.0.1
Summary: Superserve sandbox integration for Deep Agents
Project-URL: Homepage, https://github.com/superserve-ai/langchain-superserve
Project-URL: Repository, https://github.com/superserve-ai/langchain-superserve
Project-URL: Documentation, https://github.com/superserve-ai/langchain-superserve#readme
Project-URL: Issues, https://github.com/superserve-ai/langchain-superserve/issues
License: MIT
License-File: LICENSE
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: <4.0,>=3.11
Requires-Dist: deepagents<0.7.0,>=0.6.0
Requires-Dist: superserve>=0.7.6
Description-Content-Type: text/markdown

# langchain-superserve

[![PyPI - Version](https://img.shields.io/pypi/v/langchain-superserve?label=%20)](https://pypi.org/project/langchain-superserve/#history)
[![PyPI - License](https://img.shields.io/pypi/l/langchain-superserve)](https://opensource.org/licenses/MIT)

Superserve sandbox integration for Deep Agents. Because Deep Agents compiles to
a LangGraph graph, this works across LangChain, LangGraph, and DeepAgents.

## Quick Install

```bash
pip install langchain-superserve
```

## Deep Agents SDK

```python
from superserve import Sandbox
from langchain_superserve import SuperserveSandbox

# Launch from a python-equipped template so the agent's file tools work (see below).
sandbox = Sandbox.create(name="my-agent", from_template="superserve/python-3.11")
backend = SuperserveSandbox(sandbox=sandbox)

try:
    result = backend.execute("echo hello")
    print(result.output)
finally:
    sandbox.kill()
```

Pass the connected `SuperserveSandbox` as the `backend` to
`create_deep_agent(...)` to run the agent's shell and file operations inside a
Superserve microVM.

## Deep Agents Code

Installing this package registers a `superserve` sandbox provider for the
`deepagents-code` (`dcode`) terminal agent:

```bash
dcode --install langchain-superserve --package
export SUPERSERVE_API_KEY=ss_live_...
dcode --sandbox superserve
```

The provider defaults to the `superserve/python-3.11` template; override with
`SUPERSERVE_TEMPLATE`.

## Requirements

`SuperserveSandbox` adapts a Superserve sandbox to the Deep Agents sandbox
protocol. The protocol synthesizes `ls`/`read`/`edit`/`glob` (and the `write`
preflight) with in-sandbox `python3`, so **launch from a python-equipped
image** — `superserve/python-3.11`, `superserve/python-ml`, or
`superserve/code-interpreter`. `execute`, `grep`, and file upload/download work
on any image, including the minimal `superserve/base`.

## Superserve extras

Beyond the standard backend, Superserve sandboxes offer `pause()`/`resume()` for
idle cost savings and proxy-brokered secret binding
(`Sandbox.create(secrets=...)`) so real credentials never enter the sandbox.
Manage these through the Superserve SDK on the sandbox you pass in.

## Development

```bash
uv sync --group test
make test                                       # unit tests (no network)
make lint                                        # ruff + ty
SUPERSERVE_API_KEY=ss_live_... make integration_tests   # standard suite, live
```

Integration tests create a real sandbox from `superserve/python-3.11` (override
with `SUPERSERVE_TEMPLATE`) and skip cleanly when `SUPERSERVE_API_KEY` is unset.
