pub struct MemoryStore { /* private fields */ }Expand description
Bamboo-facing memory handle. Jiandu remains private so Bamboo callers cannot bypass the facade’s Project identity and inspection extensions.
Implementations§
Source§impl MemoryStore
impl MemoryStore
Sourcepub fn new(data_dir: impl Into<PathBuf>) -> MemoryStore
pub fn new(data_dir: impl Into<PathBuf>) -> MemoryStore
Construct a Jiandu store rooted at an explicit data directory.
Sourcepub fn with_defaults() -> MemoryStore
pub fn with_defaults() -> MemoryStore
Construct the production store at the independent ~/.jiandu root.
Sourcepub fn default_data_dir() -> PathBuf
pub fn default_data_dir() -> PathBuf
Resolve the canonical production data root used by Self::with_defaults.
Sourcepub fn for_project(&self, project_id: &ProjectId) -> MemoryStore
pub fn for_project(&self, project_id: &ProjectId) -> MemoryStore
Bind Project memory to Bamboo’s first-class Project identity.
pub async fn read_session_topic( &self, session_id: &str, topic: &str, ) -> Result<Option<String>, Error>
pub async fn write_session_topic( &self, session_id: &str, topic: &str, content: &str, ) -> Result<PathBuf, Error>
pub async fn delete_session_topic( &self, session_id: &str, topic: &str, ) -> Result<bool, Error>
pub async fn list_session_topics( &self, session_id: &str, ) -> Result<Vec<String>, Error>
pub async fn read_session_topics_with_content( &self, session_id: &str, ) -> Result<Vec<(String, String)>, Error>
pub async fn read_session_state( &self, session_id: &str, ) -> Result<SessionState, Error>
pub async fn mark_session_extracted( &self, session_id: &str, extracted_at: &str, ) -> Result<(), Error>
pub async fn read_memory_view( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<Option<String>, Error>
pub async fn query_scope( &self, scope: MemoryScope, project_key: Option<&str>, query: Option<&str>, filter_types: Option<&HashSet<DurableMemoryType>>, filter_statuses: Option<&HashSet<DurableMemoryStatus>>, filter_granularity: Option<&HashSet<TemporalGranularity>>, options: &MemoryQueryOptions, ) -> Result<MemoryQueryResult, Error>
pub async fn inspect_scope( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<MemoryInspectResult, Error>
pub async fn get_memory( &self, id: &str, preferred_project_key: Option<&str>, ) -> Result<Option<DurableMemoryDocument>, Error>
pub async fn write_memory( &self, scope: MemoryScope, project_key: Option<&str>, type: DurableMemoryType, title: &str, content: &str, tags: &[String], session_id: Option<&str>, actor: &str, allow_merge_if_similar: bool, granularity: Option<TemporalGranularity>, ) -> Result<DurableMemoryDocument, Error>
pub async fn write_memory_with_retrieval( &self, scope: MemoryScope, project_key: Option<&str>, type: DurableMemoryType, title: &str, content: &str, tags: &[String], retrieval: &MemoryRetrievalInput, session_id: Option<&str>, actor: &str, allow_merge_if_similar: bool, granularity: Option<TemporalGranularity>, ) -> Result<DurableMemoryDocument, Error>
pub async fn archive_memory( &self, id: &str, preferred_project_key: Option<&str>, mode: DurableMemoryStatus, reason: Option<&str>, ) -> Result<Option<DurableMemoryDocument>, Error>
pub async fn split_memory( &self, id: &str, preferred_project_key: Option<&str>, pieces: &[MemorySplitPiece], session_id: Option<&str>, actor: &str, ) -> Result<Option<MemorySplitResult>, Error>
pub async fn split_memory_with_retrieval( &self, id: &str, preferred_project_key: Option<&str>, pieces: &[MemorySplitPiece], retrieval: &[MemoryRetrievalInput], session_id: Option<&str>, actor: &str, ) -> Result<Option<MemorySplitResult>, Error>
pub async fn find_duplicate_candidates( &self, scope: MemoryScope, project_key: Option<&str>, type: Option<DurableMemoryType>, title: &str, content: &str, tags: &[String], limit: usize, ) -> Result<Vec<MemoryDuplicateCandidate>, Error>
pub async fn find_duplicate_candidates_with_retrieval( &self, scope: MemoryScope, project_key: Option<&str>, type: Option<DurableMemoryType>, title: &str, content: &str, tags: &[String], retrieval: &MemoryRetrievalInput, limit: usize, ) -> Result<Vec<MemoryDuplicateCandidate>, Error>
pub async fn scan_blob_candidates( &self, scope: MemoryScope, project_key: Option<&str>, min_appended_sections: usize, limit: usize, ) -> Result<BlobScanReport, Error>
pub async fn scan_duplicate_clusters( &self, scope: MemoryScope, project_key: Option<&str>, min_score: f64, max_members_per_cluster: usize, limit: usize, ) -> Result<DuplicateScanReport, Error>
pub async fn consolidate_memories( &self, ids: &[String], preferred_project_key: Option<&str>, merged: &MemorySplitPiece, session_id: Option<&str>, actor: &str, ) -> Result<Option<MemoryConsolidateResult>, Error>
pub async fn consolidate_memories_with_retrieval( &self, ids: &[String], preferred_project_key: Option<&str>, merged: &MemorySplitPiece, retrieval: &MemoryRetrievalInput, session_id: Option<&str>, actor: &str, ) -> Result<Option<MemoryConsolidateResult>, Error>
pub async fn purge_memories( &self, scope: MemoryScope, project_key: Option<&str>, filter_types: Option<&HashSet<DurableMemoryType>>, filter_statuses: Option<&HashSet<DurableMemoryStatus>>, filter_granularity: Option<&HashSet<TemporalGranularity>>, mode: DurableMemoryStatus, reason: Option<&str>, ) -> Result<MemoryPurgeResult, Error>
pub async fn mark_memory_contradicted( &self, id: &str, preferred_project_key: Option<&str>, contradicted_by_ids: &[String], reason: Option<&str>, session_id: Option<&str>, actor: &str, ) -> Result<Option<MemoryContradictionResult>, Error>
pub async fn merge_memory( &self, id: &str, preferred_project_key: Option<&str>, content: &str, tags: &[String], session_id: Option<&str>, actor: &str, source_memory_ids: &[String], ) -> Result<Option<MemoryMergeResult>, Error>
pub async fn merge_memory_with_retrieval( &self, id: &str, preferred_project_key: Option<&str>, content: &str, tags: &[String], retrieval: &MemoryRetrievalInput, session_id: Option<&str>, actor: &str, source_memory_ids: &[String], ) -> Result<Option<MemoryMergeResult>, Error>
pub async fn rebuild_scope( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<(), Error>
pub async fn current_scope_generation( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<String, Error>
pub async fn read_dream_snapshot( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<DreamReadResult, Error>
pub async fn publish_dream_snapshot( &self, scope: MemoryScope, project_key: Option<&str>, source_generation: &str, content: &str, ) -> Result<DreamSnapshot, Error>
pub async fn list_memory_documents( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<Vec<DurableMemoryDocument>, Error>
pub async fn count_scope_memories( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<usize, Error>
pub async fn enforce_scope_capacity( &self, scope: MemoryScope, project_key: Option<&str>, capacity: usize, max_archivals: usize, ) -> Result<Vec<String>, Error>
pub async fn expire_stale_granularity( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<Vec<String>, Error>
Trait Implementations§
Source§impl Clone for MemoryStore
impl Clone for MemoryStore
Source§fn clone(&self) -> MemoryStore
fn clone(&self) -> MemoryStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryStore
impl Debug for MemoryStore
Source§impl Default for MemoryStore
impl Default for MemoryStore
Source§fn default() -> MemoryStore
fn default() -> MemoryStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryStore
impl RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
impl UnwindSafe for MemoryStore
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