enhance: increase default search results from 5 to 50 - #17
Merged
Conversation
Improve user experience by providing more comprehensive search results by default. The MCP find_knowledge tool now returns up to 50 relevant chunks instead of only 5, giving users better coverage of available knowledge without requiring manual parameter adjustment. This change better serves the exploratory search use case where users want to see a broader set of potentially relevant content before selecting specific chunks for detailed review. Updated both the implementation and API documentation to reflect the new default behavior while maintaining backward compatibility for clients that explicitly specify topK values.
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
This PR enhances the user experience of the MCP search functionality by increasing the default number of search results from 5 to 50. This change provides users with more comprehensive search coverage without requiring manual parameter adjustment.
Key Changes
topKdefault parameter from 5 to 50Rationale
The previous default of 5 results was too restrictive for effective exploratory search. Users often need to see a broader range of potentially
relevant content before selecting specific chunks for detailed review. The new default of 50 results:
Technical Details
Testing Instructions
/swagger-ui.htmland test the search endpointFiles Modified
SearchController.java- Updated default topK parameterDocsSearchController.java- Updated Swagger documentation and parameter descriptionsRelated Features