Skip to content

feat(skills): query rewriting before skill retrieval (AutoSkill A3) #4449

@bug-ops

Description

@bug-ops

Description

Before embedding the user's query for skill matching, apply a lightweight LLM rewrite step (fast provider, e.g. qwen3:8b) that converts the raw query into a retrieval-friendly form: removes filler words, normalizes intent into a canonical capability description.

Implemented as an optional pass in SkillMatcher::match_skills controlled by a config flag skills.query_rewrite_provider. When empty/unset, falls back to current behavior (no rewrite).

Motivation

Raw user queries are often too literal or verbose for optimal cosine similarity against skill descriptions. AutoSkill demonstrates improved retrieval accuracy with a rewrite step. Since this is on the hot path (per request), it must be fast and optional.

Acceptance Criteria

  • skills.query_rewrite_provider config field (optional, accepts provider name from [[llm.providers]])
  • When configured, applies rewrite before embedding in SkillMatcher
  • Rewrite prompt is minimal (1 sentence instruction, fast-provider optimized)
  • Latency impact documented in PR description (before/after measurement)
  • Feature disabled by default

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4Long-term / exploratoryenhancementNew feature or requestskillszeph-skills crate

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions