feat(hindsight): memory provider improvements — recall_sync, retain_source, setup templates, memory indicators, error hints - #85494
Merged
kshitijk4poor merged 2 commits intoAug 13, 2026
Conversation
…ource, setup templates, memory indicators, error hints Bundles previously-separate Hindsight/memory PRs into a single review surface: - opt-in synchronous recall (recall_sync) — recall the injected memory in-turn instead of next-turn prefetch (NousResearch#5820) - actionable error when local_embedded runtime is missing — tells the user which package to install (NousResearch#7718) - default retain_source to 'hermes' so every stored memory self-identifies its provenance - offer a starter memory template during hermes memory setup, plus warn before overwriting an already-configured bank - warn when a configured memory provider reports unavailable (NousResearch#2765) - deterministic 'recalled N memories' recall indicator — Hermes itself emits a status line when auto-recall injects memory - 'saving to memory' retain indicator — emitted the moment a turn is dispatched to the writer Authored by @benfrank241 (ben.bartholomew@vectorize.io). Salvaged from PR NousResearch#74379.
…74379 1. Use open_credentialed_url() instead of bare urlopen() in templates.py apply_template() and probe_existing_customization(). Both send Authorization: Bearer headers; bare urlopen forwards credentials on cross-origin redirects. The codebase has open_credentialed_url() in hermes_cli/urllib_security.py that strips credentials on cross-origin redirects — used by 4 other modules. 2. Guard unavailable_reason() with the dedup set check before calling it. The gateway builds a fresh AIAgent per message, so without this guard unavailable_reason() (which calls _load_config() → stat + file read + JSON parse, and _check_local_runtime() → importlib probes) runs on every gateway turn for an unavailable provider, even though the warning is deduped after the first. 3. Move INDICATOR_GLYPH from Hindsight's eye emoji to a generic brain (🧠) in core (agent/memory_provider.py). Hindsight overrides with its own _HINDSIGHT_GLYPH (👁️) in recall_status() and _emit_saving_indicator(). Other memory providers no longer inherit Hindsight's brand mark as the default glyph.
This was referenced Aug 13, 2026
woshicby
added a commit
to woshicby/hermes-agent
that referenced
this pull request
Aug 17, 2026
…redentials When HINDSIGHT_API_URL/key are absent (the systemd/gateway case where ~/.hermes/.env is not inherited), is_available() returns False and agent_init warns — but unavailable_reason() returned empty for cloud mode, so the user saw a bare warning with no idea which variables to configure. Name the missing credentials and point at config/gateway service env. Fixes the remaining gap in NousResearch#2765 (local mode hints landed via NousResearch#85494).
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
Salvages PR #74379 (@benfrank241) with security and efficiency fixes applied on top.
Hindsight memory provider improvements: opt-in synchronous recall (recall_sync), actionable error hints for missing local runtime, opt-in retain_source attribution, starter memory templates during setup, provider-unavailable warning, and deterministic "recalled N memories" / "saving to memory" status indicators.
Fixes #5820, #7718, #2765. Supersedes #70278, #70295, #72926, #73415, #70257, #46504, #5838, #13101.
Changes
plugins/memory/hindsight/__init__.py: recall_sync, retain_source default, indicators, local runtime hint, unavailable_reason(), recall_status()plugins/memory/hindsight/templates.py(new): starter bank template catalog fetch + apply + overwrite warningagent/memory_provider.py: RecallStatus dataclass, unavailable_reason() and recall_status() ABC hooks, generic INDICATOR_GLYPHagent/memory_manager.py: describe_recall() aggregatoragent/turn_context.py: recall indicator emit after prefetchagent/agent_init.py: provider-unavailable warning with dedup guardhermes_cli/memory_setup.py: systemd/.env inheritance hintFixes applied on top of @benfrank241's work
templates.pyapply_template() and probe_existing_customization() now useopen_credentialed_url()instead of bareurlopen()— prevents credential leak via cross-origin redirect.agent_init.pyguardsunavailable_reason()with the dedup set check before calling it — was running disk I/O + importlib probes on every gateway turn despite the warning being deduped.INDICATOR_GLYPHin core is now a generic brain (🧠) instead of Hindsight's brand mark. Hindsight overrides with its own_HINDSIGHT_GLYPH(👁️).Validation
Contributor: @benfrank241 (ben.bartholomew@vectorize.io) — authorship preserved via commit 1.