ontocast.tool.vector_store.diagnostics¶
Per-ontology retrieval rank diagnostics.
Answers "why did ontology X contribute nothing to the snapshot?" with numbers rather
than inference. For each ontology reached by any channel, records where its best atom
ranked in the dense core lane, the dense neighborhood lane, the sparse BM25 lane, and
in the fused order -- then whether it survived the max_atoms cut.
Reading the table:
- ontology absent entirely -> it was never indexed, or its atoms never entered any
channel's
top_k; the problem is upstream of ranking. - present with
bm25_rankunset but a usablecore_rank-> the sparse lane has no lexical surface to match; look at what text is indexed for it. - present in every channel but
fused_rankbeyondcutoff_rank-> it is losing the global race on score, not missing from the index. fused_rankjust pastcutoff_rank-> a budget/allocation question.
Collection is opt-in (ONTOLOGY_PATCH_DUMP_ONTOLOGY_RANKS) because it walks every
channel hit list for every query.
build_ontology_rank_diagnostics(hits_by_query, ranked_atoms, selected_atoms)
¶
Summarize per-ontology ranking outcomes for one ensemble retrieval.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hits_by_query
|
list[OntologySearchHitsByChannel]
|
Raw per-query, per-channel hits, each channel already ordered best-first by that channel's own score. |
required |
ranked_atoms
|
list[GraphAtom]
|
Fused atoms in final order, before the |
required |
selected_atoms
|
list[GraphAtom]
|
Atoms that survived the cut and became subgraph seeds. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: ``{"cutoff_rank": int, "ranked_total": int, |
dict[str, Any]
|
"ontologies": {iri: {...}}}``. Ranks are 1-based; a channel the ontology never |
dict[str, Any]
|
appeared in is omitted from its entry rather than reported as zero. |