WebAssembly Agents: AI in the Browser Without Complications
5 min read

WebAssembly Agents: AI in the Browser Without Complications

861 words

Mozilla AI surprises again: AI agents that work just by opening an HTML

A few days ago I came across a Mozilla AI project that really caught my attention: WebAssembly Agents. And after 30 years watching the industry complicate life with dependencies, installations, and configurations, seeing something that works just by “opening an HTML” made me smile.

The problem it solves (and we all know it)

How many times have you tried to test an AI project and encountered this?

pip install this
npm install that
configure this API
download this model
install this framework

And after an hour installing things, it turns out it doesn’t work in your Python version, or the model doesn’t fit in your GPU, or there’s a dependency conflict. Frustrating, right?

Mozilla AI has attacked this problem elegantly: AI agents that run directly in the browser, packaged as standalone HTML files. No installations, no complex configurations, no headaches.

The magic behind: WebAssembly + Pyodide

The technical solution is really elegant. They use WebAssembly together with Pyodide to execute Python directly in the browser. For those not familiar:

  • WebAssembly: A binary format that allows executing C, C++, Rust, and Python code at near-native speed in browsers
  • Pyodide: A Python distribution that runs entirely on WebAssembly

The result is that you can execute complex Python code, including many libraries, directly in your browser. Without installing anything on your machine.

What I liked about the approach

As a developer who has worked with all kinds of technologies, several things caught my attention:

1. Distribution simplicity A single HTML file that contains both the UI and the agent code. Reminds me of the old days when web applications were simple and self-contained.

2. Sandboxing by design By running in the browser, agents are automatically in a sandboxed environment. This is especially important when working with AI, where security is critical.

3. Multi-model compatibility Although it works with OpenAI out-of-the-box, you can also use local models through Ollama, vLLM, or HuggingFace TGI. This flexibility seems fundamental to me.

The practical examples

Mozilla AI has included several demos showing the possibilities:

  • hello_agent.html: A basic conversational agent
  • handoff_demo.html: A multi-agent system that routes requests to specialized agents
  • tool_calling.html: Agent with integrated tools (including the famous question “how many Rs are in strawberry?”)
  • ollama_local.html: To use local models completely offline

The limitations (because there always are)

Mozilla AI is honest about current limitations, and I appreciate that transparency:

1. Dependency on specific frameworks For now it only works with openai-agents. Other frameworks like smolagents have their own limitations with Pyodide.

2. CORS everywhere As soon as you want your agent to access external APIs or local models, you’ll run into CORS problems. It’s the price of web security.

3. Heavy models Not all computers can run large models. On a MacBook M3 you can run qwen3:8b without problems, but on a Raspberry Pi 5 you start to suffer.

My experience testing it

I’ve been playing with the examples and the experience is surprisingly good. The setup is as simple as:

  1. Download the HTML files
  2. Configure your API key (OpenAI or local)
  3. Open the HTML in the browser
  4. It’s already working!

The speed is respectable, although obviously not as fast as running native Python. But for prototyping and experimentation, it’s more than enough.

Reflections from a veteran developer

This project has made me reflect on several things:

Back to basics Reminds me of when web development was simpler. An HTML file that contained everything you needed. Sometimes simplicity is the best feature.

The power of the modern browser It’s impressive what current browsers can do. Running complex AI models directly on the client would have been science fiction 10 years ago.

Barrier-free experimentation This completely eliminates entry barriers for experimenting with AI agents. It’s exactly what we need for more people to be able to test and learn.

Is it the future?

As the author of the Mozilla AI post says: “I don’t know if WebAssembly agents are a great idea or just a fun hack”. But to me, they seem to be touching on something important.

In my work philosophy, I’ve always said that “for every minute of planning, 2 minutes less of development”. Well, this project completely eliminates setup and configuration time. You can go straight to the point: experimenting with your agent.

Conclusion

WebAssembly Agents is one of those projects that makes you think “why didn’t I think of it before?”. The idea of packaging AI agents as standalone HTML files is brilliant in its simplicity.

Is it perfect? No. Is it useful? Absolutely. Is it worth experimenting with? Without a doubt.

As I always say: errors and problems always happen, you have to take that into consideration. But this project minimizes many of the typical problems of AI development, and that’s already a great advance.

I recommend you check out the GitHub repository and try the examples. It’s one of those projects that makes you feel technology can be simple and powerful at the same time.


Have you tried WebAssembly Agents? What do you think about the idea of running AI directly in the browser? I’d love to hear your experiences.

Comments

Latest Posts

5 min

1020 words

I have been using Claude Code daily for months, and there is one configuration that has completely changed how it works with my code. It is not a new plugin, a more powerful model, or a magic prompt. It is something that has existed since 2016 and that most developers use without knowing it every time they open VS Code: the Language Server Protocol (LSP).

Karan Bansal published an excellent article explaining in detail how to enable LSP in Claude Code and why it matters. After trying it, I can confirm the difference is real and significant.

9 min

1747 words

If you’re using tools like Claude Code, GitHub Copilot Workspace, or similar, you’ve probably noticed there’s technical jargon that goes beyond simply “chatting with AI”. I’m talking about terms like rules, commands, skills, MCP, and hooks.

These concepts are the architecture that makes AI agents truly useful for software development. They’re not just fancy marketing words — each one serves a specific function in how the agent works.

Let’s break them down one by one in a clear way.

4 min

791 words

Lately I’ve been following a discussion that worries me quite a bit: to what extent are we delegating our thinking to AI. It’s not an abstract or philosophical question, it’s something very real I’m seeing day to day in our profession and in society in general.

Recently I read an article by Erik Johannes Husom titled “Outsourcing thinking” that, among other things, discusses the concept of “lump of cognition fallacy”. The idea is that, just as there’s an economic fallacy saying there’s a fixed amount of work to do, some believe there’s a fixed amount of thinking to do, and if machines think for us, we’ll just think about other things.

2 min

315 words

Lately I’ve been closely following everything around the MCP protocol (Model Context Protocol), and recently I found a project that makes a lot of sense: MCPHero.

The reality is that although MCP is taking off, many “traditional” AI libraries like openai or google-genai still don’t have native MCP support. They only support tool/function calls. MCPHero comes to solve exactly this: make a bridge between MCP servers and these libraries.

What is MCPHero?

MCPHero is a Python library that lets you use MCP servers as tools/functions in native AI libraries. Basically, it lets you connect to any MCP server and use its tools as if they were native OpenAI or Google Gemini tools.

4 min

678 words

A few days ago I read an article by Dominiek about the 5 principles for using AI professionally and found myself constantly nodding. After years of watching technologies arrive and evolve, AI gives me the same feelings I had with other “revolutions”: enthusiasm mixed with a necessary dose of skepticism.

Dominiek’s article especially resonated with me because it perfectly describes what we’re experiencing: a world where AI is getting into everything, but not always in the most useful or sensible way.

5 min

905 words

Throughout my career, I’ve seen many things change. I’ve gone from Borland to Visual Studio, from vi to Sublime Text, from Sublime to VS Code… And believe me, each change was a deliberate decision that cost me weeks of adaptation. But what’s happening now with AI tools is something completely different.

I’ve found myself using Copilot in the morning, trying Cursor in the afternoon, and checking out Claude Code before going to bed. And I’m not alone. Developers have gone from being faithful as dogs to our tools to being… well, promiscuous.