Expand description
Retrieval — lexical scoring + CALIBRATED confidence.
Ports the Python scorer (haystack = id/title/summary/aliases; exact + partial field
checks; per-term bonus + coverage; bands strong≥45 / weak≥25 / fallback). Adds the
calibration the Python version lacks: the top hit is demoted strong → ambiguous when
a runner-up scores within 0.7× of it — so a coin-flip query stops reporting strong.
Structs§
- Compound
Anchor - Compound
Omitted Anchor - Compound
Subgraph - Ground
Index - Precomputed, graph-invariant inputs to grounding — the per-node BM25F token fields and
lowercased titles. Built ONCE per graph via
GroundIndex::build; grounding many queries against one graph reuses it instead of rebuilding it every call. - Hit
- Omitted
Context Candidate - Ranker
Config - BM25F ranker parameters. INJECTED, never read from the environment: the kernel is pure, so
Defaultis the frozen calibration and any override is passed in by the caller (the dev-only parameter sweep viaeidos-eval-runner --k1/--b/--weights). This is what makes “same inputs → same scores” hold without depending on ambient process state. - Relation
Match - Subgraph
Enums§
- Confidence
- Scope
- Which nodes are candidates for grounding.
Docsexcludes code symbols (Function/Type/Trait/Module);Codekeeps only them;Sectionkeeps only sub-doc heading blocks;Subkindkeeps only nodes whose open domainsubkindmatches (e.g. “skill”, “agent”).Allis every CANONICAL unit — it deliberately EXCLUDES sections (they’re a sub-granularity that would flood the candidate set and displace skills/docs; opt in withSection).
Functions§
- apply_
floor - Adaptive confidence floor — a presentation filter, applied at the surface (MCP/CLI), NOT in the retrieval/eval path. The engine always returns the full ranked list so the eval can measure rank-2+ recall honestly; the surface uses this to drop trailing noise before showing results.
- ground
- Ground a query against the graph: ranked hits with calibrated confidence. Builds a fresh
GroundIndexeach call — convenient for one-shot use. To ground many queries against one graph, build the index once and callground_with(the eval harness and a warm server do this). - ground_
scoped - Like
ground_with, restricted to the candidates ascopeadmits (docs-only / code-only).Scope::Allis identical toground_with. Scope is a pre-filter on which nodes are scored; IDF/df stays corpus-wide (distinctiveness is a global property of the graph). - ground_
subgraph - Ground, then expand along edges (bidirectional, depth/width-bounded BFS) to surface the
connected evidence chain — the deterministic “associative reading” of AriGraph/SAGE.
limitanchors,depthhops,widthneighbours expanded per node per hop. - ground_
with - Ground using a precomputed
GroundIndex— the hot path. Byte-for-byte identical results toground; the only difference is that the graph-invariant inputs are supplied, not rebuilt.