Skip to main content

ContextVersionStore

Trait ContextVersionStore 

Source
pub trait ContextVersionStore: Send + Sync {
    // Required methods
    fn save_version(&self, version: &ContextVersion);
    fn load_version(&self, version: u64) -> Option<ContextVersion>;
    fn list_versions(&self) -> Vec<ContextVersionMeta>;

    // Provided method
    fn latest_version(&self) -> Option<ContextVersion> { ... }
}
Expand description

Pluggable storage for context version snapshots.

Implementations persist dropped messages from compaction for later retrieval, enabling RAG-style recall of earlier conversation context.

Required Methods§

Source

fn save_version(&self, version: &ContextVersion)

Save a context version. Called automatically during compaction.

Source

fn load_version(&self, version: u64) -> Option<ContextVersion>

Load a specific version by number.

Source

fn list_versions(&self) -> Vec<ContextVersionMeta>

List metadata for all stored versions, ordered by version number.

Provided Methods§

Source

fn latest_version(&self) -> Option<ContextVersion>

Load the most recent version, if any.

Implementors§