Agentic Browser

AI agent for web automation and scraping, designed to plan, execute, and verify actions across any website

Project overview

Introduction#

Agentic Browser is a browser extension that turns natural-language commands into actions on live pages. An LLM plans the work. The extension runs it only after you approve. Providers are swappable, keys stay local, and the code is open for extension.

Project structure#

The repo splits into a few layers:

  • Core runtime and configuration (core/)
  • Agent orchestration and tooling (agents/, tools/)
  • MCP server for model-agnostic communication (mcp_server/)
  • FastAPI app in main.py with routers/, services/, skills/
  • Memory stores (sqlmodel/asyncpg, Neo4j, OpenSearch)
  • Browser clients under clients/ (browser-extension, debug-web, shared)
  • Prompts and utilities for grounded reasoning

Core components#

  • Model-agnostic LLM integration: A unified adapter supporting multiple providers and local models.
  • MCP-compliant server: Exposes tools and LLM generation via the Model Context Protocol.
  • Agent orchestration: LangGraph-based ReAct agent with tools for web, calendar, email, and browser actions.
  • Browser extension: Secure background and content scripts with declarative action execution.
  • Prompt engineering: Specialized prompts for generating safe, structured action plans for browser automation.

Architecture overview#

Main pieces:

  • Frontend: Extension UI and messaging channels
  • Backend: FastAPI server and MCP server
  • Agent runtime: LangGraph workflows and tooling
  • LLM adapters: Provider-agnostic clients
  • Safety: Guardrails and declarative action system

Detailed component analysis#

Mission and objectives#

  • Model-agnostic intelligence: Smooth switching across providers and local models.
  • Secure browser extension: WebExtensions-based design with explicit user approvals.
  • Advanced agent workflows: RAG, persistent memory, and multi-step automation.
  • Guardrails and transparency: User consent, logging, filtering, and allowlists.
  • Open-source extensibility: Modular architecture for community contributions.

Key architectural principles#

  • Model-agnostic design: Unified LLM adapter supports OpenAI, Anthropic, Ollama, and others.
  • BYOKeys approach: Users supply their own API keys via environment or UI.
  • MCP compliance: Structured tool definitions and standardized LLM invocation.
  • Declarative action system: Natural language goals mapped to JSON action plans.

Technical stack overview#

  • Agent orchestration: LangChain, LangGraph for stateful workflows.
  • Browser control: WebExtensions API for tab/window control and DOM injection.
  • LLM adapters: OpenRouter, Ollama, Anthropic, OpenAI, Hugging Face integrations.
  • Backend agent: Python MCP server exposing tools and LLM generation.
  • Retrieval and citation: Vector databases and RAG pipelines.
  • Safety and guardrails: Logging, filtering, and explicit user consent.

Core objectives in practice#

  • Model-agnostic agent backend: Python, LangChain, MCP framework with provider adapters.
  • Secure browser extension: Chrome/Firefox compatible via WebExtensions.
  • Advanced agent workflows: RAG, persistent memory, multi-step tasks.
  • Guardrails and transparency: User approval, logs, filtering, allowlists.
  • Open-source extensibility: Modular tool and service architecture.

Model-Agnostic LLM adapter#

The LLM adapter encapsulates provider-specific clients behind a unified interface. It supports multiple providers, validates API keys, and constructs client instances with configurable base URLs and models.

MCP server and tooling#

The MCP server exposes standardized tools for LLM generation, GitHub QA, website fetching, and HTML-to-markdown conversion. It dynamically initializes LLM clients based on incoming arguments and returns structured text content.

Agent orchestration and tools#

The ReAct agent uses LangGraph to alternate between reasoning and tool execution. It binds tools dynamically, manages conversation context, and converts between internal and external message formats.

Browser action agent and declarative actions#

The browser action agent translates natural language goals into JSON action plans. The prompt defines available actions (DOM manipulation and tab/window control) and enforces strict output formatting and selector selection rules.

Extension messaging and security#

The extension uses explicit message types for agent tool execution, tab/window control, and action execution. Every action is logged and requires user consent.

Dependency analysis#

The project relies on a curated set of libraries for LLM integration, web automation, and agent orchestration. The dependency graph highlights the central role of LangChain/LangGraph and MCP.

Performance considerations#

  • Asynchronous tool execution: Tools use asyncio and thread pools to avoid blocking the main loop.
  • Provider configuration caching: LLM clients are constructed on-demand with validated credentials.
  • Minimal DOM manipulation: Content scripts inject only necessary scripts and dispatch minimal events.
  • Efficient prompting: Prompt templates are concise and output-only JSON to reduce parsing overhead.

Troubleshooting guide#

Common issues and resolutions:

  • Missing environment variables: Ensure API keys and base URLs are configured in the environment.
  • LLM initialization failures: Verify provider availability, base URLs, and model names.
  • Extension action errors: Confirm tab permissions and that the content script is injected before execution.
  • MCP tool errors: Validate tool names and argument schemas; check server logs for exceptions.

Conclusion#

You get MCP tooling, JSON action plans, and guardrails that keep you in the loop. Swap providers without rewriting the agent. Add tools without touching the UI. That is the whole bet.