Table of Contents

Interface IStoredEmailEmbeddingBackfillStore

Namespace
MailFathom.Application.Emails.Embeddings.Backfill
Assembly
MailFathom.Application.dll

The state the embedding backfill reads and writes as it walks the mail the live path never reached.

public interface IStoredEmailEmbeddingBackfillStore

Remarks

One contract rather than several, for the reason the extraction backfill's port is one: its operations describe a single restartable walk — where the last run stopped, how much the walk has left in front of it, which messages come next, how a message with no passages gains them, and how far this run has come. A caller holding only some of them could not make the walk terminate.

The walk is ordered by the stored-email identifier, which is the only ordering that is total, stable, and already indexed. That identifier is time-ordered, so a message stored after the walk passed a point sorts after it and the same walk reaches newly synchronized mail the bounded live backlog turned away.

Methods

CountEmailsAwaitingEmbeddingAsync(EmbeddingProfileId, CancellationToken)

Counts the messages that still have passages without a vector under the given profile.

DeriveChunksAsync(IPersistenceSession, StoredEmailId, CancellationToken)

Cuts one message's already-extracted text into passages, inside the caller's open session.

FindResumePositionAsync(CancellationToken)

Reads the position the current sweep has reached, or nothing when a sweep is about to start.

GetEmailsAwaitingEmbeddingAsync(StoredEmailId?, EmbeddingProfileId, int, CancellationToken)

Reads the next bounded batch of messages that are not current for the given profile.

SaveResumePositionAsync(IPersistenceSession, StoredEmailId?, CancellationToken)

Records how far this sweep has come, or ends the sweep so the next one starts at the beginning.