# Repository Briefing: SandeepAi369/Agent-first-browse
> Source: https://repoforai.com/repo/SandeepAi369/Agent-first-browse (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/SandeepAi369/Agent-first-browse
- **Official Docs / Website**: https://xel-studio.vercel.app
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A+ (88/100 · Maintenance 35/35 · Adoption 13/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.1.1 (2026-11-25) — https://github.com/SandeepAi369/Agent-first-browse/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: MCP, CLI, Self-Hosted
- **Momentum**: 36 ★ total (+0 24h / +0 7d) · 6 forks
- **Topics**: `accessibility-tree`, `agentic-ai`, `ai-agents`, `autonomous-agents`, `browser-agent`, `browser-automation`, `browser-use`, `chrome-devtools-protocol`, `chromium`, `computer-use`, `langgraph`, `llm-agents`
- **When to Use**: Best for: Teams giving an MCP-capable agent local Chromium control for authorized, variable-layout workflows, or comparing browser perception strategies with paired telemetry. Skip if: Your workflow is fixed enough for a direct Playwright script, you need pixel-first desktop control beyond Chromium, or you require a managed browser fleet instead of operating local sessions.

## Overview
```text
### Architecture & Core Mechanics
Agent First Browse separates task decisions from browser control. An external agent can drive a local Playwright Chromium session through stdio MCP or the stateful `agent-eval` CLI, while `agent-first-browse run` puts decision-making inside a LangGraph StateGraph. The Python stack includes Pydantic, LangChain, and LangGraph's SQLite checkpoint package. The MCP tool boundary exposes session management, perception, actions, screenshots, and diagnostics without requiring the host to write Playwright code.

Both entry paths use the same perception and execution pipeline. A MutationObserver waits for a DOM quiet window before scanning; if the scan finds fewer than two elements, the engine falls back to a CDP/Playwright accessibility tree. Paint-order hit testing filters occluded controls, and same-URL snapshots can emit changes alongside a compact reference roster. The action layer verifies targets and can semantically rebind stale references before sending CDP input. Shared code under `src/core/` provides URL policy, redaction, typed errors, retry handling, and telemetry.

### Key Capabilities & Differentiators
Seven MCP tools cover browser lifecycle, compact page perception, actions, screenshots, legacy/V2 comparison, and metrics export. Actions include navigation, clicks, typing, selection, scrolling, and key presses. The server offers V2, legacy, and paired sessions; screenshots can capture the viewport or full page to a local PNG. The autonomous path lists LangChain integrations for OpenAI and Google GenAI, but the dependencies alone do not establish a model-by-model compatibility matrix.

In the reported headed Chromium comparisons, average perception time fell from 1,164.4 ms to 96.8 ms and estimated prompt tokens per step fell from 754.2 to 341.1. In the blocking-modal scenario, hit testing reduced the snapshot from 46 elements to two. The sparse ARIA fixture went from no detected elements to four through accessibility fallback, and a separate SPA fixture exercised stale-reference recovery. These measurements describe perception and selected recovery cases, not end-to-end task latency or success rates.

### Trade-offs & Limitations
Direct Playwright is the simpler choice for stable workflows with known selectors and explicit assertions. Agent First Browse is more useful when a model must choose actions across changing pages: compact observations and reference recovery reduce the browser state the caller needs to manage. The added perception layer also means the model sees a filtered view, not the entire page. If a relevant visual state is missing, a screenshot can help diagnose it, but the screenshot tool saves an artifact rather than supplying a visual understanding backend.

The reported comparisons use the project's legacy mode, whose fixed waits contribute to the latency gap. Validate full-task reliability, model-call overhead, and browser resource use on your own flows before adopting it. Local operation gives you control over browser placement, but URL restrictions and sensitive-field masking are not substitutes for process isolation, network policy, or approval of consequential browser actions. Treat page text and screenshot files as potentially sensitive.

### Hardware & Deployment Guide
The self-hosted runtime requires Python 3.11+ on Linux, WSL, or macOS. Install with `pip install agent-first-browse` and provision Chromium with `python -m playwright install chromium`. MCP hosts can launch the stdio server with `uvx --from agent-first-browse agent-browse-mcp`, and the stateful CLI uses a Unix socket with `0600` permissions. Headless execution avoids a display; Xvfb is an option for headed execution on Linux or WSL without a physical display.

MCP and direct CLI control need no separate model API key for the browser layer; standalone LangGraph runs require provider configuration through the environment. The local benchmark suite can exercise the browser engine without model credentials. For capacity planning, measure CPU and memory with representative pages and concurrency, especially when running paired sessions. The listed v0.1.1 release highlights PyPI installation and native MCP/CLI control, with older MCP and tool names retained as aliases.
```

## Key Capabilities
```text
- Integration: Local stdio MCP and a stateful CLI let the calling agent drive Chromium without a separate model API key for the browser layer.
- Perception: MutationObserver waits for a DOM quiet window; CDP/Playwright accessibility-tree fallback activates when the first scan finds fewer than two elements.
- Snapshot size: Paint-order hit testing omits controls obscured by overlays, and same-URL delta snapshots carry changes plus a compact reference roster.
- Action reliability: Live reference validation and semantic rebinding address stale targets after SPA rerenders before CDP-backed input.
- Diagnostics: `browser_compare` compares paired legacy and V2 sessions; `browser_metrics` exports Markdown or JSON telemetry.
- Compatibility: `agent-browse-mcp` and `browser_*` coexist with the `agent-eval-mcp` entry point and `eval_*` tool aliases.
```

## Quick Start / Clone
```bash
pip install agent-first-browse && python -m playwright install chromium
```
