Repository navigation
improvement(mothership): rank integration discovery by bm25 and connected services - #9262
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
2 issues found across 2 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/lib/mothership/integrations/application/catalog.ts">
<violation number="1" location="apps/sim/lib/mothership/integrations/application/catalog.ts:72">
P2: `singular` does not fold `-es` plurals, so `addresses`, `searches`, `branches` and `fixes` stay as `addresse`, `searche`, `branche` and `fixe` and miss their singular forms. Strip `es` after sibilant and `x`/`us` endings before the generic `s` rule.</violation>
<violation number="2" location="apps/sim/lib/mothership/integrations/application/catalog.ts:296">
P2: A failure in the credential lookup now fails the entire catalog call, even though its result only reorders results. Catch the error and fall back to no connected-service boost.</violation>
</file>
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryIntegration discovery now ranks matches with BM25 and boosts services the requester has connected.
Reviews (7) · Last reviewed commit: "improvement(mothership): rank integratio..." · Reviewed by Greptile |
|
@greptile |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@greptile |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@greptile |
|
@greptile |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@greptile |
…cted services Free-text integration discovery now ranks with Okapi BM25 over each operation's name, service, description and parameter names, instead of substring hits. Tokens drop stop words before and after folding plurals (-ies, -es with warehouses keeping their e, -s), so natural-language intents like "send an email to a customer" match on content words. Operations of services the requester can already authenticate have their score multiplied by 1.5. Connected providers come from the authorized target workspace (accessible plus enrolled managed OAuth credentials) or, without a workspace, the requester's own org-managed credentials. The lookup only hints ranking: it never adds or reveals an operation, and a failure is logged and discovery proceeds unboosted. Sort order: exact operation ID, then boosted BM25 score, then preferred (tagged MCP) service, then name. The connected providers join the existing preferredServices tie-break in one CatalogProjectionOptions object. A service filter now counts as targeted discovery and returns input schemas.
2492518 to
247e3cf
Compare
|
@greptile |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
integrations list --query <intent>,search_integration_tools), but the old scorer had no term rarity and counted stop words and single letters. "send an email to a customer" matched 6,027 of ~6,000 operations, withgmail_sendaround rank 546._/-), service, description and parameter names, with stop words, one-character terms and plurals folded. An exact toolId still ranks first, and filters,limit,totalandtruncatedare unchanged. A stop-word-only query matches nothing.servicefilter now returns input schemas like a query does, saving the agent a round trip.On the real registry: "send email" →
gmail_send#6 (#1 with Gmail connected); "post a message to a slack channel" →slack_message#3; "list my calendar events for today" →google_calendar_list_v2#3; "update a row in a google sheet" →google_sheets_update_v2#3.Type of Change
Testing
catalog.test.ts, on a 40-op fixture of real registry ops (11 email-sending services):tsc --noEmitis clean. CI runs the rest.Checklist