Table of Contents

Method SearchAsync<TKey, TRecord>

Namespace
Oscova.Agents.Vector
Assembly
Oscova.Agents.dll

SearchAsync<TKey, TRecord>(string, Embedding<float>, int, VectorSearchOptions<TRecord>?, VectorStoreCollectionDefinition?)

Searches a vector collection for records nearest to an embedding.

public Task<IReadOnlyList<VectorSearchResult<TRecord>>> SearchAsync<TKey, TRecord>(string collectionName, Embedding<float> embedding, int topK, VectorSearchOptions<TRecord>? options = null, VectorStoreCollectionDefinition? definition = null) where TKey : notnull where TRecord : class

Parameters

collectionName string

The collection name to search.

embedding Embedding<float>

The query embedding.

topK int

The maximum number of nearest results to return.

options VectorSearchOptions<TRecord>?

Optional vector search options.

definition VectorStoreCollectionDefinition?

An optional collection definition used when opening the collection.

Returns

Task<IReadOnlyList<VectorSearchResult<TRecord>>>

The nearest vector search results as a materialized list.

Type Parameters

TKey

The record key type.

TRecord

The vector record type.