Skip to main content

IngestStore

Trait IngestStore 

Source
pub trait IngestStore {
    // Required methods
    fn store_memory(&self, memory: &Memory) -> Result<()>;
    fn store_conversation(&self, conversation: &Conversation) -> Result<()>;
    fn store_relation(&self, relation: &Relation) -> Result<()>;
    fn find_or_create_entity(
        &self,
        name: &str,
        entity_type: &str,
    ) -> Result<Entity>;
    fn memory_content_exists(&self, content_prefix: &str) -> Result<bool>;

    // Provided methods
    fn store_memory_if_absent(&self, memory: &Memory) -> Result<bool> { ... }
    fn store_conversation_if_absent(
        &self,
        conversation: &Conversation,
    ) -> Result<bool> { ... }
    fn memory_id_taken(&self, _id: Uuid) -> Result<bool> { ... }
    fn memory_blocked(&self, _memory: &Memory) -> Result<bool> { ... }
}
Expand description

The store surface store_ingest_result writes through. Every StoreAdmin has it through the blanket impl below; tests implement it directly to inject failing writes.

Required Methods§

Source

fn store_memory(&self, memory: &Memory) -> Result<()>

Source

fn store_conversation(&self, conversation: &Conversation) -> Result<()>

Source

fn store_relation(&self, relation: &Relation) -> Result<()>

Source

fn find_or_create_entity(&self, name: &str, entity_type: &str) -> Result<Entity>

Source

fn memory_content_exists(&self, content_prefix: &str) -> Result<bool>

Provided Methods§

Source

fn store_memory_if_absent(&self, memory: &Memory) -> Result<bool>

True when it wrote. A store that cannot check existence writes.

Source

fn store_conversation_if_absent( &self, conversation: &Conversation, ) -> Result<bool>

True when it wrote. A store that cannot check existence writes.

Source

fn memory_id_taken(&self, _id: Uuid) -> Result<bool>

Whether a memory holds this id in any state or it is tombstoned.

Source

fn memory_blocked(&self, _memory: &Memory) -> Result<bool>

Whether a delete removed this memory’s text from its source.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§