pub struct MemorySister { /* private fields */ }Expand description
Contracts-compliant Memory sister.
Wraps MemoryGraph + engines and implements all v0.2.0 traits.
This is the canonical “Memory as a sister” interface.
Implementations§
Source§impl MemorySister
impl MemorySister
Sourcepub fn from_graph(graph: MemoryGraph, file_path: Option<PathBuf>) -> Self
pub fn from_graph(graph: MemoryGraph, file_path: Option<PathBuf>) -> Self
Create from an existing graph (for migration from SessionManager).
Sourcepub fn graph(&self) -> &MemoryGraph
pub fn graph(&self) -> &MemoryGraph
Get a reference to the underlying graph.
Sourcepub fn graph_mut(&mut self) -> &mut MemoryGraph
pub fn graph_mut(&mut self) -> &mut MemoryGraph
Get a mutable reference to the underlying graph.
Sourcepub fn query_engine(&self) -> &QueryEngine
pub fn query_engine(&self) -> &QueryEngine
Get the query engine.
Sourcepub fn write_engine(&self) -> &WriteEngine
pub fn write_engine(&self) -> &WriteEngine
Get the write engine.
Sourcepub fn current_session_id(&self) -> Option<u32>
pub fn current_session_id(&self) -> Option<u32>
Get the current u32 session ID (for interop with existing code).
Trait Implementations§
Source§impl FileFormatReader for MemorySister
Available on crate feature format only.
impl FileFormatReader for MemorySister
Available on crate feature
format only.Source§fn read_file(path: &Path) -> SisterResult<Self>
fn read_file(path: &Path) -> SisterResult<Self>
Read a file with version handling
Source§fn can_read(path: &Path) -> SisterResult<FileInfo>
fn can_read(path: &Path) -> SisterResult<FileInfo>
Check if a file is readable (without full parse).
Returns file info for quick inspection
Source§fn file_version(path: &Path) -> SisterResult<Version>
fn file_version(path: &Path) -> SisterResult<Version>
Get file version without full parse
Source§impl FileFormatWriter for MemorySister
Available on crate feature format only.
impl FileFormatWriter for MemorySister
Available on crate feature
format only.Source§fn write_file(&self, path: &Path) -> SisterResult<()>
fn write_file(&self, path: &Path) -> SisterResult<()>
Write to a file path
Source§impl Grounding for MemorySister
impl Grounding for MemorySister
Source§fn ground(&self, claim: &str) -> SisterResult<GroundingResult>
fn ground(&self, claim: &str) -> SisterResult<GroundingResult>
Verify a claim against stored evidence. Read more
Source§fn evidence(
&self,
query: &str,
max_results: usize,
) -> SisterResult<Vec<EvidenceDetail>>
fn evidence( &self, query: &str, max_results: usize, ) -> SisterResult<Vec<EvidenceDetail>>
Get detailed evidence for a query. Read more
Source§fn suggest(
&self,
query: &str,
limit: usize,
) -> SisterResult<Vec<GroundingSuggestion>>
fn suggest( &self, query: &str, limit: usize, ) -> SisterResult<Vec<GroundingSuggestion>>
Find similar items when an exact match fails. Read more
Source§impl Queryable for MemorySister
impl Queryable for MemorySister
Source§fn query(&self, query: Query) -> SisterResult<QueryResult>
fn query(&self, query: Query) -> SisterResult<QueryResult>
Execute a query.
Source§fn supports_query(&self, query_type: &str) -> bool
fn supports_query(&self, query_type: &str) -> bool
Check if a query type is supported.
Source§fn query_types(&self) -> Vec<QueryTypeInfo>
fn query_types(&self) -> Vec<QueryTypeInfo>
List supported query types.
Source§fn search(&self, text: &str) -> Result<QueryResult, SisterError>
fn search(&self, text: &str) -> Result<QueryResult, SisterError>
Execute a simple search query.
Source§fn recent(&self, count: usize) -> Result<QueryResult, SisterError>
fn recent(&self, count: usize) -> Result<QueryResult, SisterError>
Get recent items.
Source§fn list(&self, limit: usize, offset: usize) -> Result<QueryResult, SisterError>
fn list(&self, limit: usize, offset: usize) -> Result<QueryResult, SisterError>
List items with pagination.
Source§impl SessionManagement for MemorySister
impl SessionManagement for MemorySister
Source§fn start_session(&mut self, name: &str) -> SisterResult<ContextId>
fn start_session(&mut self, name: &str) -> SisterResult<ContextId>
Start a new session. Returns the session ID.
The previous session (if any) is automatically ended
Source§fn end_session(&mut self) -> SisterResult<()>
fn end_session(&mut self) -> SisterResult<()>
End the current session.
After this, a new session must be started before operations
Source§fn current_session(&self) -> Option<ContextId>
fn current_session(&self) -> Option<ContextId>
Get the current session ID.
Returns None if no session is active
Source§fn current_session_info(&self) -> SisterResult<ContextInfo>
fn current_session_info(&self) -> SisterResult<ContextInfo>
Get info about the current session
Source§fn list_sessions(&self) -> SisterResult<Vec<ContextSummary>>
fn list_sessions(&self) -> SisterResult<Vec<ContextSummary>>
List all past sessions (most recent first)
Source§fn export_session(&self, id: ContextId) -> SisterResult<ContextSnapshot>
fn export_session(&self, id: ContextId) -> SisterResult<ContextSnapshot>
Export a session as a snapshot (for backup/transfer)
Source§fn import_session(
&mut self,
snapshot: ContextSnapshot,
) -> SisterResult<ContextId>
fn import_session( &mut self, snapshot: ContextSnapshot, ) -> SisterResult<ContextId>
Import a session from a snapshot
Source§fn start_session_with_metadata(
&mut self,
name: &str,
metadata: HashMap<String, Value>,
) -> Result<ContextId, SisterError>
fn start_session_with_metadata( &mut self, name: &str, metadata: HashMap<String, Value>, ) -> Result<ContextId, SisterError>
Start a new session with metadata
Source§fn get_session_info(&self, id: ContextId) -> Result<ContextInfo, SisterError>
fn get_session_info(&self, id: ContextId) -> Result<ContextInfo, SisterError>
Get info about a specific past session
Source§impl Sister for MemorySister
impl Sister for MemorySister
Source§const SISTER_TYPE: SisterType = SisterType::Memory
const SISTER_TYPE: SisterType = SisterType::Memory
The type of this sister
Source§const FILE_EXTENSION: &'static str = "amem"
const FILE_EXTENSION: &'static str = "amem"
File extension for this sister’s format (without dot)
Source§fn init(config: SisterConfig) -> SisterResult<Self>where
Self: Sized,
fn init(config: SisterConfig) -> SisterResult<Self>where
Self: Sized,
Initialize the sister with configuration
Source§fn health(&self) -> HealthStatus
fn health(&self) -> HealthStatus
Check health status
Source§fn shutdown(&mut self) -> SisterResult<()>
fn shutdown(&mut self) -> SisterResult<()>
Shutdown gracefully
Source§fn capabilities(&self) -> Vec<Capability>
fn capabilities(&self) -> Vec<Capability>
Get capabilities this sister provides
Source§fn sister_type(&self) -> SisterType
fn sister_type(&self) -> SisterType
Get the sister type
Source§fn file_extension(&self) -> &'static str
fn file_extension(&self) -> &'static str
Get the file extension
Source§fn is_healthy(&self) -> bool
fn is_healthy(&self) -> bool
Check if the sister is healthy
Source§fn mcp_prefix(&self) -> &'static str
fn mcp_prefix(&self) -> &'static str
Get MCP tool prefix
Auto Trait Implementations§
impl Freeze for MemorySister
impl RefUnwindSafe for MemorySister
impl Send for MemorySister
impl Sync for MemorySister
impl Unpin for MemorySister
impl UnsafeUnpin for MemorySister
impl UnwindSafe for MemorySister
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