
The similarity engine
For richer recommendations, use the similarity engine: a composable pipeline of signals, fusion, and rules.
var results = await Graph.Query()
.StartAt(seedUID)
.ToSimilarity(opts)
.AddSignal("by-text", s => s.StartAtSimilarTextAsync(...)) // embedding signal
.AddSignal("by-graph", s => s.StartAt(seed).Out("HasTag")) // graph traversal signal
.Fuse(f => f.UsingMeanReciprocalRank()) // combine rankings
.AddRule("filter", r => r.Filter(...)) // hard filter
.AddRule("boost", r => r.BoostByRank(...)) // soft boost
.ExecuteAsync(ct);
Signals are candidate sources. Each returns a ranked list of UIDs. You can have as many as you need.
Fusion merges the lists into one. MeanReciprocalRank (default) is robust when signals use different score scales. Use MaxScore when one signal should dominate.
Rules run after fusion:
Filter()— hard filter: only matching UIDs surviveBoostByRank()— soft boost: RRF-style contribution from a secondary signalTransformFusedScore()— arbitrary post-processing