Analyze HNSW recall
analyze_hnsw_recallSweeps ef_search values to measure latency and recall trade-offs for pgvector HNSW queries against exact ground truth, returning recall@k and mean/p95 latency per setting.
Instructions
Sweeps ef_search values to measure the latency and recall trade-off curve for a given pgvector query vector against exact brute-force ground truth. Requires the vector extension. Returns a list of objects with ef_search, recall_at_k, mean_latency_ms, and p95_latency_ms — one row per ef_search value tested.
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": {
"schema": "<schema>",
"table": "<table>",
"column": "<column>",
"query_vector": "<query_vector>"
},
"name": "analyze_hnsw_recall"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| table | Yes | ||
| column | Yes | ||
| metric | No | l2 | |
| schema | Yes | ||
| database | No | Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected. | |
| query_vector | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |