Repository navigation
[transforms] BM25 ranked search for tool discovery: Issue #64 - #95
Open
Shreyavemana wants to merge 3 commits into
Open
Shreyavemana wants to merge 3 commits into
Shreyavemana wants to merge 3 commits into
Conversation
This branch has not been deployed
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.
Summary
Implements BM25-ranked tool discovery for large tool catalogs, building on
BaseSearchTransformfrom issue #62. This enables models to find relevant tools using natural-language queries instead of relying on exact tool names or scanning the entire catalog.Changes Made
Additions
nitrostack/transforms/search/tokenizer.py— Added a tokenizer that normalizes text, splits punctuation, snake_case and camelCase, and removes common stop words.nitrostack/transforms/search/bm25_engine.py— Added a pure-Python Okapi BM25 engine with configurable (k_1) and (b), positive IDF, weighted term frequency, and deterministic tie-breaking by tool name.nitrostack/transforms/search/bm25.py— AddedBm25SearchTransform, implementing therank(query, tools)interface and reusing the existing search infrastructure from issue [transforms] Progressive tool discovery (search_tools / call_tool) #62.tests/test_transforms_bm25.py— Added tests for tokenization, BM25 scoring, ranking, and index lifecycle.Modifications
nitrostack/transforms/search/__init__.py— ExportedBm25SearchTransform,Bm25Engine, andtokenize.Implementation Details
core/app.py.Tests Added
Closes #64.