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 async fn query_project_sources_read_only(
&self,
project: &ProjectId,
query: &str,
) -> Result<ProjectMemoryCandidates>
pub async fn query_project_sources_read_only( &self, project: &ProjectId, query: &str, ) -> Result<ProjectMemoryCandidates>
Compact, read-only discovery in the Host-authorized Project only.
Sourcepub async fn read_project_source_read_only(
&self,
project: &ProjectId,
memory_id: &str,
content_version: &str,
) -> Result<ProjectMemoryRead>
pub async fn read_project_source_read_only( &self, project: &ProjectId, memory_id: &str, content_version: &str, ) -> Result<ProjectMemoryRead>
Read the native exact adopted version without a Global/Session fallback.
Sourcepub fn data_dir(&self) -> PathBuf
pub fn data_dir(&self) -> PathBuf
The active Jiandu canonical root, including an explicitly selected root. External clients must share this root rather than guessing a default.
Sourcepub fn new(data_dir: impl Into<PathBuf>) -> Self
pub fn new(data_dir: impl Into<PathBuf>) -> Self
Construct a Jiandu store rooted at an explicit data directory.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
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) -> Self
pub fn for_project(&self, project_id: &ProjectId) -> Self
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>>
pub async fn write_session_topic( &self, session_id: &str, topic: &str, content: &str, ) -> Result<PathBuf>
pub async fn delete_session_topic( &self, session_id: &str, topic: &str, ) -> Result<bool>
pub async fn list_session_topics(&self, session_id: &str) -> Result<Vec<String>>
pub async fn read_session_topics_with_content( &self, session_id: &str, ) -> Result<Vec<(String, String)>>
pub async fn read_session_state(&self, session_id: &str) -> Result<SessionState>
pub async fn mark_session_extracted( &self, session_id: &str, extracted_at: &str, ) -> Result<()>
pub async fn read_memory_view( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<Option<String>>
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>
pub async fn inspect_scope( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<MemoryInspectResult>
pub async fn get_memory( &self, id: &str, preferred_project_key: Option<&str>, ) -> Result<Option<DurableMemoryDocument>>
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>
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>
pub async fn archive_memory( &self, id: &str, preferred_project_key: Option<&str>, mode: DurableMemoryStatus, reason: Option<&str>, ) -> Result<Option<DurableMemoryDocument>>
pub async fn split_memory( &self, id: &str, preferred_project_key: Option<&str>, pieces: &[MemorySplitPiece], session_id: Option<&str>, actor: &str, ) -> Result<Option<MemorySplitResult>>
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>>
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>>
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>>
pub async fn scan_blob_candidates( &self, scope: MemoryScope, project_key: Option<&str>, min_appended_sections: usize, limit: usize, ) -> Result<BlobScanReport>
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>
pub async fn consolidate_memories( &self, ids: &[String], preferred_project_key: Option<&str>, merged: &MemorySplitPiece, session_id: Option<&str>, actor: &str, ) -> Result<Option<MemoryConsolidateResult>>
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>>
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>
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>>
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>>
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>>
pub async fn rebuild_scope( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<()>
pub async fn current_scope_generation( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<String>
pub async fn read_dream_snapshot( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<DreamReadResult>
pub async fn publish_dream_snapshot( &self, scope: MemoryScope, project_key: Option<&str>, source_generation: &str, content: &str, ) -> Result<DreamSnapshot>
pub async fn list_memory_documents( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<Vec<DurableMemoryDocument>>
pub async fn count_scope_memories( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<usize>
pub async fn enforce_scope_capacity( &self, scope: MemoryScope, project_key: Option<&str>, capacity: usize, max_archivals: usize, ) -> Result<Vec<String>>
pub async fn expire_stale_granularity( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<Vec<String>>
Trait Implementations§
Source§impl Clone for MemoryStore
impl Clone for MemoryStore
Source§impl Debug for MemoryStore
impl Debug for MemoryStore
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