similarity_search
Retrieve the k nearest neighbors for a query embedding, with optional metadata filters for precise, injection-safe search.
Instructions
Find the k nearest neighbors to a query embedding.
`filters` is a structured allowlist (column/op/value) — not raw SQL — so
metadata filtering stays injection-safe.
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": {
"table": "<table>",
"embedding_column": "<embedding_column>",
"query_embedding": "<query_embedding>"
},
"name": "similarity_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| table | Yes | ||
| metric | No | cosine | |
| schema | No | public | |
| filters | No | ||
| return_columns | No | ||
| query_embedding | Yes | ||
| embedding_column | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |