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.
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
Reference documentation
Read the technical docs for this feature →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:
- Text extraction — Glassy combines your note title, content, and tags into a single text string
- Embedding — the
mxbai-embed-largemodel (384 dimensions) runs in your browser via WebGPU - Storage — the vector is cached in IndexedDB under the
GlassyLocalEmbeddingsdatabase, namespaced by model ID and dimension - 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
Related Notes
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
- Open any note in your library
- Look for the Related Notes section in the side panel
- 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
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
- Glassy finds the k-nearest neighbors of your current note using local embeddings
- It aggregates the tags from those neighbors
- 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
- Create a new note or open an existing one
- In the tag editor, look for suggested tags below the input field
- 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.