Interface IAgentConversationStore
- Namespace
- MailFathom.Application.Agent.Conversations
- Assembly
- MailFathom.Application.dll
Where the deployment holds a person's conversations with its agent, and everything each of them was written as.
public interface IAgentConversationStore
Remarks
A conversation's contents are durable and reachable from every replica, which is what makes an answer survive the replica composing it going away, a second screen the same person opened, and a rolling upgrade. ADR 0035 is that decision, and this is the seam it is applied through for this surface.
What it holds is mail-derived and sensitive throughout. A question is somebody's own words, a block quotes their correspondence, a citation names the message it was drawn from, and a scope names what they asked about — so nothing read or written here reaches a log, a span, a metric, or a failure message. What a failure carries is which table could not be reached.
Every statement is one round trip and takes its own decision. Appending assigns the place where the row is written, so nothing outside the database decides what a conversation has reached; an entry belonging to an answer is admitted only while that answer is the one being composed, which is how a run that was stopped writes nothing further without anything having to reach the replica executing it; and answering a proposal is conditional on where that proposal stands, so two people pressing at once produce one outcome rather than two.
Nothing here carries out a proposed action. An acceptance recorded through this store is what permits one to be carried out; performing it belongs elsewhere, and what it did reaches this record only as the state the proposal ends in.
Methods
- AppendAsync(AgentConversationId, UserId, AgentConversationEntry, DateTimeOffset, CancellationToken)
Writes one entry into a conversation, giving it the next place in that conversation.
- AskAsync(AgentConversationId, UserId, AgentMessageWritten, AgentMessageId, DateTimeOffset, CancellationToken)
Writes a person's question and opens the answer to it, starting the conversation where it has not been started.
- ListAsync(UserId, int, CancellationToken)
Lists a person's conversations, the ones not archived before the archived ones.
- ReadAsync(AgentConversationId, UserId, AgentConversationHistory, long, int, CancellationToken)
Reads a conversation this person holds, from a stated point.
- SteerAsync(AgentConversationId, UserId, AgentMessageId, AgentMessageWritten, DateTimeOffset, CancellationToken)
Writes a person's further instruction into the answer being composed, which takes it from its next turn.
- StopAsync(AgentConversationId, UserId, AgentMessageId, AgentMessageWritten, DateTimeOffset, CancellationToken)
Ends the answer being composed as stopped and writes the agent's note saying so, together or not at all.
- TryDeleteAsync(AgentConversationId, UserId, CancellationToken)
Removes a conversation this person holds, and everything it held.
- TryResolveProposalAsync(AgentConversationId, UserId, long, AgentProposalState, DateTimeOffset, CancellationToken)
Records where a proposal this person was offered now stands.
- TrySetArchivedAsync(AgentConversationId, UserId, bool, CancellationToken)
Puts a conversation this person holds away, or takes it back out of the archive.
- TrySetTitleAsync(AgentConversationId, UserId, PresentationText, CancellationToken)
Names a conversation, which the agent does once it has read the first question.
- TryStartAsync(AgentConversationId, UserId, DateTimeOffset, CancellationToken)
Starts a conversation for one person, with nothing in it and no name yet.