feat(search): Semantic Tool Search#149
Conversation
…thon only crewAI example
When utility_tools(semantic_client=...) is used, tool_search now searches only the connectors available in the fetched tools collection instead of the full StackOne catalog. This prevents agents from discovering tools they cannot execute. - Add available_connectors param to create_semantic_tool_search - Pass connectors from Tools.utility_tools() to scope searches - Update docs, examples, and README to reflect scoping - Add 4 new tests for scoping behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hey @willleeney Thanks for suggesting above change. After removing the As we are planning further refactor I am also thinking to include the following either as pert of this PR or furhter PRS
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.
Comments suppressed due to low confidence (1)
tests/test_local_search.py:92
- The
tools_collectionfixture at line 90 is no longer used by any test in this file since theTestToolsUtilityToolsandTestToolExecutetest classes were removed. This unused fixture can be removed to keep the test file clean.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…. Brif document the search modes
There was a problem hiding this comment.
1 issue found across 9 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/conftest.py">
<violation number="1" location="tests/conftest.py:9">
P2: Module-level constant was added before imports, which violates the project's enforced import-order lint rule (E402) and can break CI.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Problem
Following up from #142
StackOne has over 10,000 actions across all connectors and growing, some connectors have 2,000+ actions alone. Keyword matching breaks
down when someone searches "onboard new hire" but the action is called
hris_create_employee. The SDK already supports keyword-basedsearch, and we need to add semantic search using the action search service.
Implementation Details
SemanticSearchClientthat calls StackOne's/actions/searchAPI for natural language tool discoverysearch_tools()search by intent, get aToolscollection ready for OpenAI, LangChain, or any frameworksearch_action_names()lightweight lookup returning action names and scores without full tool definitionsSemanticSearchClienttoutility_tools()and thetool_searchtool becomes semantic-aware insideagent loops
bamboohr_1.0.0_bamboohr_create_employee_global→bamboohr_create_employee)StackOneTool.connector,Tools.get_connectors()) for connector-aware filteringimprovement)
Summary by cubic
Adds semantic tool search so users can find and execute actions with natural language. Searches run per-connector on linked accounts, support modes (auto, semantic, local), accept optional project_ids, respect server ranking by default with optional top_k, and fall back to local BM25+TF‑IDF.
New Features
Bug Fixes
Written for commit 532ac23. Summary will update on new commits.