Skip to content

feat(retrieval): word-level map-unit BM25 tokens - #380

Merged
EricNGOntos merged 1 commit into
mainfrom
feat/wuchengke/word-level-map-unit-tokens
Sep 2, 2026
Merged

feat(retrieval): word-level map-unit BM25 tokens#380
EricNGOntos merged 1 commit into
mainfrom
feat/wuchengke/word-level-map-unit-tokens

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Summary

  • Switch map-unit BM25 tokenization from character-level CJK regex to the shared jieba word-level path (text_utils), aligned with document_chunks publication.
  • Bump MAP_UNIT_INDEX_FORMAT_VERSION to 2; classic and map-nav scoring treat older indexes as incomplete.
  • Add lightweight backfill flags: --tokens-only (rebuild map-unit tokens/index only) and --skip-current-format (resume-friendly).

Production after merge/deploy

Do not run full --apply (rewrites manifests/snapshots again). Use:

python /app/scripts/backfill_map_unit_indexes.py --apply --tokens-only
# optional resume:
python /app/scripts/backfill_map_unit_indexes.py --apply --tokens-only --skip-current-format
python /app/scripts/backfill_map_unit_indexes.py --check

--check must report all namespaces READY (format_version=2).

Test plan

  • make check (ruff + pyright)
  • test_knowhere_hybrid_tokenize.py (word tokens, no single-char CJK)
  • map-unit index contract format_version=2 fixture
  • After deploy: tokens-only backfill + --check
  • Spot-check Chinese queries (e.g. disease + diagnostic criteria) no longer rely on char-level matches

Made with Cursor

Replace character-level CJK tokenization with the shared jieba path and
bump map-unit index format to v2 so query hashes match stored tokens.
Add --tokens-only/--skip-current-format for lightweight reindex after
tokenizer changes without rebuilding manifests or namespace snapshots.

Co-authored-by: Cursor <cursoragent@cursor.com>
@EricNGOntos
EricNGOntos merged commit 667d021 into main Sep 2, 2026
6 checks passed
@EricNGOntos
EricNGOntos deleted the feat/wuchengke/word-level-map-unit-tokens branch September 2, 2026 02:13
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