fix(hindsight): frame recalled memories as external evidence - #23933
Open
EndeavorYen wants to merge 1 commit into
Open
fix(hindsight): frame recalled memories as external evidence#23933EndeavorYen wants to merge 1 commit into
EndeavorYen wants to merge 1 commit into
Conversation
EndeavorYen
marked this pull request as ready for review
May 11, 2026 18:19
Contributor
|
Thanks for the focused provenance-boundary mitigation. The reported path is still present on current Problems
Suggested changes
Automated hermes-sweeper review. |
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
Problem / Root Cause
Hindsight auto-retains full conversation transcripts. When a user discusses fiction, roleplay, documents, or code, later recall could present that content without enough provenance, making it easier for the agent to treat external content as user or agent identity.
Fix
The built-in defaults now distinguish stable user/session facts from external content discussed in past conversations, while preserving user-provided
retain_contextandrecall_prompt_preambleoverrides.This is intentionally narrower than a full content-type classifier: it adds a low-risk boundary at both retain and recall time while keeping existing Hindsight behavior and APIs intact.
Addresses #21709.
Limitations / Future Work
This PR reduces identity drift risk by adding provenance framing. It does not classify, drop, or tag fiction/document content at ingestion time; a future follow-up could add explicit content-type metadata if Hindsight exposes the right storage/retrieval hooks.
Related PRs Checked
bank_mission/bank_retain_missionto the Banks API; it does not change default retain/recall framing.sync_turncontext/document IDs; it does not address fiction/persona contamination on recall.Validation
.venv/bin/python -m pytest tests/plugins/memory/test_hindsight_provider.py -q.venv/bin/python -m py_compile plugins/memory/hindsight/__init__.pyPlatforms Tested