feat: add BM25 pre-search to QA workflow and remove keyword-search (#382)#385
Draft
kiyotis wants to merge 37 commits into
Draft
feat: add BM25 pre-search to QA workflow and remove keyword-search (#382)#385kiyotis wants to merge 37 commits into
kiyotis wants to merge 37 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n, add incremental test steps Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tional Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add scripts/bm25-search.sh that wraps bm25s Python library. Builds index from knowledge/*.json on first run, saves to scripts/.bm25-index/, and reloads on subsequent calls. Detects staleness by comparing index mtime to newest JSON mtime. Returns top-20 sections as JSON array with file, section_id, section_title, and score fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Insert Step 3 (BM25 pre-search) between Step 2 (ask user) and the former Step 3 (semantic search). Renumber former Steps 3-8 to Steps 4-9 and update all internal cross-references (Step 5→6 in answer generation pointer, Step 6→7 in verify pointer, Step 8→9 in output pointer). BM25 path: extract narrow terms → bm25-search.sh → read-sections.sh → generate answer → verify → if PASS skip Steps 4-8 to Step 9. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…qa.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…h.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er/verify-answer) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ntent check Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…reed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…w recorded Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Aligns parameter name with verify-answer.md's output field name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds check-answerable.md workflow that judges whether BM25 hits are
sufficient to answer the question. Updates qa.md to the agreed flow:
Step 1 hearing → Step 2 full-text-search → Step 3 check-answerable
(OK→Step5 / NG→Step4) → Step 4 semantic-search → Step 5 generate-answer
→ Step 6 verify-answer (FAIL→regenerate with {findings}) → Step 7 output.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rding Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…8 issue noted Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ge title lookup
Pass the full component page title list (libraries/handlers/adapters, 130 files)
to LLM as a translation table. LLM maps question concepts to Nablarch-specific
terms by finding related page titles and extracting their hyphenated keywords.
Example: "バリデーション" → sees libraries-bean-validation in titles
→ uses "bean-validation" as BM25 search term.
This eliminates the need for LLM to know Nablarch-specific terminology a priori.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…riment results recorded Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-search.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…p procedure clarified Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…W-TO-RUN.md reference Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…full benchmark steps Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… pending Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See steering.