LaVague: Large Action Model Framework for AI Web Agents

Aug 2, 2025

Introduction

Automating complex web interactions often requires writing hundreds of lines of fragile Selenium or Playwright code that breaks the moment a UI change occurs. LaVague is an open-source Large Action Model (LAM) framework that allows developers to build AI Web Agents capable of navigating the web and performing tasks based on natural language objectives. By translating high-level goals into executable action code, LaVague removes the manual labor of browser automation and creates agents that are more resilient to UI updates.

What Is LaVague?

LaVague is an open-source Large Action Model framework designed to develop AI Web Agents. It enables these agents to take a natural language objective—such as “Print installation steps for Hugging Face’s Diffusers library”—and perform the required actions to achieve that goal. The framework is built on Python and is designed to be modular, allowing developers to integrate different LLMs and browser drivers.

At its core, LaVague operates through two primary components: a World Model and an Action Engine. The World Model analyzes the current state of the web page and the user’s objective to generate instructions, while the Action Engine compiles these instructions into executable code (e.g., Selenium or Playwright) and executes them in the browser.

Why LaVague Matters

Traditional web automation is plagued by the “brittle test” problem: a single changed ID or class name in a HTML element can break an entire automation script. LaVague solves this by using LLMs to interpret the page structure dynamically. Instead of hard-coding XPaths or CSS selectors, the agent understands the context of the page and finds the correct element to interact with based on the objective.

Furthermore, LaVague provides a standardized way to build agents that can handle multi-step workflows. This reduces the time spent on script maintenance and allows developers to focus on the high-level logic of the agent’s behavior rather than the minutiae of browser driver management. With the support of industry leaders like Hugging Face and LlamaIndex, the project has gained significant traction as a viable alternative to manual scripting.

Key Features

  • World Model: Translates natural language objectives and the current web page state into a set of high-level instructions.
  • Action Engine: Action Engine: Compiles high-level instructions into executable browser code, such as Selenium or Playwright, and executes them.
  • Multi-Driver Support: Supports Selenium, Playwright, and a dedicated Chrome Extension driver for flexible deployment across different browser environments.
  • Built-in Contexts: Provides pre-defined configurations to quickly set up agents with specific LLM and embedding models.
  • Token Counter: Includes tools to estimate token usage and costs, which is critical for managing API expenses when running large-scale agents.
  • Gradio Interface: Offers an optional interactive interface for testing and debugging agents in real-time.
  • LaVague QA: A specialized tool for QA engineers that turns Gherkin test specifications into ready-to-use Pytest code using LaVague agents.
  • Debugging Tools: Built-in tools to monitor the agent’s decision-making process and the code it generates.

How LaVague Compares

Feature LaVague Traditional Selenium Skyvern
AI-Driven Element Selection Yes No Yes
Natural Language Objectives Yes No Yes
Open Source Framework Yes Yes Partial
Gherkin to Pytest Conversion Yes No No
Multi-Driver Support Yes Limited Yes

LaVague differs from traditional Selenium scripts by replacing static selectors with a dynamic AI-driven approach. While traditional scripts are highly predictable but fragile, LaVague agents are more flexible and can adapt to UI changes without requiring a manual update to the code. Compared to other AI agents like Skyvern, LaVague provides a more modular framework for developers to build their own agents, giving them more control over the World Model and Action Engine.

Getting Started: Installation

pip Installation

The fastest way to get started with LaVague is via pip. Ensure you have Python 3.10 or greater installed on your system.

pip install lavague

Install from Source

If you wish to contribute or modify the framework, you can install it directly from the GitHub repository.

git clone https://github.com/lavague-ai/LaVague.git
cd LaVague
pip install -e .

Prerequisites: API Keys

LaVague uses OpenAI’s models by default for embeddings, LLM, and Vision models. You must set the OPENAI_API_KEY environment variable in your local environment for the agent to function.

export OPENAI_API_KEY="your_api_key_here"

How to Use LaVague

To use LaVague, you need to initialize the three core components: the Driver, the Action Engine, and the World Model. Once these are initialized, you create a WebAgent and provide it with a URL and a natural language objective.

The agent will then analyze the page, determine the necessary steps to achieve the goal, and execute the laVague-generated code in the browser. You can run this in headless mode or with a visible browser window to monitor the agent’s actions.

Code Examples

Below is a basic example of how to create and run a LaVague agent to navigate to a specific page and perform a task.

from lavague.drivers.selenium import SeleniumDriver
from lavague.core import ActionEngine, WorldModel
from lavague.core.agents import WebAgent

# Initialize the driver
driver = SeleniumDriver(headless=False)
# Initialize the action engine
action_engine = ActionEngine(driver)
# Initialize the world model
world_model = WorldModel()

# Create the Web Agent
agent = WebAgent(world_model, action_engine)

# Set the starting URL
agent.get("https://huggingface.co/docs")

# Run the agent with a natural language objective
agent.run("Go on the quicktour of PEFT")

If you want to test your agent interactively, you can use the agent.demo() method to launch a Gradio interface.

# Launch the agent in the Agent Gradio Demo mode
agent.demo("Go on the quicktour of PEFT")

Advanced Configuration

LaVague allows for deep customization of the agent’s behavior by modifying the World Model and Action Engine. You can define custom contexts (configurations) to change the LLM used for generating instructions and the LLM used for generating the action code.

For example, you can swap the default OpenAI models for other LLMs provided by Hugging Face or other local models, allowing you to avoid vendor lock-in and optimize for cost or privacy.

Real-World Use Cases

  • Automated QA Testing: QA engineers can use LaVague QA to turn Gherkin specifications into Pytest code, reducing the time spent writing and maintaining fragile browser tests.
  • SaaS Process Automation: Automate repetitive tasks across different SaaS platforms (like CRM or ERP systems) by piloting an agent to handle data entry or orchestration.
  • Information Retrieval: Create agents that can navigate complex documentation sites or internal portals to retrieve specific information based on a user’s query.
  • Web Scraping at Scale: Use LaVague to handle dynamic content and complex navigation paths that would typically require custom scripts for every single site.
  • Competitive Intelligence: Monitor competitors’ pricing or feature updates by automating the navigation and data extraction from their websites.

Contributing to LaVague

LaVague is an open-source project and encourages contributions from the community. You can contribute by reporting bugs through GitHub Issues, submitting pull requests for new features, or improving the documentation. If you are a new contributor, look for issues labeled “good first issue” to get started.

The project follows standard GitHub flow: fork the repository, create a feature branch, and submit a pull request against the main branch.

Community and Support

LaVague has a growing community of AI agent builders. You can find official support and discussions on GitHub Discussions and the official documentation site at docs.lavague.ai. For real-time collaboration and support, join the LaVague Discord server via the link provided in the repository.

Conclusion

LaVague is a powerful framework for anyone looking to move beyond the limitations of traditional web automation. By leveraging Large Action Models, it transforms natural language objectives into executable browser actions, making automation more resilient and accessible. It is the right choice for developers who need to build agents that can navigate the web dynamically and for QA engineers who want to automate the test generation process.

If you can’t handle the cost of API calls or require a local-only environment, you may need to explore local LLM integrations. However, for most developers, the speed of development and the resilience of the agent is a significant upgrade over manual scripting.

Star the repo, try the quickstart, and join the community to start building AI Web Agents today.

What is LaVague and what problem does it solve?

LaVague is an open-source Large Action Model (LAM) framework that automates web interactions by translating natural language objectives into executable browser code. It solves the problem of brittle web automation scripts that break when UI elements change, by using AI to dynamically identify elements and navigate the web.

How do I install LaVague?

You can install LaVague using pip by running pip install lavague. You will also need to set the OPENAI_API_KEY environment variable in your local environment for the agent to function by default.

How does LaVague compare to Selenium?

Unlike Selenium, which requires hard-coded selectors (like XPaths), LaVague uses an LLM to interpret the page structure and generate the same action code (like Selenium) on the fly. This makes LaVague agents more resilient to UI changes and UI updates.

Can I use LaVague for automated QA testing?

LaVague QA is a specialized tool within the framework that can turn Gherkin test specifications into Pytest code, which can then be executed to validate web application behavior.

What browser drivers does LaVague support?

LaVague supports Selenium, Playwright, and a dedicated Chrome Extension driver, allowing developers to choose the driver that best fits their deployment environment.

What is the World Model in LaVague?

The World Model is the component that takes the current state of the web page and the user’s objective and turns it that into high-level instructions for the agent to perform.

What license does LaVague use?

LaVague is an open-source project available on GitHub, which encourages community contributions via pull requests.

Can I use LaVague for web scraping?

LaVague can be used for web scraping by providing the agent with an objective to find and retrieve specific data from a web page, allowing it to handle dynamic content and complex navigation paths more easily than static scrapers.