Skip to content

Commit 9c9e48c

Browse files
Update doc strings
1 parent 45745e8 commit 9c9e48c

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

stackone_ai/semantic_search.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@
1212
This is the primary method used when integrating with OpenAI, LangChain, or CrewAI.
1313
The internal flow is:
1414
15-
1. Fetch tools from linked accounts via MCP to discover available connectors
15+
1. Fetch tools from linked accounts via MCP (provides connectors and tool schemas)
1616
2. Search EACH connector in parallel via the semantic search API (/actions/search)
17-
3. The search API returns results with full ``input_schema`` for each action
18-
4. Build executable tools directly from search results (no match-back needed)
19-
5. Deduplicate by action_id, sort by relevance score, apply top_k
20-
6. Return Tools sorted by relevance score
17+
3. Match search results to MCP tool definitions
18+
4. Deduplicate, sort by relevance score, apply top_k
19+
5. Return Tools sorted by relevance score
2120
2221
Key point: only the user's own connectors are searched — no wasted results
23-
from connectors the user doesn't have. The search API returns ``input_schema``
24-
with each result, so tools can be built directly without a separate fetch.
22+
from connectors the user doesn't have. Tool schemas come from MCP (source
23+
of truth), while the search API provides relevance ranking.
2524
2625
If the semantic API is unavailable, the SDK falls back to a local
2726
BM25 + TF-IDF hybrid search over the fetched tools (unless
@@ -31,10 +30,9 @@
3130
2. ``search_action_names(query)`` — Lightweight discovery
3231
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3332
34-
Queries the semantic API directly and returns action metadata
35-
(action_id, connector, score, description, input_schema) **without**
36-
building full tool objects. Useful for previewing results before
37-
committing to a full fetch.
33+
Queries the semantic API directly and returns action IDs with
34+
similarity scores, **without** building full tool objects. Useful
35+
for previewing results before committing to a full fetch.
3836
3937
When ``account_ids`` are provided, each connector is searched in
4038
parallel (same as ``search_tools``). Without ``account_ids``, results

0 commit comments

Comments
 (0)