# langchain-monza

Monza sandbox integration for [Deep Agents](https://github.com/langchain-ai/deepagents).

This package provides a `MonzaSandbox` backend that talks to the Monza Go service over HTTP for file operations and command execution inside isolated devcontainer sandboxes.

## Installation

```bash
pip install langchain-monza
```

Or with [uv](https://docs.astral.sh/uv/):

```bash
uv add langchain-monza
```

## Usage

```python
from langchain_monza import MonzaSandbox

# Create a new sandbox (default: python-3.12 template, Monza at http://localhost:8080)
with MonzaSandbox(template="python-3.12") as sandbox:
    result = sandbox.execute("python --version")
    print(result.stdout)

# Or attach to an existing sandbox
sandbox = MonzaSandbox(sandbox_id="existing-id")
sandbox.execute("ls -la")
sandbox.close()
```

### Configuration

- **`base_url`** – Monza backend URL (default: `http://localhost:8080`)
- **`sandbox_id`** – Optional; if set, attaches to an existing sandbox
- **`template`** – Devcontainer template when creating a sandbox (default: `python-3.12`)
- **`name`** – Optional human-readable name for a new sandbox
- **`timeout`** – Default command timeout in seconds (default: 30 minutes)

## Links

- [Repository](https://github.com/Glyph-Software/langchain-monza)
- [Documentation](https://github.com/Glyph-Software/langchain-monza)

## License

MIT
