semantic_search
Ranks documents by meaning similarity to a query using DashScope embeddings, then returns relevant matches with similarity scores for retrieval and ranking.
Instructions
Rank documents by meaning-similarity to a query (DashScope embeddings).
Embeds the query and all documents in one API call, then ranks by cosine similarity locally. Returns the top_k matches with scores, no vectors.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>",
"documents": "<documents>"
},
"name": "semantic_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | text-embedding-v4 | |
| query | Yes | ||
| top_k | No | ||
| documents | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |