pub struct MnemopiMemoryBackend { /* private fields */ }Expand description
Wraps an oxicode_mnemopi::Mnemopi engine and exposes it through the
MemoryBackend trait used by the memory_* agent tools.
Implementations§
Source§impl MnemopiMemoryBackend
impl MnemopiMemoryBackend
Sourcepub fn open(
path: &Path,
session_id: &str,
embedding_provider: Option<Arc<dyn EmbeddingProvider>>,
embedding_model_name: &str,
) -> Result<Self, String>
pub fn open( path: &Path, session_id: &str, embedding_provider: Option<Arc<dyn EmbeddingProvider>>, embedding_model_name: &str, ) -> Result<Self, String>
Open or create a Mnemopi-backed memory store at path.
embedding_provider is the optional dense-vector model. When
Some, Mnemopi::remember/recall will auto-embed every stored
fact and recall query, activating the dense cosine-similarity
signal of the hybrid scoring formula. When None, recall runs in
FTS5-only mode.
embedding_model_name is the logical model identifier recorded
alongside each stored embedding (used for cache keying and
diagnostics). Pass an empty string when no provider is wired.
Source§impl MnemopiMemoryBackend
impl MnemopiMemoryBackend
Trait Implementations§
Source§impl Debug for MnemopiMemoryBackend
impl Debug for MnemopiMemoryBackend
Source§impl MemoryBackend for MnemopiMemoryBackend
impl MemoryBackend for MnemopiMemoryBackend
Source§fn clear_all<'a>(
&'a self,
) -> Pin<Box<dyn Future<Output = Result<usize, ToolError>> + Send + 'a>>
fn clear_all<'a>( &'a self, ) -> Pin<Box<dyn Future<Output = Result<usize, ToolError>> + Send + 'a>>
Bulk erase via the underlying SQLite connection: working_memory,
episodic_memory, and memory_embeddings. The FTS5 indices are
rebuilt by their existing triggers when rows are removed.
Uses Mnemopi::spawn_blocking so the call is safe from any
async context (the closure runs on the blocking pool; the
Source§fn enqueue_consolidation<'a>(
&'a self,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'a>>
fn enqueue_consolidation<'a>( &'a self, ) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'a>>
Real consolidation trigger: run a synchronous sleep pass through the engine. The Mnemopi facade already owns the SQLite handle, so this is the correct level for the operation — no separate pipeline DB is needed for an immediate consolidation pass.
Source§fn put<'a>(
&'a self,
content: &'a str,
kind: &'a str,
subject: &'a str,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'a>>
fn put<'a>( &'a self, content: &'a str, kind: &'a str, subject: &'a str, ) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'a>>
Source§fn search<'a>(
&'a self,
query: &'a str,
k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryItem>, ToolError>> + Send + 'a>>
fn search<'a>( &'a self, query: &'a str, k: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryItem>, ToolError>> + Send + 'a>>
k matches.Source§fn list<'a>(
&'a self,
subject: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryItem>, ToolError>> + Send + 'a>>
fn list<'a>( &'a self, subject: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryItem>, ToolError>> + Send + 'a>>
Source§fn delete<'a>(
&'a self,
id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), ToolError>> + Send + 'a>>
fn delete<'a>( &'a self, id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<(), ToolError>> + Send + 'a>>
Source§fn memory_info(&self) -> Option<String>
fn memory_info(&self) -> Option<String>
Source§fn trigger_consolidation(&self) -> Option<String>
fn trigger_consolidation(&self) -> Option<String>
Source§fn trigger_harmonize(&self) -> Option<String>
fn trigger_harmonize(&self) -> Option<String>
Auto Trait Implementations§
impl !RefUnwindSafe for MnemopiMemoryBackend
impl !UnwindSafe for MnemopiMemoryBackend
impl Freeze for MnemopiMemoryBackend
impl Send for MnemopiMemoryBackend
impl Sync for MnemopiMemoryBackend
impl Unpin for MnemopiMemoryBackend
impl UnsafeUnpin for MnemopiMemoryBackend
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more