pub struct SessionManager { /* private fields */ }Expand description
Manages the memory graph lifecycle, file I/O, and session state.
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn graph(&self) -> &MemoryGraph
pub fn graph(&self) -> &MemoryGraph
Get an immutable reference to the graph.
Sourcepub fn graph_mut(&mut self) -> &mut MemoryGraph
pub fn graph_mut(&mut self) -> &mut MemoryGraph
Get a mutable reference to the graph and mark as dirty.
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) -> u32
pub fn current_session_id(&self) -> u32
Current session ID.
Sourcepub fn start_session(&mut self, explicit_id: Option<u32>) -> McpResult<u32>
pub fn start_session(&mut self, explicit_id: Option<u32>) -> McpResult<u32>
Start a new session, optionally with an explicit ID.
Sourcepub fn end_session_with_episode(
&mut self,
session_id: u32,
summary: &str,
) -> McpResult<u64>
pub fn end_session_with_episode( &mut self, session_id: u32, summary: &str, ) -> McpResult<u64>
End a session and optionally create an episode summary.
Sourcepub fn maybe_auto_save(&mut self) -> McpResult<()>
pub fn maybe_auto_save(&mut self) -> McpResult<()>
Check if auto-save is needed and save if so.
Sourcepub fn run_maintenance_tick(&mut self) -> McpResult<()>
pub fn run_maintenance_tick(&mut self) -> McpResult<()>
Runs autonomous maintenance: sleep-cycle, auto-save, and periodic backup.
Sourcepub fn maybe_run_sleep_cycle(&mut self) -> McpResult<()>
pub fn maybe_run_sleep_cycle(&mut self) -> McpResult<()>
Run a periodic sleep-cycle: decay refresh + tier balancing + auto-archive.
Sourcepub fn maybe_auto_backup(&mut self) -> McpResult<()>
pub fn maybe_auto_backup(&mut self) -> McpResult<()>
Periodic backup of persisted state with retention pruning.
Sourcepub fn mark_dirty(&mut self)
pub fn mark_dirty(&mut self)
Mark the graph as dirty (needs saving).
Sourcepub fn maintenance_interval(&self) -> Duration
pub fn maintenance_interval(&self) -> Duration
Background maintenance loop interval.
Sourcepub fn capture_prompt_request(
&mut self,
prompt_name: &str,
arguments: Option<&Value>,
) -> McpResult<Option<u64>>
pub fn capture_prompt_request( &mut self, prompt_name: &str, arguments: Option<&Value>, ) -> McpResult<Option<u64>>
Capture a prompt template invocation (prompts/get) into memory.
Sourcepub fn capture_tool_call(
&mut self,
tool_name: &str,
arguments: Option<&Value>,
) -> McpResult<Option<u64>>
pub fn capture_tool_call( &mut self, tool_name: &str, arguments: Option<&Value>, ) -> McpResult<Option<u64>>
Capture a tool call input context into memory based on capture mode.