Repository navigation
fix(memory): improve recall reliability and candidate coverage #8716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
aa0bc54
fix(memory): improve recall delivery and multilingual fallback
yiliang114 ec0c746
fix(memory): bound heuristic recall scoring
yiliang114 143a372
test(memory): pin initial recall budget with fake timers
yiliang114 7a079d1
test(memory): pin recall budget and scoring contracts
yiliang114 c9bec59
fix(memory): preserve recall field weighting
yiliang114 bbd040d
fix(memory): recall relevant topics beyond scan cap (#8803)
yiliang114 d8b4e2b
fix(memory): address recall review feedback
yiliang114 da48034
test(memory): measure recall rollout gate against the pre-change scorer
c50c69d
fix(memory): deliver a deterministic fast recall result on the initia…
30dda5e
docs(memory): record the fast-path decision and phase/strategy split
4563b19
test(memory): report the mixed-language slice in the rollout gate
d6aa8c5
docs(memory): align recall docs on the deterministic fast path
4cad8a3
Merge branch 'main' into codex/7040-memory-recall
wenshao 823ac2a
fix(memory): use Array<T> for the fast-path test doc lists
5d3f9b9
docs(memory): clarify recall delivery telemetry
yiliang114 9adc612
fix(memory): report already-delivered recall count
yiliang114 ef4c5fa
Merge remote-tracking branch 'origin/main' into HEAD
yiliang114 6085ef0
docs(memory): align recall delivery claims
yiliang114 57281e8
Merge branch 'main' into codex/7040-memory-recall
yiliang114 8a5a524
fix(memory): rank ties by recency and record fast-delivered discards
yiliang114 d2598bd
docs(memory): state the candidate-cap trade and the per-turn document…
yiliang114 01ef7d7
fix(memory): end the initial recall wait on the fast result, widen to…
yiliang114 db006f8
docs(memory): correct the initial-turn preference claim, pin it with …
yiliang114 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
docs/design/2026-08-08-native-memory-recall-reliability.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Native Memory Recall Reliability | ||
|
|
||
| ## Problem | ||
|
|
||
| Managed-memory recall starts asynchronously for each user query. The initial | ||
| request currently performs a zero-wait consume, so a useful selector result can | ||
| miss the first prompt because of incidental scheduling. If the turn has no tool | ||
| call, that result has no later safe delivery point. | ||
|
|
||
| The model selector remains the normal precision gate. Its failure fallback has | ||
| two independent correctness problems: it tokenizes only ASCII text and gives | ||
| every non-empty document a positive score even without a lexical match. | ||
|
|
||
| ## Decision | ||
|
|
||
| Keep the existing single-result recall lifecycle and model-primary selection. | ||
|
|
||
| - Give user-query recall a fixed 100 ms initial wait budget. | ||
| - Deliver a result that settles inside the budget in the initial prompt. | ||
| - If the budget expires, leave recall pending for the existing same-query | ||
| ToolResult delivery point. | ||
| - Do not abort recall or run heuristic fallback merely because the initial | ||
| budget expires. | ||
| - Preserve the existing cancellation and exactly-once terminal telemetry paths. | ||
|
|
||
| The 100 ms budget stays internal, per RFC #7040's direction of a small fixed | ||
| internal budget determined by benchmark rather than exposed as public | ||
| configuration; telemetry can show whether a later change is justified. | ||
|
|
||
| Improve only the existing failure fallback: | ||
|
|
||
| - normalize query and document text with Unicode NFKC; | ||
| - keep ASCII alphanumeric tokens of at least three characters; | ||
| - generate Unicode code-point bigrams for Han, Hiragana, Katakana, and Hangul | ||
| runs; | ||
| - ignore isolated CJK characters; | ||
| - bound fallback query tokens while retaining tokens from both ends; | ||
| - score only the body window that can be surfaced in the prompt; | ||
| - require a title, description, or body lexical match before applying a type | ||
| boost; | ||
| - weight title and description matches above body-only matches. | ||
|
|
||
| ## Non-goals | ||
|
|
||
| - No Fast/Refined two-stage architecture. | ||
| - No public recall timing or retrieval-mode setting. | ||
| - No new tokenizer or retrieval dependency. | ||
| - No change to memory writes, scopes, extraction, DREAM, forget, or compaction. | ||
| - No removal of the shared scanner's 200-document cap. Recall-specific broad | ||
| candidate selection needs its own bounded manifest design and remains a | ||
| separate change. | ||
|
|
||
| ## Verification | ||
|
|
||
| - Recall settling inside the budget is delivered initially. | ||
| - A deadline miss leaves recall alive for later ToolResult delivery. | ||
| - Cancellation ends the bounded wait and prevents stale delivery. | ||
| - Slow recall is released by the fixed-budget timer before the initial request. | ||
| - A labeled set covers Chinese, English, Japanese, Korean, mixed text, | ||
| NFKC normalization, body-only matches, and no-result queries. | ||
| - Long CJK queries keep bounded scoring work and preserve both query ends. | ||
| - Existing active-tool noise filtering and model-selector fallback behavior | ||
| remain unchanged. | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.