Skip to main content

MemoryStore

Struct MemoryStore 

Source
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

Source

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.

Source

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.

Source

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.

Source

pub fn new(data_dir: impl Into<PathBuf>) -> Self

Construct a Jiandu store rooted at an explicit data directory.

Source

pub fn with_defaults() -> Self

Construct the production store at the independent ~/.jiandu root.

Source

pub fn default_data_dir() -> PathBuf

Resolve the canonical production data root used by Self::with_defaults.

Source

pub fn for_project(&self, project_id: &ProjectId) -> Self

Bind Project memory to Bamboo’s first-class Project identity.

Source

pub async fn read_session_topic( &self, session_id: &str, topic: &str, ) -> Result<Option<String>>

Source

pub async fn write_session_topic( &self, session_id: &str, topic: &str, content: &str, ) -> Result<PathBuf>

Source

pub async fn delete_session_topic( &self, session_id: &str, topic: &str, ) -> Result<bool>

Source

pub async fn list_session_topics(&self, session_id: &str) -> Result<Vec<String>>

Source

pub async fn read_session_topics_with_content( &self, session_id: &str, ) -> Result<Vec<(String, String)>>

Source

pub async fn read_session_state(&self, session_id: &str) -> Result<SessionState>

Source

pub async fn mark_session_extracted( &self, session_id: &str, extracted_at: &str, ) -> Result<()>

Source

pub async fn read_memory_view( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<Option<String>>

Source

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>

Source

pub async fn inspect_scope( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<MemoryInspectResult>

Source

pub async fn get_memory( &self, id: &str, preferred_project_key: Option<&str>, ) -> Result<Option<DurableMemoryDocument>>

Source

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>

Source

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>

Source

pub async fn archive_memory( &self, id: &str, preferred_project_key: Option<&str>, mode: DurableMemoryStatus, reason: Option<&str>, ) -> Result<Option<DurableMemoryDocument>>

Source

pub async fn split_memory( &self, id: &str, preferred_project_key: Option<&str>, pieces: &[MemorySplitPiece], session_id: Option<&str>, actor: &str, ) -> Result<Option<MemorySplitResult>>

Source

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>>

Source

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>>

Source

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>>

Source

pub async fn scan_blob_candidates( &self, scope: MemoryScope, project_key: Option<&str>, min_appended_sections: usize, limit: usize, ) -> Result<BlobScanReport>

Source

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>

Source

pub async fn consolidate_memories( &self, ids: &[String], preferred_project_key: Option<&str>, merged: &MemorySplitPiece, session_id: Option<&str>, actor: &str, ) -> Result<Option<MemoryConsolidateResult>>

Source

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>>

Source

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>

Source

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>>

Source

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>>

Source

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>>

Source

pub async fn rebuild_scope( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<()>

Source

pub async fn current_scope_generation( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<String>

Source

pub async fn read_dream_snapshot( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<DreamReadResult>

Source

pub async fn publish_dream_snapshot( &self, scope: MemoryScope, project_key: Option<&str>, source_generation: &str, content: &str, ) -> Result<DreamSnapshot>

Source

pub async fn list_memory_documents( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<Vec<DurableMemoryDocument>>

Source

pub async fn count_scope_memories( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<usize>

Source

pub async fn enforce_scope_capacity( &self, scope: MemoryScope, project_key: Option<&str>, capacity: usize, max_archivals: usize, ) -> Result<Vec<String>>

Source

pub async fn expire_stale_granularity( &self, scope: MemoryScope, project_key: Option<&str>, ) -> Result<Vec<String>>

Trait Implementations§

Source§

impl Clone for MemoryStore

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MemoryStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MemoryStore

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more