pub struct SqliteMemoryStore { /* private fields */ }Expand description
SQLite-backed memory store with FTS5 support.
Implementations§
Source§impl SqliteMemoryStore
impl SqliteMemoryStore
Sourcepub async fn open(path: &Path, config: MnemoConfig) -> Result<Self>
pub async fn open(path: &Path, config: MnemoConfig) -> Result<Self>
Open or create a memory database at the given path.
Trait Implementations§
Source§impl MemoryStore for SqliteMemoryStore
impl MemoryStore for SqliteMemoryStore
Source§fn ingest<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
role: &'life1 str,
content: &'life2 str,
token_count: usize,
) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn ingest<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
role: &'life1 str,
content: &'life2 str,
token_count: usize,
) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Ingest a new message into the store. Read more
Source§fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Full-text search across all stored messages and summaries. Read more
Source§fn get_context<'life0, 'async_trait>(
&'life0 self,
max_tokens: usize,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_context<'life0, 'async_trait>(
&'life0 self,
max_tokens: usize,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate context string for agent bootstrap. Read more
Source§fn get_context_entries<'life0, 'async_trait>(
&'life0 self,
max_tokens: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_context_entries<'life0, 'async_trait>(
&'life0 self,
max_tokens: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get recent context entries for the agent. Read more
Source§fn compact<'life0, 'life1, 'async_trait>(
&'life0 self,
summarizer: &'life1 dyn Summarizer,
) -> Pin<Box<dyn Future<Output = Result<CompactionStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn compact<'life0, 'life1, 'async_trait>(
&'life0 self,
summarizer: &'life1 dyn Summarizer,
) -> Pin<Box<dyn Future<Output = Result<CompactionStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run compaction if thresholds are exceeded. Read more
Source§fn message_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn message_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return total message count (including compacted).
Auto Trait Implementations§
impl !Freeze for SqliteMemoryStore
impl RefUnwindSafe for SqliteMemoryStore
impl Send for SqliteMemoryStore
impl Sync for SqliteMemoryStore
impl Unpin for SqliteMemoryStore
impl UnsafeUnpin for SqliteMemoryStore
impl UnwindSafe for SqliteMemoryStore
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