Table of Contents

Method AddVectorStoreRetriever

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

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

builder EdgeBuilder

The Qavren.Edge builder.

collectionName string

The MEVD collection to retrieve from.

project Func<TRecord, RagSource>

The one projector shape in this package: Func<TRecord, RagSource>, the same signature VectorStoreRetriever<TKey, TRecord>'s constructor takes.

configure Action<VectorStoreRetrieverOptions<TRecord>>

Configures the retriever.

options Action<RagOptions>

Configures RagOptions.

storeName string

Null resolves the unkeyed MEVD.VectorStore; a name resolves the keyed one. The parameter exists because sub-project 2 registers both - AddVectorStore() uses AddSingleton<VectorStore> and AddVectorStore(name, ...) uses AddKeyedSingleton<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

TKey

The collection's key type.

TRecord

The collection's record type.