Skip to content

Related Notes and Smart Tags

Discover how Glassy runs 384-dimensional embeddings in your browser via WebGPU to power Related Notes and Smart Tag Suggestions — no cloud, no data leaving your machine.

Walkthrough preview for Related Notes and Smart Tags
Walkthrough video coming soon

Before you start

  • local-ai/01-how-ai-works-in-glassy

What you'll learn

  • Understand how local embeddings work (384-dim, IndexedDB vector cache)
  • Use Related Notes to find connections without cloud AI
  • Use Smart Tag Suggestions to auto-classify captures
  • Recognize the "On Device" badge and when cloud embeddings take over
  • Understand why local and cloud embeddings are never compared

Glassy generates vector embeddings for your notes directly in your browser. These embeddings are mathematical representations of your note content — notes about similar topics have vectors that point in similar directions. This powers two features: Related Notes and Smart Tag Suggestions.

How local embeddings work

The pipeline:

  1. Text extraction — Glassy combines your note title, content, and tags into a single text string
  2. Embedding — the mxbai-embed-large model (384 dimensions) runs in your browser via WebGPU
  3. Storage — the vector is cached in IndexedDB under the GlassyLocalEmbeddings database, namespaced by model ID and dimension
  4. Search — when you open Related Notes or Smart Tag Suggestions, Glassy computes cosine similarity between the current note’s vector and all other cached vectors

When you open any note in Glassy, the Related Notes panel shows the most semantically similar notes from your library, ranked by cosine similarity.

How to use it

  1. Open any note in your library
  2. Look for the Related Notes section in the side panel
  3. Click any related note to navigate to it

If the results were computed on your device, you’ll see an “On Device” badge. This means:

  • The embedding model ran in your browser
  • The vector comparison happened in JavaScript
  • No note content was sent to any server
AI assistant settings panel showing the on-device model configuration and the On Device badge
AI settings — local models run on your device, no API key needed

Smart Tag Suggestions

When you create or edit a note, Glassy can suggest tags based on what similar notes are tagged with.

How it works — kNN tag aggregation

  1. Glassy finds the k-nearest neighbors of your current note using local embeddings
  2. It aggregates the tags from those neighbors
  3. Tags that appear frequently across neighbors are suggested

This is not a language model generating tags. It simply looks at what tags similar notes already have and suggests the most common ones. This is why it’s fast, private, and works offline.

How to use it

  1. Create a new note or open an existing one
  2. In the tag editor, look for suggested tags below the input field
  3. Click any suggestion to add it

The same “On Device” badge appears when suggestions are computed locally.

Cache invalidation

Glassy automatically updates the local vector cache when you:

  • Create a note — a new vector is generated and stored
  • Update a note — the old vector is invalidated and a new one is generated
  • Delete a note — the vector is removed from the cache
  • Leave a collaboration — vectors for notes from that workspace are pruned

You don’t need to manually manage the cache. If you notice stale results, opening the note again triggers a re-embedding.

When cloud embeddings take over

Cloud embeddings (768-dim, gemini-embedding-001) are used when:

  • Your browser lacks WebGPU support
  • You’re on the mobile app (which doesn’t run local models)
  • The local model hasn’t been downloaded yet

Cloud and local embeddings power the same features (Related Notes, Smart Tag Suggestions) but through different code paths. Results may differ slightly because the models and dimensions are different.

What’s next?

Now that you understand embeddings, learn how to ask AI questions about your library — the AI assistant with grounded, cited answers.