code wiki / (root) / nx_recall_rerank.nx

nx_recall_rerank.nx

buildroot/runtime/nx_recall_rerank.nx

2392 B56 linesdepth 3pulls 4 transitivereach 2 importersview sourcekind librarytopic recall
docsdependenciesstructsconstsfunctions

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

nx_tier.nx nx_cosine_similarity.nx syscalls.nx nx_recall_rerank.nx nx_recall_bench.nx nx_recall_rerank_gate.nx

imports: nx_tier.nxnx_cosine_similarity.nxsyscalls.nx

imported by: nx_recall_bench.nxnx_recall_rerank_gate.nx

structs

none

consts

none

functions

24func rr_semantic_scores(query_emb: *nx_int, dim: nx_int, doc_embs: *nx_int, ncand: nx_int, out_cos: *nx_int) -> nx_int
called by 2: mainmain calls 1: nx_cosine_similarity
36func rr_order_by_cos(cos: *nx_int, ncand: nx_int, out_order: *i64) -> i64
called by 2: mainmain