Table of Contents

Method ReadNearestRankingAsync

Namespace
MailFathom.Application.Agent.Search
Assembly
MailFathom.Application.dll

ReadNearestRankingAsync(UserId, RegisteredEmbeddingProfile, EmbeddingVector, int, CancellationToken)

Ranks one person's conversations by how near their embedded messages sit to the query.

Task<IReadOnlyList<AgentConversationSearchHit>> ReadNearestRankingAsync(UserId user, RegisteredEmbeddingProfile profile, EmbeddingVector queryVector, int limit, CancellationToken cancellationToken)

Parameters

user UserId

Whose conversations to rank, which are the only ones read.

profile RegisteredEmbeddingProfile

The space the query was placed in, which is the only one whose vectors are read.

queryVector EmbeddingVector

Where the query sits in that space.

limit int

The greatest number of conversations to return, at least one.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<AgentConversationSearchHit>>

The conversations holding a vector in that space, nearest first and more recent first among equals, each at its nearest entry.

Remarks

A conversation with no vector in that space is absent here and present in the lexical ranking, which is what keeps one written before its messages were embedded findable.

Exceptions

ArgumentNullException

Thrown when profile or queryVector is null.

ArgumentOutOfRangeException

Thrown when limit is below one.