pub struct MemorySystem { /* private fields */ }Expand description
The unified storage engine managing document and vector data.
Implementations§
Source§impl MemorySystem
impl MemorySystem
Sourcepub async fn new(embedding_dim: usize) -> Result<Self, CoreError>
pub async fn new(embedding_dim: usize) -> Result<Self, CoreError>
Create a new in-memory MemorySystem with lazy schema initialization. Schema queries run on first actual operation, not at construction.
Sourcepub async fn store_memory(
&self,
project_id: String,
content: String,
embedding: Vec<f32>,
) -> Result<(), CoreError>
pub async fn store_memory( &self, project_id: String, content: String, embedding: Vec<f32>, ) -> Result<(), CoreError>
Store a new memory block with its embedding vector.
pub async fn retrieve_context( &self, project_id: &str, query_embedding: Vec<f32>, top_k: u32, ) -> Result<Vec<String>, CoreError>
pub async fn store_execution_log( &self, session_id: &str, phase: &str, action: &str, result: &str, ) -> Result<(), CoreError>
pub async fn delete_project_memories( &self, project_id: &str, ) -> Result<(), CoreError>
pub async fn get_all_execution_logs( &self, ) -> Result<Vec<ExecutionLogEntry>, CoreError>
Sourcepub async fn delete_all_execution_logs(&self) -> Result<(), CoreError>
pub async fn delete_all_execution_logs(&self) -> Result<(), CoreError>
Delete all execution_log entries after summarization.
Sourcepub async fn get_execution_logs_by_session(
&self,
session_id: &str,
) -> Result<Vec<ExecutionLogEntry>, CoreError>
pub async fn get_execution_logs_by_session( &self, session_id: &str, ) -> Result<Vec<ExecutionLogEntry>, CoreError>
Query execution logs filtered by session_id.
pub fn embedding_dim(&self) -> usize
Auto Trait Implementations§
impl Freeze for MemorySystem
impl !RefUnwindSafe for MemorySystem
impl Send for MemorySystem
impl Sync for MemorySystem
impl Unpin for MemorySystem
impl UnsafeUnpin for MemorySystem
impl !UnwindSafe for MemorySystem
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
Source§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>
Converts
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>
Converts
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