Method AddVectorStoreRetriever
AddVectorStoreRetriever<TKey, TRecord>(EdgeBuilder, string, Func<TRecord, RagSource>, Action<VectorStoreRetrieverOptions<TRecord>>?, Action<RagOptions>?, string?)
Calls AddEdgeRag(EdgeBuilder, Action<RagOptions>?), resolves MEVD's abstract VectorStore from DI and takes
GetCollection<TKey, TRecord>(collectionName).
[RequiresDynamicCode("MEVD reflects over TRecord to build a collection model.")]
[RequiresUnreferencedCode("MEVD reflects over TRecord to build a collection model.")]
public static EdgeBuilder AddVectorStoreRetriever<TKey, TRecord>(this EdgeBuilder builder, string collectionName, Func<TRecord, RagSource> project, Action<VectorStoreRetrieverOptions<TRecord>>? configure = null, Action<RagOptions>? options = null, string? storeName = null) where TKey : notnull where TRecord : class
Parameters
builderEdgeBuilderThe Qavren.Edge builder.
collectionNamestringThe MEVD collection to retrieve from.
projectFunc<TRecord, RagSource>The one projector shape in this package:
Func<TRecord, RagSource>, the same signature VectorStoreRetriever<TKey, TRecord>'s constructor takes.configureAction<VectorStoreRetrieverOptions<TRecord>>Configures the retriever.
optionsAction<RagOptions>Configures RagOptions.
storeNamestringNull resolves the unkeyed
MEVD.VectorStore; a name resolves the keyed one. The parameter exists because sub-project 2 registers both -AddVectorStore()usesAddSingleton<VectorStore>andAddVectorStore(name, ...)usesAddKeyedSingleton<VectorStore>. Resolution is lazy: a name with no such keyed registration fails when the retriever is first resolved, naming the key, not at registration time - because pretending otherwise would mis-describe when the app breaks.
Returns
- EdgeBuilder
The builder, for chaining.
Type Parameters
TKeyThe collection's key type.
TRecordThe collection's record type.