# Plasmate

> The browser engine for agents. HTML in, Semantic Object Model out.

Plasmate is a Rust-based headless browser engine purpose-built for AI agents. Instead of dumping raw DOM (thousands of tokens), it produces a compact Semantic Object Model (SOM) - structured JSON with labeled regions, interactive elements, and clean text. 10x average token compression.

## Key facts

- 5x faster than Lightpanda, 50x faster than Chrome
- Apache-2.0 licensed
- 43MB binary, ~30MB memory per page (vs Chrome's 300-500MB binary, ~20GB for 100 pages)
- Puppeteer-compatible via CDP
- Native protocol: AWP (Agent Wire Protocol) - 7 methods over WebSocket

## Install

```
curl -fsSL https://plasmate.app/install.sh | sh
```

Or via package managers:
- cargo install plasmate
- npm install -g plasmate
- pip install plasmate
- docker run ghcr.io/plasmate-labs/plasmate:latest

## Usage

Fetch a page as SOM:
```
plasmate fetch https://example.com
```

Output is JSON with regions array containing structured page content.

Server mode (Puppeteer-compatible):
```
plasmate serve --port 9222
```

Then connect with Puppeteer:
```javascript
const browser = await puppeteer.connect({ browserWSEndpoint: 'ws://127.0.0.1:9222' });
const page = await browser.newPage();
await page.goto('https://example.com');
const html = await page.content();
```

## Links

- Docs: https://docs.plasmate.app
- Source: https://github.com/plasmate-labs/plasmate
- Comparison: https://plasmate.app/compare
- Full reference: https://plasmate.app/llms-full.txt

