Skip to content

Search score and collection - #354

Merged
CarlosLugones merged 2 commits into
developfrom
feature/348-search-score-and-collection
Dec 5, 2026
Merged

CarlosLugones merged 2 commits into
developfrom
feature/348-search-score-and-collection

Conversation

@CarlosLugones

@CarlosLugones CarlosLugones commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Ref #348, #349

Two additions to the search_items MCP 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

  • Relevance score. Every search_items result now has a score from 0 to 1. find() in apps/items/search.py annotates it as the existing rank divided 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.
  • Collection filter. search_items takes an optional collection_id and searches only that collection and every collection nested in it. An unknown collection, or someone else's, returns the usual "No collection" error.
  • The tool description, its argument schema and docs/mcp.md explain 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)

@CarlosLugones CarlosLugones self-assigned this Dec 5, 2026
@CarlosLugones
CarlosLugones merged commit ef55720 into develop Dec 5, 2026
12 checks passed
@CarlosLugones
CarlosLugones deleted the feature/348-search-score-and-collection branch December 5, 2026 23:35
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