Table of Contents

Interface IEmbeddingGenerationStore

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

The profile rows a generation's life is written into, and every transition between them.

public interface IEmbeddingGenerationStore

Remarks

One contract rather than several, because these operations are one state machine: registering a generation, making it the one retrieval reads, abandoning one that never got there, and clearing out what a replaced one left. A caller holding only some of them could move a generation into a state nothing would take it out of.

It overlaps IActiveEmbeddingProfileReader deliberately and narrowly. That port answers the one question the read path asks — which generation serves a search — and it is the only thing retrieval and the live embedding worker are allowed to know about profiles. This one is the write side of the same table, and reading both generations is part of deciding a transition rather than a second way to ask what is active.

Methods

AbandonAsync(IPersistenceSession, EmbeddingProfileId, CancellationToken)

Abandons a generation that was being built, leaving whichever one is serving where it is.

FindSupersededProfileHoldingVectorsAsync(CancellationToken)

Finds a superseded generation that still holds vectors, if one does.

ReadGenerationsAsync(CancellationToken)

Reads which generation serves retrieval and which one, if any, is being built.

RegisterBuildingAsync(IPersistenceSession, EmbeddingProfileIdentity, CancellationToken)

Registers a generation to embed into, or resolves the one this geometry already has.

RemoveVectorsAsync(IPersistenceSession, EmbeddingProfileId, int, CancellationToken)

Removes a bounded batch of one superseded generation's vectors.

SwitchToAsync(IPersistenceSession, EmbeddingProfileId, CancellationToken)

Makes a built generation the one retrieval reads, and supersedes whichever one it replaces.