Interface IRetrievalStrategy
Defines a retrieval strategy for the RAG pipeline. Implementations decide how to fetch relevant documents (pure vector, hybrid BM25+vector, etc.). This is an orchestration-layer abstraction โ it uses IVectorStore internally but is not part of the storage contract.
public interface IRetrievalStrategy
Methods
RetrieveAsync(float[], string?, int, VectorFilter?, CancellationToken)
Retrieves the most relevant documents for the given query.
Task<IReadOnlyList<VectorSearchResult>> RetrieveAsync(float[] denseVector, string? query, int topK, VectorFilter? filter = null, CancellationToken cancellationToken = default)
Parameters
denseVectorfloat[]The dense embedding vector for the query.
querystringThe text query for keyword-based retrieval. When
null, keyword search is skipped and only dense vector search is performed.topKintMaximum number of results to return.
filterVectorFilterOptional filter criteria.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<IReadOnlyList<VectorSearchResult>>
Results ordered by relevance score (descending).