nico-martin/gemma4-browser-extension

On-device AI agent Chrome extension powered by Transformers.js and Gemma 4

What it solves

It provides a private, on-device AI assistant that lives in the browser, allowing users to control their browser and interact with webpage content without sending data to external servers.

How it works

The extension uses Transformers.js and WebGPU to run the Gemma 4 model locally. It employs a three-part architecture: a background script that acts as the central AI engine for model loading and inference, a side panel for the chat interface, and content scripts that interact with the DOM to extract text or highlight elements. It uses Retrieval-Augmented Generation (RAG) for webpage interaction and a vector database in IndexedDB for semantic history search.

Who it’s for

Users who want an intelligent browser assistant with strict privacy guarantees and those interested in implementing local LLMs within Chrome extensions.

Highlights

  • Local Execution: Runs entirely on-device using WebGPU for privacy and speed.
  • Browser Control: Can manage tabs (open, close, switch) via natural language.
  • Semantic Web Interaction: Uses RAG to search and extract information from the current page.
  • AI History Search: Replaces keyword search with semantic search for browsing history using vector embeddings.
  • Visual Guidance: Can highlight and scroll to specific elements on a webpage to direct user attention.

Related

  • Project
  • Project
  • Project
  • Project
  • Project