Grounded Themes
JavaScript (ES modules), Transformers.js, WebAssembly · 2026
Grounded Themes turns notes (research findings, customer feedback, brainstorms) into themes with a fully client-side NLP pipeline: no backend, no API keys, and the notes never leave the browser.
I built the pipeline to run in a Web Worker: bge-small-en-v1.5 sentence embeddings → PCA → spherical k-means compared with agglomerative clustering, with the number of themes chosen by silhouette score → keyphrase scoring → theme labels from a quantized flan-t5-base model. Semantic search shows each note`s five closest matches.
I designed a three-gate validation layer (degeneracy, cosine relevance, vocabulary grounding) that screens every generated label before display. A failed label gets one retry with a second prompt, then falls back to marked keyphrases rather than a confident wrong answer. On the demo sample, 62% of labels pass on the first attempt and 68% within two (CI benchmark, 10 runs).
I set time, memory and download budgets, checked by a benchmark that includes a self-test: cold runs averaged about 53 s against a 90 s budget in CI on GitHub Actions. The models are cached for offline reuse after the first download. The interface is designed to meet WCAG 2.2 AA, with automated axe scans and VoiceOver passes on macOS and iOS.
I built it in vertical slices, with independent review gates for AI-written code: a fresh reviewer session per round, scripts that block reused reviewers and require verbatim requirement extracts, a requirements baseline that blocks silent spec edits, and a private pre-push hook for commit and content rules.
