memo_rerank
Rerank candidate memory hits by relevance to a query, returning only the top matches for answer synthesis. Works with hits from any retrieval source.
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 |