perf(memory): focus extraction memory search - #1246
Open
sentry-junior[bot] wants to merge 4 commits into
Open
Conversation
Passive extraction pre-searched with the full user+tool transcript, which diluted embeddings and FTS. Build a short user-evidence query, keep parallel vector+lexical RRF, and tighten the lexical rank window. Co-Authored-By: David Cramer <david@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The run projection prepends prior public-thread messages as ambient context. Pre-search should only embed this turn's run-actor instructions so earlier thread text does not dilute hybrid retrieval. Co-Authored-By: David Cramer <david@sentry.io>
Pre-search now spends the query budget on this turn's run-actor instructions first, then ambient thread context. Tool dumps stay excluded. Comments document the selection rules for later augmentation. Co-Authored-By: David Cramer <david@sentry.io>
Co-Authored-By: David Cramer <david@sentry.io>
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.
Passive extraction now searches existing memories with a bounded query built from trusted user conversation evidence instead of the full user-and-tool transcript. This keeps hybrid vector + lexical retrieval focused while preserving the full transcript for the extraction model.
Search Evidence
The run actor's current instruction is searched first, followed by attributed participant instructions and ambient public-thread context. Raw tool results, assistant replies, and unattributed user text remain available to extraction but do not enter retrieval.
Future Tool Context
The query builder documents the intended extension point: if tool-heavy turns need better retrieval, use a small rewrite model such as Luna to convert successful tool output into concise factual phrases under the same character budget; never append raw tool payloads.
The existing lexical candidate cap remains unchanged because this PR does not include benchmark evidence for a global retune.
Fixes #1247
Verification: all 78 memory storage tests passed; retrieval-quality, ranking, and events tests passed; package typecheck, lint, and formatting passed. The full package run had one unchanged operational-report test exceed its 5s timeout; it passed alone in 2.5s.