Skip to main content

ConversationStore

Trait ConversationStore 

Source
pub trait ConversationStore: Send + Sync {
    // Required methods
    fn create(
        &self,
        conversation_id: ConversationId,
        namespace: MemoryNamespace,
    ) -> ConversationStoreFuture<'_, Result<ConversationCreateOutcome, ConversationStoreError>>;
    fn load_view(
        &self,
        conversation_id: ConversationId,
        namespace: MemoryNamespace,
        window: ConversationWindow,
        summary_batch: ConversationSummaryBatch,
    ) -> ConversationStoreFuture<'_, Result<ConversationView, ConversationStoreError>>;
    fn list_transcript(
        &self,
        conversation_id: ConversationId,
        namespace: MemoryNamespace,
        after: Option<ConversationSequence>,
        limit: ConversationWindow,
    ) -> ConversationStoreFuture<'_, Result<Vec<ConversationTranscriptEntry>, ConversationStoreError>>;
    fn append(
        &self,
        namespace: MemoryNamespace,
        command: ConversationAppend,
    ) -> ConversationStoreFuture<'_, Result<ConversationVersion, ConversationStoreError>>;
    fn commit_summary(
        &self,
        namespace: MemoryNamespace,
        command: ConversationSummaryCommit,
    ) -> ConversationStoreFuture<'_, Result<ConversationSummary, ConversationStoreError>>;
    fn upsert_memory(
        &self,
        command: SemanticMemoryUpsert,
    ) -> ConversationStoreFuture<'_, Result<SemanticMemory, ConversationStoreError>>;
    fn search_memory(
        &self,
        query: SemanticMemoryQuery,
    ) -> ConversationStoreFuture<'_, Result<Vec<SemanticMemory>, ConversationStoreError>>;

    // Provided methods
    fn upsert_memory_scoped(
        &self,
        command: SemanticMemoryUpsert,
        context: RetrievalContext,
    ) -> ConversationStoreFuture<'_, Result<SemanticMemoryUpsertOutcome, ConversationStoreError>> { ... }
    fn search_memory_scoped(
        &self,
        query: SemanticMemoryQuery,
        context: RetrievalContext,
    ) -> ConversationStoreFuture<'_, Result<SemanticMemorySearchOutcome, ConversationStoreError>> { ... }
}
Expand description

Persistence boundary for conversation transcript, summaries, and semantic memory.

Execution-journal events deliberately do not appear in this trait. They remain owned by runifold_core::Journal.

Required Methods§

Source

fn create( &self, conversation_id: ConversationId, namespace: MemoryNamespace, ) -> ConversationStoreFuture<'_, Result<ConversationCreateOutcome, ConversationStoreError>>

Idempotently creates one empty conversation.

Source

fn load_view( &self, conversation_id: ConversationId, namespace: MemoryNamespace, window: ConversationWindow, summary_batch: ConversationSummaryBatch, ) -> ConversationStoreFuture<'_, Result<ConversationView, ConversationStoreError>>

Loads a bounded view without deleting or rewriting transcript entries.

Source

fn list_transcript( &self, conversation_id: ConversationId, namespace: MemoryNamespace, after: Option<ConversationSequence>, limit: ConversationWindow, ) -> ConversationStoreFuture<'_, Result<Vec<ConversationTranscriptEntry>, ConversationStoreError>>

Lists immutable transcript entries strictly after an optional sequence.

Source

fn append( &self, namespace: MemoryNamespace, command: ConversationAppend, ) -> ConversationStoreFuture<'_, Result<ConversationVersion, ConversationStoreError>>

Atomically appends canonical messages under the expected version.

Source

fn commit_summary( &self, namespace: MemoryNamespace, command: ConversationSummaryCommit, ) -> ConversationStoreFuture<'_, Result<ConversationSummary, ConversationStoreError>>

Monotonically replaces the lossy summary under the expected transcript version.

Source

fn upsert_memory( &self, command: SemanticMemoryUpsert, ) -> ConversationStoreFuture<'_, Result<SemanticMemory, ConversationStoreError>>

Creates or compare-and-swaps one explicitly curated semantic memory.

Source

fn search_memory( &self, query: SemanticMemoryQuery, ) -> ConversationStoreFuture<'_, Result<Vec<SemanticMemory>, ConversationStoreError>>

Searches semantic memory without reading transcript or journal storage.

Provided Methods§

Source

fn upsert_memory_scoped( &self, command: SemanticMemoryUpsert, context: RetrievalContext, ) -> ConversationStoreFuture<'_, Result<SemanticMemoryUpsertOutcome, ConversationStoreError>>

Writes memory under an explicit cancellation/deadline scope.

Stores with embedding support should override this method and report provider and storage usage. The default preserves lexical-store behavior.

Source

fn search_memory_scoped( &self, query: SemanticMemoryQuery, context: RetrievalContext, ) -> ConversationStoreFuture<'_, Result<SemanticMemorySearchOutcome, ConversationStoreError>>

Searches memory under an explicit cancellation/deadline scope.

Stores with embedding support should override this method and report query-embedding and storage usage.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§