Skip to content

feat: MaxEvidenceTokens and fixed-budget candidate pools - #104

Merged
cursor[bot] merged 1 commit into
devfrom
pr/retrieval-v4-budgets-a6c7
Aug 13, 2026
Merged

feat: MaxEvidenceTokens and fixed-budget candidate pools#104
cursor[bot] merged 1 commit into
devfrom
pr/retrieval-v4-budgets-a6c7

Conversation

@sdntsng

@sdntsng sdntsng commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Wave D: LME subjects have ~240 extracts and untyped conversation_episode rows currently get +0.1 episode_boost, which promotes assistant congratulations/listicles over typed facts (gold “4 weeks” vs rank-1 “3 weeks”). MaxEvidenceTokens on /recall was dead.

This is PR4 (retrieval V4 at fixed context tokens). Kill-list compliant: no unbounded top-k; default overfetch cap stays 200.

Changes

  • Wire MaxEvidenceTokens as the evidence assembly budget when set (else BudgetTokens / 4000).
  • SearchOptions.CandidateLimit + RecallRequest.CandidateLimit; CandidatePoolSize qualifies 30/50/100/200 and caps at 200.
  • Replace episode +0.1 boost with -0.15 penalty so typed facts outrank congratulation episodes.
  • Tests: token truncation, candidate matrix, episode vs “4 weeks” fact, trace records pool size.

Test plan

  • go test ./internal/memory/
  • OpMem 13/13 + marketing after merge
  • Do not treat this as a LoCoMo/LME quality lift until a dedicated pin on this binary

Linear / tracking

Wave D after #100. Independent of PR5 (#102) and PR3 (#103) on dev.

Risk / follow-ups

  • Dated episodes still win date queries via date_token_boost / exact span (existing tests).
  • Live 4-way LoCoMo candidate matrix is a follow-up pin, not this PR.
  • No SOTA claim. dev only; do not merge to main.
Open in Web Open in Cursor 

Explicit candidate_limit qualifies 30/50/100/200 without inflating
default top-k. Keep CandidateOverfetch cap at 200. Downrank untyped
episodes so assistant boilerplate does not outrank typed facts.

Co-authored-by: Siddhant Singh <sdntsng@users.noreply.github.com>
@sdntsng
sdntsng marked this pull request as ready for review August 13, 2026 12:48
@cursor
cursor Bot merged commit 411ab4f into dev Aug 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant