search_pairs
Search correction-text embeddings to find similar pairs. Returns top-K results with previews and cosine scores.
Instructions
Cosine-search the substrate's correction-text embeddings.
Returns the top-K most-similar pairs to `query`, each as a dict
with pair_idx, session_id, premise_preview (≤200 chars),
correction_preview (≤200 chars), and cosine score in [-1, 1].
Requires `features.npz` (built by `weighted-compact bootstrap`)
and the [baselines] extra (sentence-transformers). On the first
call the e5-multilingual-small model is loaded into memory and
cached for subsequent calls.
On missing substrate or import error returns a single dict with
an `error` key rather than raising — the stdio loop must not die
on a misconfigured client.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| top_k | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |