Quick Start
Load the Chrome extension
Open
chrome://extensions, enable Developer mode, and load unpacked from praisonai-chrome-extension/dist.Architecture
Flow: Chrome Extension β WebSocket β Bridge Server β PraisonAI Agent The system consists of:- Chrome Extension: Captures page state and executes actions via CDP
- Bridge Server: FastAPI WebSocket server that routes messages to agents
- BrowserAgent: PraisonAI agent that decides actions based on observations
- SessionManager: SQLite-based persistence for session history
- Hybrid Mode: Falls back to on-device Gemini Nano if server unavailable
Session Flow
Session States
Smart Features
Click Fallbacks
When clicks fail, the agent automatically tries:- Viewport click using
getBoundingClientRect()+scrollIntoView() - JavaScript click via
element.click() - Focus + Enter for buttons
Goal Context & Self-Correction
Every observation sent to the LLM includes:- Original goal: Always visible to prevent drift
- Action history: Last 5 actions with success/failure status
- Progress notes: Summary of steps completed
Failure Communication
When actions fail, the LLM receives explicit feedback:CLI Commands
Run Browser Agent
Execute a goal directly from CLI with live progress display:--url, -u: Start URL (default: https://www.google.com)--model, -m: LLM model (default: gpt-4o-mini)--timeout, -t: Timeout in seconds (default: 120)--debug, -d: Debug mode - show all events
Launch Browser with Goal
Launch Chrome with the extension and optionally run a goal:--url, -u: Start URL (default: https://www.google.com)--model, -m: LLM model (default: gpt-4o-mini)--max-steps: Maximum steps (default: 20)--engine: Automation engine: extension, cdp, auto (default: auto)--debug, -d: Debug mode with detailed logging--record-video: Record video of browser session--profile: Enable performance profiling--deep-profile: Enable deep profiling with cProfile
Performance Profiling
Track execution time per step to identify bottlenecks:Tab Management
Navigate
Execute JavaScript
Page Inspection (New)
Inspect browser pages without the extension:These commands work via CDP (Chrome DevTools Protocol) and require Chrome
running with
--remote-debugging-port=9222.Automation Engines
Choose different execution engines with--engine:
| Engine | Extension | Headless | Multi-Browser |
|---|---|---|---|
| extension | Required | No | No |
| cdp | No | Yes | Chrome only |
| playwright | No | Yes | Chrome/Firefox/WebKit |
Screenshot
Start Server
--port, -p: Port to listen on (default: 8765)--host, -H: Host to bind to (default: 0.0.0.0)--model, -m: LLM model (default: gpt-4o-mini)--max-steps: Maximum steps per session (default: 20)--verbose, -v: Enable verbose logging
List Sessions
--status, -s: Filter by status (running, completed, failed)--limit, -l: Maximum sessions to show
View History
Clear Sessions
Reload Extension
Reload the Chrome extension after making changes:Health Diagnostics
Run health checks for the browser automation system:Python API
Session Management
Hybrid Mode (Extension)
The Chrome Extension supports hybrid mode:- Bridge Mode: Connect to PraisonAI server for cloud LLMs
- Built-in Mode: Use Chromeβs Gemini Nano on-device
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl+Shift+P | Toggle side panel |
Alt+A | Start agent |
Alt+S | Capture screenshot |
Supported Actions
| Action | Description |
|---|---|
click | Click on element |
type | Enter text |
submit | Press Enter to submit forms |
scroll | Scroll page |
navigate | Go to URL |
clear_input | Clear input field (fixes garbled/duplicated text) |
wait | Wait for page |
screenshot | Capture screen |
done | Task complete |
Error Detection & Recovery (v1.3+)
The agent automatically detects and recovers from errors:Detected Errors
- Garbled/duplicated text in input fields
- Wrong page navigation (user or browser interference)
- Failed actions (click not working, submit didnβt fire)
- Blocking elements (popups, consent dialogs, login walls)
Recovery Actions
When errors are detected, the agent will:- Set
error_detected: truewith description - Report
input_field_valueshowing actual text visible - Use
clear_inputto fix garbled input - Use
navigateto return to correct URL if off-track
Step Timestamps
Debug mode now shows elapsed time for each step:Performance Optimized
Action delays have been optimized for faster execution:- Click: 200ms (was 500ms)
- Submit: 300ms (was 500ms)
- Search: 400ms (was 1000ms)
WebSocket Protocol
Connect tows://localhost:8765/ws and send/receive JSON messages:
Environment Variables
| Variable | Description |
|---|---|
OPENAI_API_KEY | OpenAI API key for GPT models |
ANTHROPIC_API_KEY | Anthropic API key for Claude |
GOOGLE_API_KEY | Google API key for Gemini |
Best Practices
Run doctor before first session
Run doctor before first session
praisonai browser doctor checks server, Chrome debugging, extension, and session DB in one pass.Prefer CDP for headless CI
Prefer CDP for headless CI
Use
--engine cdp or playwright when the Chrome extension is not available in your pipeline.Set step limits for open-ended goals
Set step limits for open-ended goals
Pass
--max-steps so runaway loops stop instead of burning tokens.Enable hybrid fallback in the extension
Enable hybrid fallback in the extension
Built-in Gemini Nano keeps the side panel working when the bridge server is offline.
Related
Web Tools
Built-in web search and fetch tools for agents without browser control.
CLI
Full
praisonai browser command reference and flags.Code Execution
Run scripts alongside browser automation in agent workflows.
Observability Hooks
Trace browser agent steps and LLM calls in production.

