Skip to main content

StorageBackend

Trait StorageBackend 

Source
pub trait StorageBackend: Send + Sync {
Show 39 methods // Required methods fn insert_memory<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 MemoryRecord, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_memory<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<MemoryRecord>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn update_memory<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 MemoryRecord, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn soft_delete_memory<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn hard_delete_memory<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_memories<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 MemoryFilter, limit: usize, offset: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn touch_memory<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn insert_acl<'life0, 'life1, 'async_trait>( &'life0 self, acl: &'life1 Acl, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn check_permission<'life0, 'life1, 'async_trait>( &'life0 self, memory_id: Uuid, principal_id: &'life1 str, required: Permission, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn insert_relation<'life0, 'life1, 'async_trait>( &'life0 self, relation: &'life1 Relation, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_relations_from<'life0, 'async_trait>( &'life0 self, source_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Relation>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_relations_to<'life0, 'async_trait>( &'life0 self, target_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Relation>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn delete_relation<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_latest_memory_hash<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, agent_id: &'life1 str, thread_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_latest_event_hash<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, agent_id: &'life1 str, thread_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_sync_watermark<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn set_sync_watermark<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 str, value: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn list_accessible_memory_ids<'life0, 'life1, 'async_trait>( &'life0 self, agent_id: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn insert_event<'life0, 'life1, 'async_trait>( &'life0 self, event: &'life1 AgentEvent, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_events<'life0, 'life1, 'async_trait>( &'life0 self, agent_id: &'life1 str, limit: usize, offset: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<AgentEvent>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_events_by_thread<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<AgentEvent>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_event<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<AgentEvent>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_child_events<'life0, 'async_trait>( &'life0 self, parent_event_id: Uuid, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<AgentEvent>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_memories_by_agent_ordered<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, agent_id: &'life1 str, thread_id: Option<&'life2 str>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn list_memories_since<'life0, 'life1, 'async_trait>( &'life0 self, updated_after: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn upsert_memory<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 MemoryRecord, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn cleanup_expired<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn insert_delegation<'life0, 'life1, 'async_trait>( &'life0 self, d: &'life1 Delegation, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_delegations_for<'life0, 'life1, 'async_trait>( &'life0 self, delegate_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Delegation>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn revoke_delegation<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn check_delegation<'life0, 'life1, 'async_trait>( &'life0 self, delegate_id: &'life1 str, memory_id: Uuid, required: Permission, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn insert_or_update_agent_profile<'life0, 'life1, 'async_trait>( &'life0 self, profile: &'life1 AgentProfile, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_agent_profile<'life0, 'life1, 'async_trait>( &'life0 self, agent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AgentProfile>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn insert_or_update_embedding_baseline<'life0, 'life1, 'async_trait>( &'life0 self, baseline: &'life1 EmbeddingBaseline, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_embedding_baseline<'life0, 'life1, 'async_trait>( &'life0 self, agent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<EmbeddingBaseline>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn insert_checkpoint<'life0, 'life1, 'async_trait>( &'life0 self, cp: &'life1 Checkpoint, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_checkpoint<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_checkpoints<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, branch: Option<&'life2 str>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Checkpoint>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_latest_checkpoint<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, branch: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait;
}

Required Methods§

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn list_memories<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 MemoryFilter, limit: usize, offset: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

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

Source

fn check_permission<'life0, 'life1, 'async_trait>( &'life0 self, memory_id: Uuid, principal_id: &'life1 str, required: Permission, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

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

Source

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

Source

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

Source

fn get_latest_memory_hash<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, agent_id: &'life1 str, thread_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_latest_event_hash<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, agent_id: &'life1 str, thread_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_sync_watermark<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn set_sync_watermark<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 str, value: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn list_accessible_memory_ids<'life0, 'life1, 'async_trait>( &'life0 self, agent_id: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn list_events<'life0, 'life1, 'async_trait>( &'life0 self, agent_id: &'life1 str, limit: usize, offset: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<AgentEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_events_by_thread<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<AgentEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn list_child_events<'life0, 'async_trait>( &'life0 self, parent_event_id: Uuid, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<AgentEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn list_memories_by_agent_ordered<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, agent_id: &'life1 str, thread_id: Option<&'life2 str>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn list_memories_since<'life0, 'life1, 'async_trait>( &'life0 self, updated_after: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

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

Source

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

Source

fn list_delegations_for<'life0, 'life1, 'async_trait>( &'life0 self, delegate_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Delegation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn check_delegation<'life0, 'life1, 'async_trait>( &'life0 self, delegate_id: &'life1 str, memory_id: Uuid, required: Permission, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn get_agent_profile<'life0, 'life1, 'async_trait>( &'life0 self, agent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AgentProfile>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn get_embedding_baseline<'life0, 'life1, 'async_trait>( &'life0 self, agent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<EmbeddingBaseline>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

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

Source

fn list_checkpoints<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, branch: Option<&'life2 str>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Checkpoint>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_latest_checkpoint<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, branch: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§