Sandbox
@alibaba/page-agent

In-page web agent SDK for browser interfaces

Page Agent adds an agent to a webpage so it can read and act on the page without screenshots or a headless browser. It works through in-page JavaScript, with optional Chrome extension support for multi-page tasks and an MCP server for outside control.

29,038 starsβ€’2.6k forksβ€’TypeScriptβ€’Updated 6d ago
Who it's for

Builders who want to add natural-language control to web interfaces, admin tools, or browser-based workflows.

What it delivers

You can turn click-heavy web flows into agent-driven actions inside the page.

What it does

In-page integration

Runs as JavaScript inside the page, so you do not need a separate browser automation stack.

Text-based DOM control

Uses the page DOM instead of screenshots for agent actions.

Bring your own model

Works with mainstream hosted and local LLMs through configurable model settings.

Chrome extension support

Adds multi-page task handling across browser tabs.

MCP server

Lets external agent clients control the browser through Page Agent.

How to get it

  1. 1Run
    npm install page-agent

README

Page Agent

Page Agent BannerPage Agent Banner

CI npm downloads Minzipped bundle size (excluding Zod) license typescript Chrome Web Store Rating GitHub stars

The GUI Agent Living in Your Webpage. One script gives any web page its own AI agent.

alibaba%2Fpage-agent | Trendshift

🌐 English | δΈ­ζ–‡

πŸš€ Demo | πŸ“– Docs | πŸ“’ HN Discussion | 𝕏 Follow on X

Watch the demo


✨ Features

  • 🎯 Easy integration
    • No need for browser extension / python / headless browser.
    • Just in-page javascript. Everything happens in your web page.
  • πŸ“– Text-based DOM manipulation
    • No screenshots. No multi-modal LLMs or special permissions needed.
  • 🧠 Bring your own LLMs
    • Works with most mainstream models, including locally deployed ones. See supported models.
  • πŸ™ Optional chrome extension for multi-page tasks.

πŸ’‘ Use Cases

  • SaaS AI Copilot β€” Ship an AI copilot in your product in lines of code. No backend rewrite.
  • Smart Form Filling β€” Turn 20-click workflows into one sentence. Perfect for ERP, CRM, and admin systems.
  • Accessibility β€” Make any web app accessible through natural language. Voice commands, screen readers, zero barrier.
  • Multi-page Agent β€” Extend your own web agent's reach across browser tabs via the Chrome extension.
  • MCP - Allow your agent clients to control your browser.

πŸš€ Quick Start

One-line integration

Fastest way to try PageAgent with our free Demo LLM:

<script
    src="https://cdn.jsdelivr.net/npm/page-agent@1.12.4/dist/iife/page-agent.demo.js"
    crossorigin="anonymous"
></script>

<!-- China CDN mirror if you can't access jsDelivr -->
<!-- https://registry.npmmirror.com/page-agent/1.12.4/files/dist/iife/page-agent.demo.js -->

⚠️ For technical evaluation only. This demo CDN uses our free testing LLM API. By using it, you agree to its terms.

Add ?autoInit=false to load the script without creating the demo agent automatically. You can then instantiate it with new window.PageAgent(...) and your own LLMs.

NPM Installation

npm install page-agent
import { PageAgent } from 'page-agent'

const agent = new PageAgent({
    model: 'qwen3.5-plus',
    baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
    apiKey: 'YOUR_API_KEY',
    language: 'en-US',
})

await agent.execute('Click the login button')

For more programmatic usage, see πŸ“– Documentations.

🀝 Contributing

We welcome contributions from the community! See CONTRIBUTING.md for guidelines and docs/developer-guide.md for local development workflows.

Built something cool with PageAgent? Share it in Show and Tell. πŸ™Œ

Please read the maintainer's note on principles and current state.

Contributions generated entirely by bots or AI without substantial human involvement will not be accepted.

βš–οΈ License

MIT License

πŸ‘ Acknowledgments

This project builds upon the excellent work of browser-use.

PageAgent is designed for client-side web enhancement, not server-side automation.

DOM processing components and prompt are derived from browser-use:

Browser Use <https://github.com/browser-use/browser-use>
Copyright (c) 2024 Gregor Zunic
Licensed under the MIT License

We gratefully acknowledge the browser-use project and its contributors for their
excellent work on web automation and DOM interaction patterns that helped make
this project possible.

⭐ Star this repo if you find PageAgent helpful!

Files in the repo

Repository payloadβ€’19 top-level entries
  • .agents
  • .github
  • .husky
  • .vscode
  • docs
  • packages
  • scripts
  • .gitignore
  • .prettierignore
  • AGENTS.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • eslint.config.js
  • LICENSE
  • package-lock.json
  • package.json
  • README.md
  • tsconfig.base.json
  • tsconfig.typecheck.json

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More frameworks & sdks

HKUDS/nanobotFrameworks & SDKs

Ultra-lightweight, open-source, self-hosted personal AI agent framework in Python with WebUI, tools, memory, MCP, multi-agent workflows, automation, and chat apps

48k
microsoft/
SkillOpt
microsoft/SkillOptFrameworks & SDKs

SkillOpt is a text-space optimizer that trains reusable natural-language skills for frozen LLM agents through trajectory-driven edits, validation-gated updates, and deployable best_skill.md artifacts.

17k
omnigent-ai/omnigentFrameworks & SDKs

Omnigent is an open-source AI agent framework and meta-harness: orchestrate Claude Code, Codex, Cursor, Pi, and custom agents β€” swap harnesses without rewriting, enforce policies and sandboxing, and collaborate in real time from any device.

9.8k
kyegomez/
OpenMythos
kyegomez/OpenMythosFrameworks & SDKs

A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature.

15k
D4Vinci/ScraplingFrameworks & SDKs

πŸ•·οΈ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

80k