StorageInterface

Trait StorageInterface 

Source
pub trait StorageInterface: Send + Sync {
    // Required methods
    fn store<'life0, 'life1, 'async_trait>(
        &'life0 self,
        content: &'life1 str,
        context: String,
        summary: String,
        tags: Option<Vec<String>>,
    ) -> Pin<Box<dyn Future<Output = Result<Uuid>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn store_chunk<'life0, 'life1, 'async_trait>(
        &'life0 self,
        content: &'life1 str,
        context: String,
        summary: String,
        tags: Option<Vec<String>>,
        chunk_index: i32,
        total_chunks: i32,
        parent_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Uuid>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Memory>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search<'life0, 'async_trait>(
        &'life0 self,
        params: SearchParams,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stats<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<StorageStats>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_recent<'life0, 'async_trait>(
        &'life0 self,
        limit: i64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Memory>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_chunks<'life0, 'async_trait>(
        &'life0 self,
        parent_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Memory>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Storage trait defining the interface for memory storage operations

Required Methods§

Source

fn store<'life0, 'life1, 'async_trait>( &'life0 self, content: &'life1 str, context: String, summary: String, tags: Option<Vec<String>>, ) -> Pin<Box<dyn Future<Output = Result<Uuid>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store text content with context and summary

Source

fn store_chunk<'life0, 'life1, 'async_trait>( &'life0 self, content: &'life1 str, context: String, summary: String, tags: Option<Vec<String>>, chunk_index: i32, total_chunks: i32, parent_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Uuid>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store a chunk with parent reference

Source

fn get<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Memory>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get memory by ID

Source

fn delete<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete memory by ID

Source

fn search<'life0, 'async_trait>( &'life0 self, params: SearchParams, ) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Search memories with flexible parameters

Source

fn stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<StorageStats>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get storage statistics

Source

fn list_recent<'life0, 'async_trait>( &'life0 self, limit: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<Memory>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List recent memories

Source

fn get_chunks<'life0, 'async_trait>( &'life0 self, parent_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Memory>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all chunks for a parent document

Implementors§