Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glens — Gmail Lens

Glens is a Chrome extension that uses Gemini Nano (Google's on-device AI) to automatically summarize your Gmail inbox and individual emails. It runs entirely in your browser — no data ever leaves your machine.


Features

  • Inbox Summary — Scans visible inbox emails and surfaces what matters: deliveries, flights, meetings, interviews, deadlines, and appointments.
  • Single Email Summary — Opens a summary panel when you view any individual email, highlighting key points, action items, dates, and important numbers.
  • On-Device AI — Powered by Gemini Nano via Chrome's built-in LanguageModel API. Falls back to regex-based smart extraction if Gemini Nano is unavailable.
  • Auto-Activation — Fires automatically when Gmail loads and re-runs when you navigate between inbox and individual emails.
  • Privacy-First — All processing happens locally in the browser. No external API calls, no data sent anywhere.

How It Works

  1. When Gmail loads, Glens detects whether you're in Inbox view or Email view.
  2. It traverses the Gmail DOM to extract email metadata (sender, subject, snippet, date) or the full body of an opened email.
  3. It sends the extracted text to the background service worker, which routes it to Gemini Nano if available.
  4. The AI generates a structured summary, which is displayed in a floating panel on the right side of the screen.
  5. The panel auto-dismisses after 20 seconds, or you can close/collapse it manually.

Requirements

  • Google Chrome (version 138 or later recommended)
  • Gemini Nano enabled in Chrome flags (see setup below)

Installation on Chrome

Step 1 — Enable Gemini Nano

Glens uses Chrome's built-in on-device AI. You need to enable it first:

  1. Open Chrome and go to chrome://flags
  2. Search for "Prompt API for Gemini Nano" and set it to Enabled
  3. Search for "Optimization Guide On Device Model" and set it to Enabled BypassPerfRequirement
  4. Restart Chrome
  5. Go to chrome://components, find "Optimization Guide On Device Model", and click Check for update to download the model

The model download may take a few minutes depending on your connection.

Step 2 — Load the Extension

  1. Download or clone this repository to your computer
  2. Open Chrome and go to chrome://extensions
  3. Toggle Developer mode ON (top-right switch)
  4. Click Load unpacked
  5. Select the Glens folder (the one containing manifest.json)
  6. The extension will appear in your extensions list

Step 3 — Use It

  1. Open Gmail
  2. Wait a few seconds — Glens will automatically scan your inbox and show a summary panel in the top-right corner
  3. Click on any email to open it — Glens will summarize the email content
  4. Use the button to collapse the panel, or × to close it

File Structure

Glens/
├── manifest.json     # Chrome extension config (Manifest V3)
├── content.js        # DOM traversal, email extraction, popup UI
├── background.js     # Gemini Nano integration, fallback summarization
├── popup.css         # Floating panel styles
└── icon.png          # Extension icon

Permissions

Permission Reason
activeTab Read Gmail DOM on the active tab
https://mail.google.com/* Restrict the extension to Gmail only

No network permissions are requested. Everything runs locally.


Fallback Behavior

If Gemini Nano is not available or not yet downloaded, Glens uses regex-based text analysis to extract:

  • Dates and times mentioned in emails
  • Order/tracking numbers and amounts
  • Urgency keywords (urgent, deadline, ASAP)
  • Category counts (deliveries, flights, meetings)

The fallback is less detailed but still useful while the model downloads in the background.

About

AI-powered Gmail summarizer using Gemini Nano. Summarizes your inbox and individual emails with on-device AI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages