langchain-ai/langgraph-cua-py
LangGraph Python SDK for agents that operate remote browsers and desktops
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
create_cua embeds the graph in Python and accepts configuration at construction or invocation.web, ubuntu, and windows environments; web is the default.astream(..., stream_mode="updates") yields graph updates; the VM creation update can expose a separate viewer URL.auth_state_id restores Scrapybara authentication in web mode, with the applied ID recorded as authenticated_id.zdr_enabled=True resends full message history instead of referencing previous_response_id.recursion_limit defaults to 100; timeout_hours separately controls the VM lifetime.Python teams embedding supervised browser research or exploratory GUI tasks into an application, with OpenAI inference and Scrapybara-managed sessions.
You require offline or fully self-hosted execution, or the workflow is stable enough that deterministic scripts would be simpler to verify and maintain.
Quick Start & Installation
pip install langgraph-cuaComparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| langgraph-cua-py ★ | 219 | — | Python | MIT | LangGraph Python SDK for agents that operate remote browsers and desktops |
| browser-use | 122.7k | +477 | Python | MIT | Python REPL and CDP for adaptive browser automation |
| jev-ultrafast | 24.8k | +73 | Python | MIT | A DOM-indexed browser agent that batches operation and target decisions. |
| langgraph | 45.8k | +293 | Python | MIT | Python graph orchestration for stateful, resumable agents and workflows |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/langchain-ai/langgraph-cua-py.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about langgraph-cua-py
How do I embed the agent and observe a run?
create_cua from langgraph_cua, pass the task in messages, and consume graph.astream(..., stream_mode="updates"). The create_vm_instance update can provide a stream_url for viewing the VM session. Set graph options at construction or invocation.Do I need a GPU, and what should I size for?
Can we use it commercially and self-host it for compliance?
zdr_enabled changes request construction; it does not independently enable account-level ZDR or govern Scrapybara retention.When should I use this instead of scripted browser automation?
langgraph-cua when tasks are expressed in natural language and must navigate interfaces whose steps are not known in advance. Prefer deterministic browser automation when the target pages and actions are known and you need reproducible assertions or precise failure diagnosis. The two can coexist: keep stable workflows scripted and reserve the agent for exploratory tasks.Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy