Repository navigation
fix: warm Cyrillic search and drop shared-word neighbours - #70
Merged
Merged
Conversation
An ASCII warmup left the first Russian query to initialize the tokenizer and spend the two-second embed budget. The card floor now counts distinctive terms, including the title, so бот and сайт do not keep every note. "How does it work" no longer puts an unmatched work in the grounding share. Co-authored-by: Nick Kosarev <nick@kosarev.space>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #69 on a three-note RU/EN instance. Tools stay
search,remember,read, andtimeline.Done
warmup, so the first Cyrillic question still initialized the tokenizer and the runtime. Warmup now stems and embeds an English question andКак устроена память бота?before it logsembeddings_ready. Listen is still not blocked.doeswas already removed.workwas not, and because it occurs in no note its inverse-document-frequency is the largest weight in the denominator.How does the bot's memory work?matched onlybotandmemoryand stayedweak(share about 0.41).work/works/working/workedandнетare now function words for the share. The memory note does not need to contain the wordwork.ботandсайт, and it did not see the title. A neighbour with one shared word stayed at about half the best score, which the 0.5 floor keeps. The floor now counts the same function-word list as grounding, ignores a term that occurs in half or more of a corpus below the margin floor, and includes the title. When no card has a distinctive term, the floor does not run, so an accepted-ADR score boost cannot drop a superseded copy of the same words.docs/search.mdanddocs/curated-instance.md.Tests
pnpm run check— lint, typecheck, 288 tests passed.node dist/test/evaluate-grounding.js(lexical, no model files):nonestrong(allnone)New fixture, three notes that all mention the bot and the site:
How does the bot's memory work?isstrongand returns the memory note.Как устроена память бота?,О чём отвечает AI Бот?, andПочему на сайте нет бейджей технологий?are eachstrongand return one card.Skipped
Friction
tscbecause Node still cannot importpackage-query.jsfrom the TypeScript sources. Stemmer, regex, and NFKC were red herrings (all under 10 ms). Seeing share0.414forbot|memorymade theworkweight obvious. The card-floor change then failedtest/documents.test.ts: once every term was shared, concept counts went to zero and the accepted-ADR+1versus superseded×0.5looked like a huge score gap, so the superseded card disappeared. One fullpnpm run check(about 28 s) caught that. No model download and no flake loop.src/embedding-index.tsloggedembeddings_readyafter one ASCII embed and the comment said that removed the first-query cost.src/embedding-index.tssearchraces the embed against 2000 ms, which is why a cold Cyrillic query lands near 2143 ms and the next ones are 50–90 ms.src/documents.tsadjustDocumentScoreadds a full point, larger than the whole reciprocal-rank score, so a floor written as "fraction of the score" drops superseded documents when the term count is zero.multilingual-e5-smallweights where this environment can load them, and havecontext grounding explainprint each term's weight and whether it was dropped as a function word or as shared. The share line alone did not say that unmatchedworkwas most of the denominator.