pub struct SessionMemory { /* private fields */ }Expand description
Manages neural memory across recording sessions.
Implementations§
Source§impl SessionMemory
impl SessionMemory
Sourcepub fn start_session(&mut self, subject_id: &str) -> String
pub fn start_session(&mut self, subject_id: &str) -> String
Start a new recording session, returning its unique ID.
If a session is already active, it is automatically ended first.
Sourcepub fn end_session(&mut self)
pub fn end_session(&mut self)
End the current recording session.
Sourcepub fn store(&mut self, embedding: NeuralEmbedding) -> Result<usize>
pub fn store(&mut self, embedding: NeuralEmbedding) -> Result<usize>
Store an embedding in the current session.
Returns an error if no session is active.
Sourcepub fn get_session_history(&self, session_id: &str) -> Vec<&NeuralEmbedding>
pub fn get_session_history(&self, session_id: &str) -> Vec<&NeuralEmbedding>
Get all embeddings from a specific session.
Sourcepub fn get_subject_history(&self, subject_id: &str) -> Vec<&NeuralEmbedding>
pub fn get_subject_history(&self, subject_id: &str) -> Vec<&NeuralEmbedding>
Get all embeddings for a given subject across all sessions.
Sourcepub fn get_session_metadata(&self, session_id: &str) -> Option<&SessionMetadata>
pub fn get_session_metadata(&self, session_id: &str) -> Option<&SessionMetadata>
Get metadata for a session.
Sourcepub fn current_session_id(&self) -> Option<&str>
pub fn current_session_id(&self) -> Option<&str>
Get the current active session ID.
Sourcepub fn store_ref(&self) -> &NeuralMemoryStore
pub fn store_ref(&self) -> &NeuralMemoryStore
Access the underlying store.
Auto Trait Implementations§
impl Freeze for SessionMemory
impl RefUnwindSafe for SessionMemory
impl Send for SessionMemory
impl Sync for SessionMemory
impl Unpin for SessionMemory
impl UnsafeUnpin for SessionMemory
impl UnwindSafe for SessionMemory
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