Langgraph Cua Py banner
langchain-ai langchain-ai

Langgraph Cua Py

Development community

Description

An implementation of a computer use agent (CUA) using LangGraph

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

🤖 LangGraph Computer Use Agent (CUA)

[!TIP] Looking for the TypeScript version? [Check out the repo here](https://github.com/langchain-ai/langgraphjs/tree/main/libs/langgraph-cua).

A Python library for creating computer use agent (CUA) systems using [LangGraph](https://github.com/langchain-ai/langgraph). A CUA is a type of agent which has the ability to interact with a computer to preform tasks.

Short demo video:

[!TIP] This demo used the following prompt:

I want to contribute to the LangGraph.js project. Please find the GitHub repository, and inspect the read me,
along with some of the issues and open pull requests. Then, report back with a plan of action to contribute.

This library is built on top of [LangGraph](https://github.com/langchain-ai/langgraph), a powerful framework for building agent applications, and comes with out-of-box support for [streaming](https://langchain-ai.github.io/langgraph/how-tos/#streaming), [short-term and long-term memory](https://langchain-ai.github.io/langgraph/concepts/memory/) and [human-in-the-loop](https://langchain-ai.github.io/langgraph/concepts/human_in_the_loop/).

Installation

pip install langgraph-cua

Quickstart

This project by default uses [Scrapybara](https://scrapybara.com/) for accessing a virtual machine to run the agent. To use LangGraph CUA, you'll need both OpenAI and Scrapybara API keys.

export OPENAI_API_KEY=
export SCRAPYBARA_API_KEY=

Then, create the graph by importing the `create_cua` function from the `langgraph_cua` module.

from langgraph_cua import create_cua
from dotenv import load_dotenv

# Load environment variables from .env file
load_dotenv()


cua_graph = create_cua()

# Define the input messages
messages = [
    {
        "role": "system",
        "content": (
            "You're an advan