feat: infer tags from recall query for soft ranking boost (#142)#144
Merged
rahilp merged 7 commits intoJun 10, 2026
Merged
Conversation
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
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.
Summary
inferQueryTags(query, env): three-tier tag inference — hashtag extraction (free, no DB), keyword match against known tag vocabulary (json_eachquery), and LLM fallback only when both find nothing; runs in parallel with embedding viaPromise.allso the common path adds no latencyqueryTags: string[]param torerankWithTimeDecay: entries whose tags overlap with inferred tags get a soft boost (TAG_BOOST_STEP=0.15,TAG_BOOST_MAX=1.5) applied outside the recency cap — tag-relevant memories can surface above marginally-closer but irrelevant ones without over-narrowing resultsrecallEntries: explicittagfilter behaviour is unchanged; inference is soft ranking onlyResolves #142
Test plan
npm test— 314/314 passingnpx tsc --noEmit— no TypeScript errorstag=workfilter — no regression in existing tag-scoped behaviour