Matching a reader's context in the browser: embeddings fix false hits before they fix recall
Tested on twenty hand-written reader profiles across 71 pages, in-browser embeddings beat shared-word matching on top-three recall (16/16 vs 14/16), and cut false matches on unrelated visitors from 4/4 to 1/4.
November 18, 2026 · Research note · What is not yet established
For you ranks this site’s pages inside your browser against a short bio or an AI agent’s notes about you, so a portable user model can steer what you read without uploading anything to me. Until today, the Bring your own context page had only been tried on six examples chosen while building it.
I froze twenty reader descriptions before running either matcher across all 71 public pages: eight everyday descriptions that avoid my posts’ vocabulary, eight technical or multi-interest agent bios, and four unrelated visitors (a warehouse broker, a sourdough baker, a marine diesel mechanic, and a volleyball coach) for whom the honest answer is nothing.
| Stratum | Shared words (/compendium.json) | Meaning (all-MiniLM-L6-v2, FLOOR = 0.22) |
|---|---|---|
Everyday wording, Top-1 / Hit@3 (8) | 5 / 8 · 7 / 8 | 7 / 8 · 8 / 8 |
Technical & multi-interest, Top-1 / Hit@3 (8) | 7 / 8 · 7 / 8 | 7 / 8 · 8 / 8 |
All positive profiles, Top-1 / Hit@3 (16) | 12 / 16 · 14 / 16 | 14 / 16 · 16 / 16 |
Unrelated profiles given false matches (4) | 4 / 4 | 1 / 4 |
The biggest gain was not recall—it was knowing when to stay quiet:
- Shared-word matching recommended pages to all four unrelated visitors. Because
terms.mjsaccepts any cosine score above zero, one stray word was enough:"bulk"sent the sourdough baker to a statistics note,"propeller"sent the boat mechanic to aircraft acoustics, and"schedule"sent the warehouse broker to the ideas queue. - Embeddings rescued zero-overlap queries and silenced three of four unrelated profiles. Quantised
all-MiniLM-L6-v2found all 16 positive targets in the top three—including chatty group-chat bots (Tending a room of agents) and sycophancy vs. logical flaws (Argument or pressure), where word matching missed completely. Only the volleyball coach cleared the0.22floor (0.2231), while the weakest true-positive Top-1 scored0.3034. - Exact technical terms still beat a small general embedding on fine ties. For a portable-user-model HCI bio, shared words put Walkable Mind first on
spatial,portable,json, andlocal, whereas embeddings placed the June robot essay0.0004ahead (0.4115vs0.4111).
A GitHub Action now refreshes /embeddings.json automatically whenever a post or idea changes. Scripts and per-profile outputs are in /research/bring-your-own-context/.
Agent context: sources, method and working notes
Method and leakage guard
- Exact code under test:
public/research/bring-your-own-context/score.mjsimports the livematch()(src/lib/terms.mjs) andrank()(src/lib/meaning.mjs) functions and runs them against the builtdist/compendium.jsonanddist/embeddings.jsonartifacts. - Self-reference guard: Because this note mentions the four negative test professions (
warehouse,sourdough,diesel,volleyball),score.mjsstrips/matching-reader-context-in-the-browser/from both indexes before scoring so the benchmark write-up cannot leak into the corpus it evaluates. - Automatic vector refresh:
.github/workflows/refresh-embeddings.ymlrunsnode scripts/embed-pieces.mjson pushes tomaintouchingsrc/content/blog/**orsrc/content/ideas/**and commitssrc/data/embeddings.jsonwhen any piece hash is missing.
Selected failure and tie cases from summary.json
| Profile | Word Top-1 (score, matched words) | Meaning Top-1 (score) | Why they differed |
|---|---|---|---|
p03_balcony_flight_path | /reference-recordings/ (0.1149, recording) | /plane-sound-location/ (0.5567) | Query said “jets” and “flying”, never “plane” or “aircraft”; word matcher latched onto “recording”. |
p07_chatty_slack_bots | /why-im-putting-hermes-into-a-robot-reachy-mini/ (0.0636, assistant) | /ideas/bring-your-own-context/ (0.3787), #2 /tending-a-room-of-agents/ (0.3745) | Word matcher missed top 3 completely; meaning put both user-memory pages at the top (0.0042 apart). |
p13_sycophancy_vs_reason | /tending-a-room-of-agents/ (0.0745, user) | /pseudonym-now-proof-later/ (0.4862), #3 /ideas/argument-or-pressure/ (0.4288) | Sentence-level max-pooling let the second sentence (“anonymous cryptographic authorship”) match cleanly while keeping argument-vs-pressure at #3. |
n20_volleyball_recruiting | /a-front-page-for-my-questions/ (0.0794, division) | /why-im-putting-hermes-into-a-robot-reachy-mini/ (0.2231) | Cleared FLOOR = 0.22 by 0.0031; raising FLOOR to 0.25 and adding a two-distinctive-term floor to terms.mjs are the obvious next fixes to test on a held-out set. |
Changes
- November 27, 2026: Added inline mechanism-lens cosine floor explorer and static benchmark figure.
- November 18, 2026: First public version.