alibaba /
page-agent
JavaScript library that lets people control a web page with plain-language commands
- 29.6k stars
- 242 stars since 3 Oct
- TypeScript
- Updated yesterday
- Some experience
- Browser & computer use
Page Agent is an in-page GUI agent. You add one script, or install an npm package, and the web page gets an agent that can read its own interface and act on it. A user or developer types an instruction in natural language, and the agent carries it out on the page.
It works on text, not screenshots. The agent reads a text version of the page's DOM and sends it to a language model you configure, so it needs no vision model or special browser permissions. You supply the model name, base URL and API key. The README says most mainstream models work, including ones you run locally.
Many browser agents run from outside the page with Python and a headless browser. Page Agent runs inside the page and is aimed at client-side features, such as a copilot in your own product. The README says its DOM processing and prompt are derived from browser-use. An optional Chrome extension handles tasks across several tabs, and a beta MCP server lets outside agent clients drive the browser.
What it does
One-script integration
Add a script tag or install the npm package. Everything runs as JavaScript in your page, with no backend, extension or headless browser.
Text-based page reading
The agent works from the DOM as text rather than screenshots, so it needs no multimodal model or extra permissions.
Bring your own model
You set the model, base URL and API key. Most mainstream LLMs work, including locally deployed ones.
Chrome extension for multi-page tasks
An optional extension lets the agent work across browser tabs instead of only the current page.
MCP server (beta)
Lets outside agent clients control the browser through the Model Context Protocol.
What you could build
- Add an AI copilot to your SaaS product without rewriting the backend.
- Turn long multi-click workflows in ERP, CRM or admin systems into one typed sentence.
- Make a web app easier to use through natural-language or voice commands.
- Run tasks that span several browser tabs using the Chrome extension.
- Let an MCP-capable agent client control your browser.
Get started
To try it fast, add the demo script tag from the README, which uses a free testing LLM meant for evaluation only. For real use, install the npm package, create a PageAgent with your model, base URL and API key, then call execute with an instruction.
npm install page-agentCommands are copied from the project's README. Read it on GitHub for the full setup.