Skip to content

refactor(metric): match caliber by scanning question for metric terms - #138

Merged
lzq986 merged 1 commit into
mainfrom
refactor/metric-caliber-matching
Sep 5, 2026
Merged

refactor(metric): match caliber by scanning question for metric terms#138
lzq986 merged 1 commit into
mainfrom
refactor/metric-caliber-matching

Conversation

@lzq986

@lzq986 lzq986 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

related #135
Replace the SQL LIKE matcher (matchByHint) with in-memory reverse matching in MetricServiceImpl#match: each metric's name/aliases are tokenized and looked up inside the user's question, case-insensitively. The model often passes the question verbatim, which the old LIKE %question% never matched. Short aliases (<2 chars) are dropped to avoid false hits; top-3 ranked by matched-term length. Tool description now invites passing the raw question. Adds unit tests.

Replace the SQL LIKE matcher (matchByHint) with in-memory reverse
matching in MetricServiceImpl#match: each metric's name/aliases are
tokenized and looked up inside the user's question, case-insensitively.
The model often passes the question verbatim, which the old
LIKE %question% never matched. Short aliases (<2 chars) are dropped to
avoid false hits; top-3 ranked by matched-term length. Tool description
now invites passing the raw question. Adds unit tests.
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Thank you for your contribution! We will review your request as soon as possible. Please review the code yourself using ponytail https://github.com/DietrichGebert/ponytail.

@lzq986
lzq986 merged commit d9e3ea3 into main Sep 5, 2026
4 checks passed
@lzq986
lzq986 deleted the refactor/metric-caliber-matching branch September 5, 2026 02:14
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