Version: 0.0.4
agrag.ingestion.resolve.candidate_source.persisted_candidate_indices
persisted_candidate_indices(mentions:list[ExtractedEntity], entities:list[Entity], *, source:GraphCandidateSource, fallback_limit:int = 128) -> tuple[dict[int, list[int]], dict[tuple[int, int], float]]
Return ANN candidate indices, with a bounded exhaustive fallback.
The fallback only applies when no indexed candidates are available. It keeps first-time and small-graph consolidation deterministic without returning to an unbounded pairwise scan for established graphs.
Returns:
dict[int, list[int]]– Mention index to its candidate entity indices, plus each compareddict[tuple[int, int], float]– pair's real embedding cosine similarity keyed by(min, max)tuple[dict[int, list[int]], dict[tuple[int, int], float]]– index order (matching howResolver.resolvebuilds its own pairtuple[dict[int, list[int]], dict[tuple[int, int], float]]– keys). The exhaustive-fallback branch reports no scores, so itstuple[dict[int, list[int]], dict[tuple[int, int], float]]– similarity map is empty.