A web browser agent built with LangGraph
Project description
LangGraph Browser Agent
This project is a web browser agent built with LangGraph. It can navigate websites, fill out forms, and interact with web elements.
This library is built on top of LangGraph, a powerful framework for building agent applications, and leverages deepagents and langchain-mcp-adapters. It also supports two browser manipulation backends: playwright-mcp and BrowserMCP.
Demo
Getting Started
-
Prerequisites:
This agent requires Node.js to be installed and the
npxcommand to be available in your path.If you are using the
browsermcpbackend (the default), please read the documentation at https://docs.browsermcp.io/setup-extension to set up the browser extension. -
Clone the repository:
git clone https://github.com/your-username/langgraph-browser-agent.git cd langgraph-browser-agent
-
Install dependencies:
uv pip install -e .
-
Set up your environment:
This agent uses Ollama by default. Make sure you have Ollama installed and running. You can pull the default model with:
ollama pull gpt-oss:20b
You can also use other models by specifying them when creating the agent.
Usage
To use the browser agent in your own project, you can import the create_browser_agent function and use it in an async context:
import asyncio
from langgraph_browser_agent import create_browser_agent
OBJECTIVE = "Go to google.com and search for 'what is langgraph?'"
async def main() -> None:
"""Run the github example."""
async with create_browser_agent(model="openai:gpt-5") as agent:
final_result = await agent.ainvoke({"messages": [("human", OBJECTIVE)]})
final_result["messages"][-1].pretty_print()
if __name__ == "__main__":
asyncio.run(main())
You can also specify a different model when creating the agent:
async with create_browser_agent(model="ollama:qwen3:8b") as agent:
# ...
Contributing
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langgraph_browser_agent-0.1.0.tar.gz.
File metadata
- Download URL: langgraph_browser_agent-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e790fcd4e9451486aa45ac1ee6cd1d539d3d404a6e93383dca9ea5d56501a12
|
|
| MD5 |
ded89e6306bf96af90f0bf80de924922
|
|
| BLAKE2b-256 |
0769d445adfb72a204587c58dfab34fc19ccc5e47e4ed0e0bea66196f7fccc91
|
File details
Details for the file langgraph_browser_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langgraph_browser_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bffd414a9fe82350407d2234832ca98f1ce2521cb29864388ed303dd47f6904
|
|
| MD5 |
7bbb71b8f03f2fc427b5a2161480bf61
|
|
| BLAKE2b-256 |
70229b416c985db51c1406c18da5ebf4f723669f787153531987abb9fc9c0cb8
|