Expand description
Hybrid query — combines semantic search, graph expansion, and episode search.
Pipeline:
- Semantic phase: HNSW KNN with
limit * 2to gather candidates - Graph phase: 1-hop expansion from the top 3 candidates
- Merge by entity ID — corroborating an existing candidate or adding a new one
- Episode search (optional) — separate KNN on episodes
§Scoring
Both channels score through [super::search::score_with_utility]:
score = w_semantic * similarity + w_hotness * hotness + w_utility * utilityThe channel decides only where similarity comes from. A semantic
candidate measures it against the query vector; a graph candidate
propagates it — the parent’s similarity discounted by the edge’s
effective (decayed) confidence:
similarity_graph = similarity_parent * effective_confidenceHotness and utility are read off the neighbor itself, exactly as they are for a semantic hit. Confidence therefore still orders neighbors — a decayed edge ranks below a fresh one — without a graph candidate having to overcome a base every semantic candidate gets for free.
When an entity arrives on both channels the graph corroborates the query, and its measured relevance is raised — bounded, and proportional to how much the edge is believed:
similarity = min(1.0, similarity_semantic
* (1 + corroboration_boost * effective_confidence))The measurement stays the base: a direct reading of this entity against
this query outranks an estimate propagated from a neighbor, so
corroboration adds to it rather than replacing it. Two clamps keep it from
running away — the similarity ceiling of 1.0, and a boost default cut to
the width of the similarity band it perturbs (see
GraphScoringConfig::corroboration_boost). An entity reachable from
several expanded parents is credited once, over its strongest path: the
parents are the top hits of a single query and are not independent
witnesses. Self-edges corroborate nothing and are skipped.
Functions§
- pipeline_
entities - Get all pipeline entities for a given stage, optionally filtered by status.
- pipeline_
flow - Trace the lineage of a pipeline entity through relationship chains.
- pipeline_
stats - Get pipeline stats: counts by (stage, status), stale entities.
- query
- Run a hybrid query: semantic search + graph expansion + optional episode search.