feat(extension): hybrid search + surface document chunks in auto-recall - #1422
Open
HaoChiBao wants to merge 2 commits into
Open
feat(extension): hybrid search + surface document chunks in auto-recall#1422HaoChiBao wants to merge 2 commits into
HaoChiBao wants to merge 2 commits into
Conversation
Auto-recall called /v4/search with the memories-only default and formatted hits as result.memory, so document chunk results became prompt lines with the literal string undefined. Request searchMode hybrid and format with memory || chunk. Includes an offline A/B eval harness and proof doc.
Graphite review: memory || chunk treated " " as truthy and dropped a valid chunk. Trim both fields before choosing.
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
Auto-recall in the browser extension was leaving useful document context on the floor.
/v4/searchwas called withoutsearchMode, so it used the API default ("memories").`${result.memory}`only. Hybrid/document hits that only setchunkbecame the literal stringundefinedin the Included Memories prompt.This PR:
searchMode: "hybrid"(same recommendation as the public docs / VoltAgent path in@supermemory/tools)memory || chunk, skips empties, and renumbers contiguouslyDoes not change server ranking. It only improves what the extension injects when the API already returns chunks.
Why this is not already upstream
Checked against current
mainand open extension PRs:apps/browser-extension/utils/search-request.tsonmainstill has nosearchModebackground.tsonmainstill pushesresult.memoryonlyProof
Latest offline A/B on 4 gold fixtures:
memoryonly)hybrid+memory || chunk)undefinedprompt linesExample (
chunk-only-page):1. undefined2. undefinedFull write-up:
apps/browser-extension/docs/hybrid-recall-eval.mdTest plan
bun test utils/hybrid-recall.eval.test.ts utils/search-request.test.ts(9 pass)bun run eval:hybrid-recall→ PASSmain; no overlap with fix(extension): stop fragmenting Included Memories that contain commas or newlines #1339 / fix(extension): finish Included Memories leftovers on T3 (#1257) #1421 search bodiesundefinedrows