Skip to content

fix(skills): match skill hub searches word by word - #6445

Merged
kovtcharov-amd merged 2 commits into
mainfrom
fix/skill-search-words
Nov 2, 2026
Merged

kovtcharov-amd merged 2 commits into
mainfrom
fix/skill-search-words

Conversation

@kovtcharov-amd

@kovtcharov-amd kovtcharov-amd commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Searching the skill hub for more than one word found nothing. "summarize documents", "meeting notes", and "email triage" all came back empty, even though published skills match each word. So the agent told users no skill existed for things it could have installed, and gaia skill search "web search", the example in the CLI docs, missed most of the matching skills. Now a skill matches when any word of the query matches, and skills that match more words come first.

Results against the 17 real hub/skills/ skills:

Query Before After
summarize 3 3 (unchanged)
summarize documents 0 3: rss-digest, summarize, transcribe-meeting (tied, catalog order)
document summary 0 2: summarize, document-brief
meeting notes 0 2: transcribe-meeting, summarize
email triage 0 3: inbox-triage, github-triage, summarize
summarization 0 0 (substring per word, no stemming)
empty 17 17, same order

Test plan

  • python -m pytest tests/unit/test_skills*.py tests/unit/test_hub_artifact_filename.py tests/unit/test_hub_semver_precedence.py: 1011 passed, 1 skipped
  • New search tests cover multi-word matching, ranking, catalog-order ties, empty and whitespace-only queries, no-match, case-insensitivity, tool names, punctuation-only, and a 5,000-word query
  • black, isort, and flake8 are clean on the changed lines
  • gaia skill search "meeting notes" lists transcribe-meeting first
  • Optional: dispatch eval_flagship.yml for gaia_skills_lifecycle. search_skill_hub now returns partial matches, so skills_misspelled_and_missing (the "pdf-forms" query) is worth a look.
🔍 Technical details
  • search_skills splits the query on whitespace and removes duplicate words. A skill's score is the number of distinct words found as case-insensitive substrings of its id, name, description, and tool names. The sort is stable, so skills with the same score stay in catalog order.
  • One- and two-letter words are ignored when the query also has a longer word. Without that rule, summarize a pdf returned all 17 skills, because "a" appears in every description; with it, the query returns 4. A query made only of short words, like pr or ai, still searches.
  • The search_skill_hub tool docstring already said "Words to match", so the prompt is unchanged. The search_skills docstring, the gaia skill search help text, and docs/reference/cli.mdx are updated to match.

Skill hub search treated the whole query as one substring, so any
multi-word query ("summarize documents", "meeting notes", "email
triage") found nothing even when every word matched a published skill.
This broke both `gaia skill search` and the agent's search_skill_hub
tool, whose docstring already promised word matching.

The query is now split into words; a skill matches if any word appears
in its id, name, description or tool names, and results are ordered by
how many distinct words matched, ties in catalog order. One- and
two-letter words are dropped when a longer word is present, since "a"
appears in every description and otherwise pulled in the whole catalog.
An empty query still lists every skill.
@github-actions github-actions Bot added documentation Documentation changes tests Test changes labels Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

Multi-word skill hub searches like "meeting notes" or "rss feed summarize" used to return nothing. Now a skill matches when any word of the query matches, and skills that match more words come first. The logic is small and correct, the tests cover it well, and a real CLI run confirms the fix. Two non-blocking notes:

  • A test comment says matching is "whole words only", but each word is still matched as a substring. "doc" finds "document", while the plural "documents" does not. Reword the comment so nobody later "fixes" behaviour that was never there.
  • This changes what the agent's search_skill_hub tool returns, so it affects LLM behaviour. The PR already names gaia_skills_lifecycle as the eval category to watch. Check it on the next RC.

Real-world evidence

The evidence stage served a five-skill catalog over real HTTP and ran the real CLI and the agent's search tool against it. Before and after, on the same hub:

before (HEAD~1): 'rss feed summarize' -> []
before (HEAD~1): 'summarize meeting email' -> []
$ gaia skill search "rss feed summarize" --hub-url http://127.0.0.1:8977
NAME                         VERSION    TIER          TOOLS  DESCRIPTION
rss-digest                   1.0.0      experimental  1      Summarize new posts from feeds
summarize                    1.0.0      experimental  0      Summarize a document, meeting transcript, or ...
[exit 0]
$ gaia skill search "summarize meeting email" --hub-url http://127.0.0.1:8977
summarize / inbox-triage / rss-digest / transcribe-meeting   [exit 0]

The agent tool search_skill_hub("rss feed summarize") returned {"status": "success", "count": 2, "results": ["rss-digest", "summarize"]}. Empty, tool-name and no-match queries, --json output, --help and gaia skill list all behaved as expected. The Agent UI screenshot is pending the strix-halo lane, which is acceptable because this PR doesn't change the UI. The evidence supports the verdict.

🔍 Technical details

🟢 Minor

  • Misleading test comment (tests/unit/test_skills_marketplace.py, test_search_with_no_matching_word_is_empty). Each query word is still a substring test against the haystack (word in text in hub.py), so "summarization" misses only because it isn't a substring of "summarize". Matching isn't limited to whole words. The PR body's table repeats the "whole words only" claim.
        assert search("summarization") == []  # substring per word, no stemming
    
  • Plurals miss singular descriptions. Per the evidence bundle, "summarize documents" doesn't return document-brief. That's acceptable for this PR's scope, but it's the next likely "agent says no skill exists" report. Consider it a follow-up if skills_misspelled_and_missing regresses.

Strengths

  • Ranking uses a stable sort, so ties keep catalog order and the results stay deterministic. The tests pin this down.
  • The short-word rule (drop 1–2 letter words only when a longer word is present) stops "a" from matching the whole catalog, while pr or ai on their own still search.
  • The docstring, CLI help, cli.mdx, and the agent tool's existing "Words to match" docstring now all describe the same behaviour.

@kovtcharov-amd kovtcharov-amd added this to the v0.25.4 milestone Nov 2, 2026
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 7b5909c Nov 2, 2026
34 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the fix/skill-search-words branch November 2, 2026 18:40
kovtcharov added a commit to kovtcharov/gaia that referenced this pull request Nov 3, 2026
Take main's word-by-word hub search (amd#6445) in place of this branch's ranking; the findability test now checks the intended skill is in the top 3, which main's search meets for all 35 queries. Read the summarize version in the stale-hub test instead of pinning 1.0.3.
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Nov 19, 2026
Hub skills were checked for format and safety, but nothing checked that
the agent could find and use them. Four of the 17 published skills had
no eval, and nothing read the live hub back after a release. Now every
one of the 28 skills in `hub/skills` is either covered by at least two
eval scenarios (17) or listed as deferred with its reason (11, mostly
ones that need audio, a calendar, a desktop pane or a file-opening
rubric), and adding a skill without making that choice fails a test. A
test checks plain requests find each hub skill through hub search (two
queries per skill, all in the top 3, on top of amd#6445's word-by-word
search), and each skills release installs every skill back from the hub
to check its version and signature.

The new evals also caught three real problems, fixed here:
- **Compact models (Gemma-4-E4B) still had three email tools.** Asked to
triage mail, Gemma read the mailbox and told the user it was empty. Main
now withholds them too; this PR adds a test that keeps the list in step
with the email mixin.
- **The hub install scenarios couldn't pass.** The flagship bundles
every `hub/skills` skill, so "install rss-digest" never needed an
install. They now use fixture-only skills, cleared before each attempt
so run order can't cause false failures, which explains the old
baseline's failures there.
- **On compact models, `list_skills` now says installing skills needs a
larger model.**

Still open: Gemma doesn't relay that limit. It ignores the hint and,
with no email tools, presents GitHub notifications as the inbox. Two
compact-tier scenarios record this. Fixing it needs prompt work measured
across Gemma's full eval.

Related: amd#5423 (suggest unloaded skills) is the kind of change
the new `gaia_skills_selection` category measures.

Checks only run when skill files change: unit guards ride
`test_unit.yml`'s existing filter, the scenario coverage check runs in
`test_eval.yml`, the skill audit lists the changed skill's scenarios,
and the hub check runs after a real publish. Nothing new runs on
unrelated PRs.

## Test plan
- [x] `pytest tests/unit/eval/ tests/unit/test_skill_tier_matrix.py
tests/unit/test_skill_hub_findability.py
tests/unit/test_verify_published_skills.py
tests/unit/agents/test_model_features.py` plus the existing skill suites
— 2,640 passed after merging main. Three runner tests fail only while
another eval holds the machine-wide eval lock and pass alone.
- [x] `python util/verify_published_skills.py` against the production
hub: 17/17 install, AMD-signed, at the repo's versions
- [x] Local agent eval (Strix Halo, judge claude-sonnet-4-6). On
Qwen3.6, every new or changed scenario passes after re-running one-off
failures. On Gemma, 1 of 3 compact-tier scenarios passes. Details are in
`docs/plans/skills-hub-validation.md`.
- [x] `python util/lint.py --all`: clean apart from the two Windows-only
Pylint errors already on main
- [ ] Next RC eval: watch `gaia_skills_tasks`, `gaia_skills_selection`
(new), `gaia_skills_lifecycle`, `gaia_email`; re-capture the
skill-category baselines from that sweep

<details>
<summary>🔍 Technical details</summary>

- Hub search itself is main's (amd#6445); this PR only adds
`tests/unit/test_skill_hub_findability.py` over the real catalogue.
- New runner tags `requires_sd`, `requires_music`, `requires_full_tier`,
`requires_compact_tier` → `SKIPPED_NO_MODEL` with the reason.
- `util/skill_eval_scenarios.py` maps skills → scenarios (shared by the
coverage test and `skill_audit.yml`); `util/run_eval_lane.py --scenario`
runs a subset locally.
- `tests/unit/test_skill_tier_matrix.py` pins that compact cannot run
`calendar`, `data-explore`, `image-gen`, `inbox-triage`, `send-email`.
</details>

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant