Skip to content

feat(openviking): add full recall prefetch policy (salvage #48927) - #51898

Merged
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:salvage/openviking-recall-48927
Jun 24, 2026
Merged

kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:salvage/openviking-recall-48927

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Contributor

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_prefetch warmed the PREVIOUS user message while prefetch() 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/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. Local ranking, dedup, score threshold, injected-char budget. queue_prefetch() is now a no-op. Additive batched viking_read (uris param, up to 3). Per-request timeout on _VikingClient.get/post/delete. Removes stale _prefetch_* state. Strengthened system_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, no top_k/mode/target_uri, L2 reads, empty-abstract fallback, no-op queue_prefetch, bounded timeouts, full-read caps.

Salvage follow-up fixes (vs original PR #48927)

  1. Exposed all 8 recall config knobs in 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.
  2. Lowered default timeout 8s→4s, request_timeout 6s→3s, full_read_limit 3→2 — reduces per-turn blocking latency (synchronous prefetch runs on the hot path before every LLM call).

Validation

Test suite Before After
tests/openviking_plugin/test_openviking.py 43 passed
tests/plugins/memory/test_openviking_provider.py 133 passed
tests/agent/test_memory_*.py (regression) 122 passed
E2E (isolated HERMES_HOME, real imports) 6/6 passed

Attribution

Closes #48927, #41706, #33260, #49975, #32444

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
kshitijk4poor enabled auto-merge June 24, 2026 13:27
@kshitijk4poor
kshitijk4poor merged commit 4f521a5 into NousResearch:main Jun 24, 2026
27 checks passed
@alt-glitch alt-glitch added type/feature New feature or request comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers P3 Low — cosmetic, nice to have labels 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)
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)
@kshitijk4poor
kshitijk4poor deleted the salvage/openviking-recall-48927 branch August 5, 2026 07:09
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/memory Memory tool and memory providers type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants