Skip to content

perf: bound classic BM25 candidates with Postgres FTS - #252

Merged
EricNGOntos merged 1 commit into
mainfrom
feat/wuchengke/bm25-fts-prefilter
Aug 11, 2026
Merged

EricNGOntos merged 1 commit into
mainfrom
feat/wuchengke/bm25-fts-prefilter

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • uv run pytest apps/api/tests/unit/test_bm25_channel_tsquery.py packages/shared-python/shared/tests/test_retrieval_search_channels.py -q
  • uv run pytest apps/api/tests/contract/test_bm25_fts_prefilter_contract.py -q
  • CI green on this PR
  • Spot-check classic retrieval (use_agentic=false) on a larger namespace if available

Made with Cursor

Classic path/content channels loaded the full scoped corpus into Python
before BM25. Prefetch via simple FTS (server-side OR tsquery), apply
section exclusions before the candidate LIMIT, and fall back to a full
scan when FTS matches nothing so recall does not regress. Combines the
approaches from #244 and #251; closes #195.

Co-authored-by: Ray Tien <ray.tien0907@gmail.com>
Co-authored-by: nuemaan <anonnumaan@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@EricNGOntos
EricNGOntos merged commit 46b77d9 into main Aug 11, 2026
6 checks passed
EricNGOntos added a commit that referenced this pull request Aug 11, 2026
Keep map-nav default retrieval docs; retain BM25 FTS candidate limit note.

Co-authored-by: Cursor <cursoragent@cursor.com>
@EricNGOntos
EricNGOntos deleted the feat/wuchengke/bm25-fts-prefilter branch August 11, 2026 07:34
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.

Optimize BM25 retrieval candidate loading with Postgres FTS prefilter

1 participant