Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust
Rust ai-agentsai-toolsbrowserbrowser-automationcloud-browserheadlessheadless-browserkitesurfplaywrightpuppeteerrustservoweb-crawlerweb-crawlingweb-scraperweb-scraping
Better README
Donough Liu796401abd8ee
diff --git a/README.md b/README.mdindex 457060898..fef8f0d50 100644--- a/README.md+++ b/README.md@@ -1,50 +1,25 @@<p align="center"><img- src="assets/moli-browser-banner.png"- alt="Moli Browser — Fast, Lightweight, Headless"+ src="assets/moli-browser-banner.jpg"+ alt="Moli Browser — Structure first. Pixels on demand. Open source browser for AI agents."width="1086"/></p><h1 align="center">Moli</h1>-<p align="center">- <strong>A browser engine built for AI agents.</strong>-</p>--<p align="center">- Real JavaScript, DOM, and browser APIs · One-shot, non-retained layout and CPU rendering ·- CLI, CDP, WebDriver Classic, and WebDriver BiDi-</p>+Moli is a production-ready, structured-first browser engine for AI agents.-Moli is a headless browser built from the ground up in Rust for AI agent.-It runs real page JavaScript on V8, maintains a native DOM and CSS-state, and handles storage and networking — exposing the page through-structured data first, and pixels only when you ask for them.+It runs real JavaScript, DOM, and browser APIs by default, and computes layout+or pixels only when requested.-**DOM and structured page data are on by default; pixels are opt-in.**-Reading a document, extracting Markdown, walking an accessibility tree, or-running JavaScript doesn't require keeping a GUI browser's layout, paint, and-compositor machinery alive. When geometry or pixels do matter, Moli runs a-fresh layout pass and renders a frame on demand.+Use it through CLI, MCP, CDP, WebDriver Classic, or WebDriver BiDi.## Why Moli-Conventional browsers assume any loaded page might need to be displayed,-animated, or scrolled at any moment, so they keep visual machinery warm at all-times — even when an automation task just wants a title, a list of links, or-a JavaScript result.--Agents typically work in three stages:--1. **Understand the page** — DOM, text, links, forms, network responses,- storage, JavaScript state.-2. **Act on the page** — fill, select, submit, navigate, or execute code via- DOM-backed controls.-3. **Look at the page, when needed** — geometry for spatial reasoning, pixels- for a screenshot.--Moli only does the visual work a given request actually needs:+Most browser automation needs page structure, not a continuously rendered+visual world. Moli keeps the native DOM and style state as its source of truth,+then runs layout or software paint only for operations that need them.| Agent request | What Moli does || --- | --- |@@ -52,21 +27,6 @@ Moli only does the visual work a given request actually needs:| Read an element's box, hit-test a point, send coordinate input | Runs one layout pass, keeps only the latest geometry snapshot || Capture a screenshot or refresh a screencast | Rebuilds from current DOM/style, renders one fresh frame, discards it |-This isn't a browser with rendering stripped out — Moli still has a real DOM,-V8, CSS, layout, text shaping, hit-testing, and software paint. What changes-is *when* those systems run and how long their state sticks around: DOM state-is the default; layout and pixels are paid for only on request.--That cost model matters for high-density crawling, browser-use agents,-retrieval pipelines, eval environments, and RL workloads — where startup time,-idle memory, and per-page footprint decide how many sessions a machine can run.--## On-demand, non-retained rendering--Moli never keeps a visual world alive "just in case." Native DOM and Stylo-state are the single source of truth; layout and pixels are built only when-an operation actually needs them.-<p align="center"><a href="assets/moli_ondemand_rendering_flow.svg"><img@@ -77,20 +37,10 @@ an operation actually needs them.</a></p>-By default, Moli uses `LayoutPolicy::Mock` and never touches the real layout-or paint pipeline. `--layout` switches to `LayoutPolicy::OnDemand`, unlocking-real geometry, hit-testing, coordinate input, screenshots, and screencast —-but it still isn't a continuously rendering browser.--A cold geometry request rebuilds layout once and keeps only the latest-snapshot. Later geometry reads may reuse that snapshot; screenshots and-screencast frames always rebuild fresh from the current DOM and style. Even-screencast is a low-frequency repeat of the same one-shot pipeline, not a-retained 60 FPS compositor.--The payoff: extraction, DOM inspection, JS execution, and most agent actions-skip both the CPU cost of rendering unused frames and the memory cost of-retained layout/paint/compositor state.+Moli still includes V8, CSS, layout, text shaping, hit-testing, and software+paint. The difference is when visual work runs and how long its state is kept.+This cost model targets crawling, browser-use agents, retrieval pipelines,+evaluation environments, and reinforcement-learning workloads.## What works today@@ -115,9 +65,9 @@ retained layout/paint/compositor state.overrides, structured logging, and network diagnostics.<p align="center">- <a href="assets/moli-devtools-rust-lang.png">+ <a href="assets/moli-devtools-rust-lang.jpg"><img- src="assets/moli-devtools-rust-lang.png"+ src="assets/moli-devtools-rust-lang.jpg"alt="Chrome DevTools connected to Moli while inspecting and rendering rust-lang.org"width="1200"/>@@ -128,6 +78,13 @@ retained layout/paint/compositor state.<sub>Chrome DevTools connected to Moli: rendered page, live DOM, CSS, and geometry from the same browser runtime.</sub></p>+## Moli and Lexmount++Moli is Lexmount’s open-source browser engine. Lexmount Browser is the managed+cloud runtime and control plane built around it.++**The open-source engine is fully usable without Lexmount Browser.**+## Quick startBuild from the workspace root:@@ -248,7 +205,7 @@ count.| Lightpanda | 85 | 44.3% | 0.97 s | 40 MiB || Obscura | 57 | 29.7% | 1.30 s | 39 MiB |-### Sampled internal agent episode+### Sample agent workload| Metric | Moli | Chromium || --- | ---: | ---: |@@ -262,8 +219,8 @@ full run recorded **1.612 million passing tests**.## Project scope-Moli is in active development — a practical agent browser, not a drop-in-replacement for every Chrome feature.+Moli is production-ready for its documented agent-browser scope and remains+under active development.Current intentional boundaries:diff --git a/assets/moli-browser-banner.jpg b/assets/moli-browser-banner.jpgnew file mode 100644index 000000000..675dec169Binary files /dev/null and b/assets/moli-browser-banner.jpg differdiff --git a/assets/moli-browser-banner.png b/assets/moli-browser-banner.pngdeleted file mode 100644index 7ce0130c4..000000000Binary files a/assets/moli-browser-banner.png and /dev/null differdiff --git a/assets/moli-devtools-rust-lang.jpg b/assets/moli-devtools-rust-lang.jpgnew file mode 100644index 000000000..5551e1c28Binary files /dev/null and b/assets/moli-devtools-rust-lang.jpg differdiff --git a/assets/moli-devtools-rust-lang.png b/assets/moli-devtools-rust-lang.pngdeleted file mode 100644index 759881265..000000000Binary files a/assets/moli-devtools-rust-lang.png and /dev/null differdiff --git a/moli/src/cli.rs b/moli/src/cli.rsindex 6ef9696e0..e2519ad20 100644--- a/moli/src/cli.rs+++ b/moli/src/cli.rs@@ -48,7 +48,7 @@ const DUMP_MODES: &[&str] = &[#[command(name = "moli",version,- about = "A Rust headless browser runtime scaffold",+ about = "A structured-first headless browser engine for AI agents",subcommand_required = true,disable_help_subcommand = true)]@@ -502,6 +502,16 @@ fn normalize_dump_flag(args: &mut Vec<OsString>) {mod tests {use super::*;+ #[test]+ fn help_uses_the_public_product_description() {+ let help = Cli::try_parse_from(["moli", "--help"])+ .unwrap_err()+ .to_string();++ assert!(help.contains("A structured-first headless browser engine for AI agents"));+ assert!(!help.contains("scaffold"));+ }+#[test]fn delay_ms_infers_fetch_command() {let args =