Repository navigation
Search score and collection - #354
Merged
Merged
Conversation
This was referenced Dec 5, 2026
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.
Ref #348, #349
Two additions to the
search_itemsMCP tool, so a client that feeds search results to an agent on its own (such as a Hermes memory plugin) can drop weak matches and keep each agent's memory in its own collection.What changes
search_itemsresult now has ascorefrom 0 to 1.find()inapps/items/search.pyannotates it as the existingrankdivided by the number of longer words in the query, clamped to 0 to 1, so it means the same for any query: 1 is every word there (or a passage with all of them, or something as close in meaning), lower is a partial or loose match, 0 is only typos. Rounded to two decimals in the MCP result. The order of results does not change, in MCP or in the app.search_itemstakes an optionalcollection_idand searches only that collection and every collection nested in it. An unknown collection, or someone else's, returns the usual "No collection" error.docs/mcp.mdexplain both.Verification
Tests: the score is 1 with every word and lower with part of them (
find()and the MCP result), the collection filter includes sub-collections and leaves out other collections and the inbox, and another user's collection is not found.Relevant automated tests pass
Lint and type checks pass
User-facing behavior was verified
I have signed the Contributor License Agreement (the CLA Assistant bot asks on your first pull request)