Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Tab Organizer

A personal Chrome extension that organizes your open tabs into topical groups using on-device AI (Chrome's built-in Gemini Nano), with saved workspaces you can close and restore later. No API keys, no cloud, no cost — every tab title and URL stays on your machine.

Features

  • Task/topic grouping. Tabs are grouped by what you're doing — "Flight Booking", "React Docs", "Tax Filing" — not just by website, so a task spread across several sites lands in one group.
  • Auto mode (re-balancing). When enabled, a debounced pass (~2.5s after tab activity settles) re-clusters every groupable tab and reconciles the result against your existing groups: misfiled tabs move, groups get renamed as their mix shifts, and correctly-placed tabs stay put to keep churn low.
  • Group Now. A one-click full re-organize of the current window from the popup.
  • Pinned tabs are never grouped or moved. They're excluded when tabs are collected and re-checked again immediately before grouping, so pinning a tab mid-pass keeps it pinned and in place.
  • New groups collapse on creation to keep the tab strip tidy; your existing groups' expand/collapse state is left untouched.
  • Saved workspaces. Snapshot the current window's groups (optionally closing the tabs), then restore them later into a fresh window.
  • Always works. If the model is unavailable, it falls back to deterministic grouping by domain with friendly names (e.g. news.ycombinator.com → "Hacker News").

Requirements

  • Chrome 138+ with the built-in Prompt API (Gemini Nano).
  • If the Prompt API is gated, enable these flags and restart Chrome:
    • chrome://flags/#prompt-api-for-gemini-nano
    • chrome://flags/#optimization-guide-on-device-model
  • The model downloads on first use (a few GB, one time). Without it, the extension still groups by domain.

Install (load unpacked)

  1. Build the extension:
    npm install
    npm run build      # typecheck + production build into dist/
  2. Go to chrome://extensions and enable Developer mode.
  3. Click Load unpacked and select the dist/ folder.
  4. Open the popup → Settings and click Download model if it isn't ready yet (watch the progress bar; this is a one-time download).

Usage

Popup (toolbar icon):

  • Group my tabs — re-organize the current window now.
  • Current groups — see the groups in this window.
  • Save workspace — name and snapshot the current groups.
  • Saved workspaces — restore or delete a saved snapshot.
  • Settings — opens the options page.

Settings (options page):

  • On-device model — check status / download the model.
  • Auto-assign new tabs to groups — turn auto mode on or off.
  • Max groups — upper bound on how many groups a pass may create (2–9, default 8).

Privacy

Everything runs locally. Tab titles and URLs are sent only to the on-device Gemini Nano model — never to a server. URL query strings and fragments are stripped before a path hint is passed to the model, and no data leaves the browser.

How it works

  • Service worker (src/background/) orchestrates everything and owns all tab / group / storage calls. It collects groupable tabs, asks the model to cluster them, then reconciles the clusters against existing groups.
  • Offscreen document (src/offscreen/) hosts the LanguageModel (Gemini Nano) session — the Prompt API can't run in a service worker, so AI calls live here.
  • Shared library (src/lib/) holds the grouping/reconciliation engine (grouping.ts), the model prompts and parsing (ai.ts), workspaces, settings, colors, and messaging helpers.
  • Popup (src/popup/) and Options (src/options/) are the UI.

The model is asked for low-temperature, schema-constrained JSON, and its output is validated: only known tab IDs are accepted, duplicates are dropped, and any tab the model skips is swept into a domain-based group so nothing is left behind.

Develop

npm run dev        # Vite dev server with HMR
npm run build      # typecheck + production build into dist/
npm run typecheck  # type-check only

Project layout:

src/
  background/   service worker (orchestration, tab/group/storage)
  offscreen/    Gemini Nano session (Prompt API)
  lib/          grouping engine, AI prompts, workspaces, settings, types
  popup/        toolbar popup UI
  options/      settings page

Troubleshooting

  • Groups never appear / "model unavailable". Confirm Chrome 138+, enable the two flags above, restart, then Download model from Settings. Until the model is ready the extension groups by domain instead.
  • Auto mode does nothing. It only acts on normal http(s) tabs, needs at least two groupable tabs, and runs ~2.5s after tab activity settles. Pinned tabs and chrome:// pages are intentionally ignored.
  • A group has an odd name. Naming improves with the AI model enabled; the domain fallback uses site names.

Testing checklist

  1. Open ~10 mixed tabs spanning a couple of tasks across different sites, click Group my tabs → sensible task/topic groups appear.
  2. With groups present, open or misfile a tab → with auto mode on, it moves into the right group within ~2.5s while correctly-placed tabs stay put.
  3. Pin a tab mid-pass → it stays pinned and ungrouped.
  4. Save a workspace, close its tabs, then restore → tabs and groups return.
  5. Disable the model/flag → tabs still group by domain with friendly names.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages