# Repository Briefing: langchain-ai/langgraph-cua-py
> Source: https://repoforai.com/repo/langchain-ai/langgraph-cua-py (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/langchain-ai/langgraph-cua-py
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A (82/100 · Maintenance 35/35 · Adoption 16/25 · Releases 11/20 · License 20/20)
- **Latest Release**: langgraph-cua==0.0.1 (2025-03-25) — https://github.com/langchain-ai/langgraph-cua-py/releases
- **Review Snapshot**: 2026-11-30
- **Deployment / Stack Signals**: API
- **Momentum**: 219 ★ total (+0 24h / +0 7d) · 44 forks
- **When to Use**: Best for: Python teams embedding supervised browser research or exploratory GUI tasks into an application, with OpenAI inference and Scrapybara-managed sessions. Skip if: You require offline or fully self-hosted execution, or the workflow is stable enough that deterministic scripts would be simpler to verify and maintain.

## Overview
```text
### Architecture & Core Mechanics
`langgraph-cua` is an embeddable Python SDK that separates orchestration, inference, and computer execution. LangGraph orchestrates the run, OpenAI handles model requests, and Scrapybara supplies the remote execution environment. The public entry point, `langgraph_cua.create_cua`, returns a graph that accepts a `messages` state payload. `astream(..., stream_mode="updates")` yields node updates; the `create_vm_instance` update can carry a separate `stream_url` for watching the remote session.

The supplied manifest constrains `langgraph` to `>=1.0.10,<2.0.0`, `langchain-core` to `>=1.2.22,<2.0.0`, `scrapybara` to `>=2.4.1,<3.0.0`, and `langchain-openai` to `>=1.0.0,<2.0.0`. The exposed integration surface is graph state and configuration: callers can set options at construction or invocation and supply a system prompt. The available interface does not establish a general provider plugin contract.

### Key Capabilities & Differentiators
Execution targets are `web` (the default), `ubuntu`, and `windows`. In `web` mode, `auth_state_id` restores a saved Scrapybara browser session. The graph records the applied ID in `authenticated_id`, reauthenticates when the configured ID changes, and can be made to reapply the same auth state by clearing `authenticated_id`. That makes repeated authenticated workflows possible without treating every run as a fresh login.

`timeout_hours` controls the VM lifetime; `recursion_limit`, which defaults to 100, bounds graph execution steps rather than wall-clock time. With `zdr_enabled=False`, the model receives the latest message plus `previous_response_id`. With it enabled, the graph omits that reference and sends the full message history, including AI and tool messages, on each request. LangGraph provides streaming, memory, and human-in-the-loop primitives; an application still needs to decide what to persist and which actions require approval.

### Trade-offs & Limitations
Compared with deterministic browser automation, the graph is better suited to natural-language tasks that need to adapt as the interface changes. Known workflows with stable selectors and strict assertions are usually easier to reproduce and debug as scripts. Compared with building directly on the model and VM APIs, the SDK packages a configurable execution loop and graph updates, but the default path still depends on two external services.

Capacity planning should account separately for model requests and remote VM sessions. Full-history mode can increase request size as a run grows, and a step cap does not bound elapsed time or spend by itself. For authenticated workflows, scope saved sessions and put approval gates before consequential writes. MIT permits commercial reuse subject to its notice obligations, but it does not alter provider terms or data-retention policies; `zdr_enabled` does not itself enable account-level ZDR.

### Hardware & Deployment Guide
The runtime requires Python 3.10 or later. Install with `pip install langgraph-cua`, provide `OPENAI_API_KEY` and `SCRAPYBARA_API_KEY`, then invoke the graph from a Python process. This is an SDK integration backed by external APIs, not a packaged API server. You can host the Python process yourself, but the default execution path is neither offline nor fully self-hosted. No container manifest or local inference path is shown.

For development, `uv sync --all-groups` installs the dependency groups, `.env.example` provides the environment template, and `pytest -xvs tests/integration/test_cua.py` is the integration test command. The listed `0.0.1` release, dated March 25, 2025, added a prompt state field; `0.0.0` included public export fixes. Pin and test the published artifact separately from a checkout rather than assuming the current manifest and release artifact resolve identical dependencies.
```

## Key Capabilities
```text
- Integration: `create_cua` embeds the graph in Python and accepts configuration at construction or invocation.
- Execution: Scrapybara provides `web`, `ubuntu`, and `windows` environments; `web` is the default.
- Observability: `astream(..., stream_mode="updates")` yields graph updates; the VM creation update can expose a separate viewer URL.
- Session reuse: `auth_state_id` restores Scrapybara authentication in `web` mode, with the applied ID recorded as `authenticated_id`.
- Request history: `zdr_enabled=True` resends full message history instead of referencing `previous_response_id`.
- Run limits: `recursion_limit` defaults to 100; `timeout_hours` separately controls the VM lifetime.
```

## Quick Start / Clone
```bash
pip install langgraph-cua
```
