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/0213639

Copy link
Copy Markdown
Collaborator Author

Mbeaulne commented May 27, 2026

@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch 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
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