nx_recall_rerank.nx
buildroot/runtime/nx_recall_rerank.nx
about
nx_recall_rerank.nx -- the SOVEREIGN semantic reranker: score (query, doc) by dense
cosine over PPMI-SVD / concept embeddings (nx_cosine_similarity).
module: nishi-core.search.recall_rerank
depends: nx_tier.nx, nx_cosine_similarity.nx, syscalls.nx
capability: CORE_COMPUTE
wired_status: LIBRARY (daemon wiring = R2b; embedding source = nx_ppmi_svd / nx_semppmi_build)
genealogy_id: salton_1971_smart (vector space) + two_stage_retrieve_then_rerank
WHY (3rd-party debt-eating, good form): nx_rag_rerank PUNTS the semantic judgment to
an EXTERNAL LLM (Claude now, "Nishi-LLM the destination") -- a non-sovereign crutch.
This organ replaces that punt with a sovereign, integer-deterministic, gate-
MEASURABLE reranker: the two-stage pattern's stage 2 (retrieve+fuse in R1 -> rerank
the shortlist here by joint query-doc semantic similarity). No external dependency,
bit-exact reproducible. The fast tier of the reranker; the no-float LLM-reranker
(nx_nofloat_llm) is the latency-tolerant escalation tier (R5).
dependencies 3 imports · 2 importers
imports: nx_tier.nxnx_cosine_similarity.nxsyscalls.nx
imported by: nx_recall_bench.nxnx_recall_rerank_gate.nx
structs
| none |
consts
| none |
functions
| 24 | func rr_semantic_scores(query_emb: *nx_int, dim: nx_int, doc_embs: *nx_int, ncand: nx_int, out_cos: *nx_int) -> nx_int |
| 36 | func rr_order_by_cos(cos: *nx_int, ncand: nx_int, out_order: *i64) -> i64 |