Skip to main content

DurableStore

Trait DurableStore 

Source
pub trait DurableStore: MemoryStorage {
    // Required methods
    fn record_recalled(&self, names: &[String]) -> Result<(), MemoryError>;
    fn room(&self) -> usize;
    fn save_extracted(
        &self,
        found: Vec<DurableMemory>,
    ) -> Result<u32, MemoryError>;
    fn system_prompt(&self) -> Option<String>;
    fn index_for_prompt(&self) -> Option<String>;

    // Provided methods
    fn keeps(&self) -> bool { ... }
    fn retriever(&self) -> Arc<dyn MemoryRetriever> ⓘ { ... }
}
Expand description

A session’s durable memory as the turn recalls from it and adds to it.

Required Methods§

Source

fn record_recalled(&self, names: &[String]) -> Result<(), MemoryError>

Source

fn room(&self) -> usize

How many more an extraction may add; 0 skips extraction before any model call.

Source

fn save_extracted(&self, found: Vec<DurableMemory>) -> Result<u32, MemoryError>

Keep what extraction found: secrets refused, MemoryType::Project with the project, the rest globally, no more than there is room for. How many were written.

Source

fn system_prompt(&self) -> Option<String>

Source

fn index_for_prompt(&self) -> Option<String>

Provided Methods§

Source

fn keeps(&self) -> bool

false: recall, extraction, the memory prompt and the index are off whatever the settings say.

Source

fn retriever(&self) -> Arc<dyn MemoryRetriever> ⓘ

The retriever a session uses when the host gave none.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§