Table of Contents

Constructor VectorStoreRetriever

Namespace
Qavren.Edge.Rag
Assembly
Qavren.Edge.Rag.dll

VectorStoreRetriever(VectorStoreCollection<TKey, TRecord>, Func<TRecord, RagSource>, Action<VectorStoreRetrieverOptions<TRecord>>?)

Creates a retriever over one MEVD collection.

[RequiresDynamicCode("MEVD reflects over TRecord to build a collection model.")]
[RequiresUnreferencedCode("MEVD reflects over TRecord to build a collection model.")]
public VectorStoreRetriever(VectorStoreCollection<TKey, TRecord> collection, Func<TRecord, RagSource> project, Action<VectorStoreRetrieverOptions<TRecord>>? configure = null)

Parameters

collection VectorStoreCollection<TKey, TRecord>

The collection to search.

project Func<TRecord, RagSource>

Maps a record to its content: Id, Text, and optionally Title, Uri and Record. It takes the record alone, and it is the same one-argument signature AddVectorStoreRetriever takes - there is exactly one projector shape in this package.

The retriever, not the projector, supplies the scoring fields. After calling project the retriever re-stamps the result with source with { Score = result.Score ?? 0d, ScoreKind = kind, Ordinal = 0 }, where kind is Relevance on the hybrid lane and Distance on the vector lane. Anything the projector set on those three init properties is overwritten. That is deliberate: the polarity is a property of the search lane the retriever chose at runtime, not of the record, and a projector cannot know which lane ran. A projector that guesses is the exact bug RetrievalScoreKind exists to prevent.

Ordinal stays 0 here and is assigned by RagPrompts.Format after ranking and clamping, because it is a position in the assembled block rather than a property of the source.

configure Action<VectorStoreRetrieverOptions<TRecord>>

Configures the retriever options.