Passive extraction pre-searched existing memories with the full user+tool transcript. That made hybrid retrieval less accurate and more expensive: embeddings and FTS ran over tool dumps and long session text instead of durable user evidence.
Current behavior
Gap
- Extraction needs nearby existing memories for skip/supersede context.
- The retrieval query should include this turn's instructions and ambient thread context, but not raw tool dumps.
- Hybrid RRF performs well when each leg is a bounded top-k index probe, not when the query is a whole transcript or tool payload.
Impact
- Worse candidate quality for passive extraction skip/dedup decisions
- Unnecessary embedding + FTS cost on every completed session with tool output
- Pressure to optimize by dropping a hybrid leg instead of fixing the query
Prior art
Proposal
Requested design implemented in #1246:
- Keep hybrid RRF for both
searchMemories and recallMemories (no skip lexical if any vector hit).
- For extraction pre-search, query from this turn's run-actor instructions + ambient thread context (not tool dumps), capped around 1.5k chars, instructions first then leftover budget for context.
- Keep each retrieval leg bounded; tighten lexical rank candidates to a small hybrid window (hundreds, not thousands).
- Leave the full run transcript available to the extraction model; only the retrieval query is curated.
- Document selection rules in code comments so later sources (e.g. compact tool summaries / Luna rewrite) can be added deliberately.
Passive extraction pre-searched existing memories with the full user+tool transcript. That made hybrid retrieval less accurate and more expensive: embeddings and FTS ran over tool dumps and long session text instead of durable user evidence.
Current behavior
processSessionbuilt the pre-search query from every user message and tool result before extraction.contextauthority, then appends this turn's run entries (packages/junior/src/chat/plugins/task-runner.ts).searchMemoriesalready runs parallel vector + lexical legs and fuses ranks with RRF (packages/junior-memory/src/store.ts,ranking.ts).Gap
Impact
Prior art
Proposal
Requested design implemented in #1246:
searchMemoriesandrecallMemories(no skip lexical if any vector hit).