memo_rerank
Reorders candidate memory hits against a query, scoring each by title and body to keep the most relevant subset for answer synthesis. Use after retrieval when you need a focused, top-ranked result set.
Instructions
Rerank candidate memory hits for a query.
Read-only. Performs no retrieval of its own (unlike memo_search) — it only reorders caller-supplied hit dictionaries, e.g. after memo_search or another retrieval source, when you need the most relevant subset ordered for answer synthesis. When reranking is disabled in this install, hits pass through in input order without scores.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hits | Yes | Candidate hit dicts (e.g. from memo_search); each is scored on its title plus snippet/body and returned with a 'rerank_score' field added. Non-dict entries are dropped. | |
| query | Yes | Query text the cross-encoder scores each hit against; empty returns the hits unchanged. | |
| top_n | No | Keep only the N best hits after reranking; None or a non-positive value returns all. | |
| body_chars | No | Character cap of each hit's snippet/body fed to the reranker. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |