Problem
Agents should be able to provide tags as first-class search context, but simply concatenating tags into the search query can make keyword search worse. For example, appending typescript monorepo to a precise query like TS2307 pnpm may over-constrain websearch_to_tsquery and miss otherwise relevant results that match the error/package but not every tag.
Proposed approach
Keep query and tags separate in the API/search layer, then use tag overlap as a ranking boost instead of a required match.
Desired behavior:
query remains the primary retrieval signal.
tags are optional relevance hints.
- Results with overlapping tags rank higher.
- Results without tag overlap can still appear when they match the query well.
- No hard filtering unless explicitly added as a separate future option.
Implementation notes
- Extend search inputs to accept optional tags separately from query.
- Normalize tags consistently across stored solutions and input hints.
- For keyword search, add ranking boost for tag overlap without adding tag terms to the
tsquery in a way that requires them.
- For hybrid/semantic search, preserve the query embedding behavior and apply tag overlap as a post-retrieval rerank signal.
- Update MCP
search_solutions only after backend support exists, so agents can pass tags without degrading keyword recall.
Acceptance criteria
- Searching
TS2307 pnpm with tags like typescript,monorepo does not lose strong TS2307 pnpm matches that lack one of those tags.
- Results with matching tags are ranked above similar-scoring results without matching tags.
- MCP/API docs describe tags as optional relevance hints, not strict filters.
- Tests cover keyword search with tags, tag-overlap reranking, and no-result regressions from over-constrained tag terms.
Problem
Agents should be able to provide tags as first-class search context, but simply concatenating tags into the search query can make keyword search worse. For example, appending
typescript monorepoto a precise query likeTS2307 pnpmmay over-constrainwebsearch_to_tsqueryand miss otherwise relevant results that match the error/package but not every tag.Proposed approach
Keep
queryandtagsseparate in the API/search layer, then use tag overlap as a ranking boost instead of a required match.Desired behavior:
queryremains the primary retrieval signal.tagsare optional relevance hints.Implementation notes
tsqueryin a way that requires them.search_solutionsonly after backend support exists, so agents can passtagswithout degrading keyword recall.Acceptance criteria
TS2307 pnpmwith tags liketypescript,monorepodoes not lose strongTS2307 pnpmmatches that lack one of those tags.