feat(openviking): add full recall prefetch policy (salvage #48927) - #51898
Merged
kshitijk4poor merged 1 commit intoJun 24, 2026
Merged
kshitijk4poor merged 1 commit into
kshitijk4poor merged 1 commit into
Conversation
Salvage of PR NousResearch#48927 by @ehz0ah, which consolidates OpenViking recall work from NousResearch#41706 (@huangxun375-stack), NousResearch#33260, NousResearch#49975, and NousResearch#32444. Replaces stale background post-turn prefetch warming with synchronous current-query recall. The old queue_prefetch warmed the PREVIOUS user message while turn-start recall consumed the CURRENT one, so injected context was always about the wrong topic. Changes: - prefetch() now does session-aware /api/v1/search/search with the current query, falls back to /api/v1/search/find on failure - Contract-safe payloads: limit, score_threshold, context_type, session_id — no top_k, no search-body mode, no target_uri - L2 content reads for items with level=2 or empty abstracts, capped at full_read_limit (default 2) - Local ranking (score + query-token overlap + leaf boost), dedup, score threshold, and injected-char budget - queue_prefetch() is now a no-op (background warming removed) - Additive batched viking_read: uris param accepts up to 3 URIs - Per-request timeout support on _VikingClient.get/post/delete - Removes stale _prefetch_result/_prefetch_thread/_prefetch_generation state and _invalidate_prefetch_state() - Strengthened system_prompt_block guidance Salvage follow-up fixes: - Expose all 8 recall config knobs in get_config_schema() (PR NousResearch#48927 had removed them; NousResearch#41706 correctly exposed them). Env vars remain as internal mechanism but are now visible in setup wizard. - Lower default timeout 8s→4s, request_timeout 6s→3s, full_read_limit 3→2 to reduce per-turn blocking latency. Co-authored-by: Hao Zhe <haozhe4547@gmail.com> Co-authored-by: Eurekaxun <eurekaxun@163.com>
kshitijk4poor
enabled auto-merge
June 24, 2026 13:27
This was referenced Jun 24, 2026
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…viking-recall-48927 feat(openviking): add full recall prefetch policy (salvage NousResearch#48927)
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…viking-recall-48927 feat(openviking): add full recall prefetch policy (salvage NousResearch#48927)
4 tasks
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…viking-recall-48927 feat(openviking): add full recall prefetch policy (salvage NousResearch#48927)
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…viking-recall-48927 feat(openviking): add full recall prefetch policy (salvage NousResearch#48927)
This was referenced Jul 28, 2026
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…viking-recall-48927 feat(openviking): add full recall prefetch policy (salvage NousResearch#48927)
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
…viking-recall-48927 feat(openviking): add full recall prefetch policy (salvage NousResearch#48927)
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
Salvage of #48927 (consolidating OpenViking recall work from #41706, #33260, #49975, #32444). Replaces stale background post-turn prefetch warming with synchronous current-query recall — the old
queue_prefetchwarmed the PREVIOUS user message whileprefetch()consumed the CURRENT one, so injected context was always about the wrong topic.Changes
plugins/memory/openviking/__init__.py:prefetch()now does session-aware/api/v1/search/searchwith the current query, falls back to/api/v1/search/findon failure. Contract-safe payloads (limit,score_threshold,context_type,session_id) — notop_k, no search-bodymode, notarget_uri. L2 content reads for items withlevel=2or empty abstracts, capped atfull_read_limit. Local ranking, dedup, score threshold, injected-char budget.queue_prefetch()is now a no-op. Additive batchedviking_read(urisparam, up to 3). Per-request timeout on_VikingClient.get/post/delete. Removes stale_prefetch_*state. Strengthenedsystem_prompt_block.tests/openviking_plugin/test_openviking.py: 43 tests covering recall config, session-aware search, contract-safe payloads, L2 reads, budget caps, batched reads, E2E local HTTP server.tests/plugins/memory/test_openviking_provider.py: 133 tests covering session search, fallback, notop_k/mode/target_uri, L2 reads, empty-abstract fallback, no-opqueue_prefetch, bounded timeouts, full-read caps.Salvage follow-up fixes (vs original PR #48927)
get_config_schema()— PR feat(openviking): add full recall prefetch policy #48927 had removed them; Openviking recall policy #41706 correctly exposed them. Env vars remain as internal mechanism but are now visible in setup wizard.Validation
Attribution
Closes #48927, #41706, #33260, #49975, #32444