Skip to content

Add natural-language component rerank service#2321

Draft
Mbeaulne wants to merge 1 commit into
05-27-agent-settings-uifrom
05-27-natural-language-rerank-service
Draft

Add natural-language component rerank service#2321
Mbeaulne wants to merge 1 commit into
05-27-agent-settings-uifrom
05-27-natural-language-rerank-service

Conversation

@Mbeaulne
Copy link
Copy Markdown
Collaborator

@Mbeaulne Mbeaulne commented May 27, 2026

Tophatting

No manual tophatting required. This PR only adds the rerank service and unit tests; UI wiring comes later.

What changed

Adds the service that asks an LLM to rerank existing component search results.

Important behavior:

  • The LLM does not search the whole component library
  • The local search index finds candidates first
  • The LLM only reranks that small candidate list
  • Unknown or invented component ids are ignored
  • Scores are clamped to a safe range

Why

This makes natural-language search better without making the model responsible for retrieval.

Test plan

  • Run pnpm exec vitest run src/services/naturalLanguageComponentSearchService.test.ts
  • Run pnpm run typecheck --pretty false
  • Confirm empty queries do not call fetch
  • Confirm hallucinated ids are filtered out

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

🎩 Preview

A preview build has been created at: 05-27-natural-language-rerank-service/94b985d

Copy link
Copy Markdown
Collaborator Author

Mbeaulne commented May 27, 2026

@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from 582c2ef to 6b1d4bc Compare May 27, 2026 20:29
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch 2 times, most recently from 38b163d to bb24190 Compare May 27, 2026 23:18
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from 6b1d4bc to 0213639 Compare May 27, 2026 23:18
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch from bb24190 to 839c5d2 Compare May 28, 2026 17:25
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch 3 times, most recently from ef8749f to efd1f59 Compare May 28, 2026 18:40
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch 2 times, most recently from 496907a to 718a81a Compare May 29, 2026 14:38
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch 2 times, most recently from 169a2f7 to f392c3b Compare May 29, 2026 14:50
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch from 718a81a to a07cc76 Compare May 29, 2026 14:50
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch 2 times, most recently from cbf1263 to 926598b Compare May 29, 2026 15:27
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from 926598b to 94b985d Compare May 29, 2026 18:04
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch from 254c824 to 0417a6f Compare May 29, 2026 18:04
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