pub struct ArchivalMemory<B: StorageBackend> { /* private fields */ }Expand description
Archival Memory - Tier 3 long-term storage.
TigerStyle:
- High-level API over StorageBackend
- Automatic naming from content
- Generic over backend for testing
Implementations§
Source§impl<B: StorageBackend> ArchivalMemory<B>
impl<B: StorageBackend> ArchivalMemory<B>
Sourcepub fn with_config(backend: B, config: ArchivalMemoryConfig) -> Self
pub fn with_config(backend: B, config: ArchivalMemoryConfig) -> Self
Create with custom configuration.
Sourcepub async fn remember(
&self,
content: &str,
entity_type: EntityType,
name: Option<&str>,
) -> StorageResult<Entity>
pub async fn remember( &self, content: &str, entity_type: EntityType, name: Option<&str>, ) -> StorageResult<Entity>
Sourcepub async fn recall(
&self,
query: &str,
limit: Option<usize>,
) -> StorageResult<Vec<Entity>>
pub async fn recall( &self, query: &str, limit: Option<usize>, ) -> StorageResult<Vec<Entity>>
Sourcepub async fn forget(&self, id: &str) -> StorageResult<bool>
pub async fn forget(&self, id: &str) -> StorageResult<bool>
Sourcepub async fn get(&self, id: &str) -> StorageResult<Option<Entity>>
pub async fn get(&self, id: &str) -> StorageResult<Option<Entity>>
Get a specific memory by ID.
Sourcepub async fn list(
&self,
entity_type: Option<EntityType>,
limit: usize,
offset: usize,
) -> StorageResult<Vec<Entity>>
pub async fn list( &self, entity_type: Option<EntityType>, limit: usize, offset: usize, ) -> StorageResult<Vec<Entity>>
List memories of a given type.
Sourcepub async fn count(
&self,
entity_type: Option<EntityType>,
) -> StorageResult<usize>
pub async fn count( &self, entity_type: Option<EntityType>, ) -> StorageResult<usize>
Count memories of a given type.
Sourcepub async fn update(&self, entity: &Entity) -> StorageResult<String>
pub async fn update(&self, entity: &Entity) -> StorageResult<String>
Update an existing memory.
Sourcepub async fn remember_entity(&self, entity: Entity) -> StorageResult<Entity>
pub async fn remember_entity(&self, entity: Entity) -> StorageResult<Entity>
Remember with full entity builder control.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for ArchivalMemory<B>
impl<B> RefUnwindSafe for ArchivalMemory<B>where
B: RefUnwindSafe,
impl<B> Send for ArchivalMemory<B>
impl<B> Sync for ArchivalMemory<B>
impl<B> Unpin for ArchivalMemory<B>
impl<B> UnwindSafe for ArchivalMemory<B>where
B: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more