Magnus Muller's Event-Driven Agent Architecture

Table of content
Magnus Muller's Event-Driven Agent Architecture

Magnus Muller is a software developer and startup founder who co-created Browser Use, the open-source library that lets AI agents control web browsers. While his co-founder Gregor Zunic handles product strategy, Magnus designed the event-driven architecture and maintains the CLAUDE.md file that makes the codebase AI-navigable. The project hit 50,000 GitHub stars in three months and raised $17 million from Felicis, Paul Graham, and Y Combinator (W25 batch).

Background

The CLAUDE.md Approach

Browser Use includes a CLAUDE.md file that gives AI assistants full context on the codebase. This file describes the architecture, code style requirements, and development workflow in a format Claude Code can consume.

From the CLAUDE.md:

# Browser-Use Library: Architecture & Development Guide

## Core Architecture
Browser-Use is an async Python 3.11+ library enabling AI agents
to autonomously navigate and interact with web pages using LLMs
and Chrome DevTools Protocol (CDP).

Key sections in the file:

SectionPurpose
Core ArchitectureMaps Agent, BrowserSession, Tools, DomService, LLM
Code StyleTabs, modern typing, Pydantic v2, service.py pattern
Development Workflowuv commands for setup, testing, quality checks
Testing PhilosophyReal instances over mocks, pytest-httpserver
Strategic DevelopmentEvent buses and job queues for isolation

This makes the codebase navigable by AI agents, not just human developers. Claude Code can understand where to make changes without extensive exploration.

Event-Driven Architecture

Magnus built bubus, a production-ready Python event bus that powers Browser Use. The library coordinates five watchdog services through async event dispatching:

from browser_use import Agent, Browser
from langchain_openai import ChatOpenAI

agent = Agent(
    task="Find the cheapest flight from SF to NYC",
    llm=ChatOpenAI(model="gpt-4o"),
    browser=Browser()
)
result = await agent.run()

The agent observes, reasons, acts, then repeats. All coordination happens through the event bus, keeping components isolated and testable.

Technical decisions encoded in the architecture:

ChoiceRationale
Event busesDecouple watchdogs from main agent loop
uuid7str for IDsTime-ordered UUIDs for debugging
Pydantic v2 modelsStrict validation at boundaries
service.py patternLogic separate from data models
No mocking in testsReal instances catch real bugs

Five-Day Shipping Philosophy

Magnus advocates for rapid iteration over planning:

“Ship so much, see if it works, otherwise build something else. Just ship all the time. That’s the most important thing - don’t overthink, just ship.”

Browser Use was built in five days as an experiment. The prototype combined web scraping with LLMs to enable action-taking. Magnus and Gregor posted it to Hacker News expecting criticism. Instead, it went viral.

His development principles:

Cognitive Science Background

Magnus studied cognitive science before computer science. He sees browser automation as an interface problem:

“Computers should understand what you want to do, not force you to learn their interface.”

This shapes Browser Use’s design. Instead of making users learn Selenium selectors or Playwright syntax, agents observe pages like humans do and act accordingly. The LLM handles the translation from intent to action.

Key Takeaways

PrincipleImplementation
Ship in five daysPrototype became a company
Write CLAUDE.mdMake codebase AI-navigable
Use event busesIsolate components, improve testability
Test with real usersWalk around and ask people to try it
Small-town work ethic14-hour days without complaint

Next: Jesse Vincent’s Superpowers Framework

Topics: agents open-source automation ai-coding claude-code