Skip to content

perf(memory): focus extraction memory search - #1246

Open
sentry-junior[bot] wants to merge 4 commits into
mainfrom
perf/memory-hybrid-extraction-search
Open

perf(memory): focus extraction memory search#1246
sentry-junior[bot] wants to merge 4 commits into
mainfrom
perf/memory-hybrid-extraction-search

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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.

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>
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Aug 5, 2026 4:54am

Request Review

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>
@sentry-junior sentry-junior Bot changed the title perf(memory): focus extraction hybrid pre-search perf(memory): focus extraction memory search Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Focus extraction hybrid pre-search queries

0 participants