Skip to main content

MemoryPersistence

Trait MemoryPersistence 

Source
pub trait MemoryPersistence {
    // Required methods
    fn insert(&mut self, item: MemoryItem) -> Result<bool, MemoryStoreError>;
    fn insert_evidence(
        &self,
        link: EvidenceLink,
    ) -> Result<(), MemoryStoreError>;
    fn retrieve(
        &self,
        query: &str,
        limit: usize,
    ) -> Result<Vec<RetrievalResult>, MemoryStoreError>;
    fn get(&self, id: &str) -> Result<Option<MemoryItem>, MemoryStoreError>;
    fn count(&self) -> Result<usize, MemoryStoreError>;
    fn graph_upsert_node(
        &self,
        node: &GraphNode,
    ) -> Result<(), MemoryStoreError>;
    fn graph_upsert_edge(
        &self,
        edge: &GraphEdge,
    ) -> Result<(), MemoryStoreError>;
    fn graph_recall(
        &self,
        seed_ids: &[&str],
        max_hops: usize,
        min_edge_weight: f64,
        fanout: usize,
    ) -> Result<Vec<AssociationResult>, MemoryStoreError>;
    fn retention_candidates(
        &self,
        policy: &RetentionPolicy,
    ) -> Result<Vec<RetentionCandidate>, MemoryStoreError>;
}
Expand description

Domain operations for persisted memories and their provenance.

A metadata-only storage capability descriptor is not an operational implementation of this trait. The existing SQLite-backed store is the only binding here; no default or caller is changed by this declaration.

Required Methods§

Source

fn insert(&mut self, item: MemoryItem) -> Result<bool, MemoryStoreError>

Preserve add-only semantics: false means an exact duplicate was ignored.

Source

fn insert_evidence(&self, link: EvidenceLink) -> Result<(), MemoryStoreError>

Attach source provenance to an existing memory item.

Source

fn retrieve( &self, query: &str, limit: usize, ) -> Result<Vec<RetrievalResult>, MemoryStoreError>

Return existing bounded, scored lexical retrieval results.

Source

fn get(&self, id: &str) -> Result<Option<MemoryItem>, MemoryStoreError>

Look up one memory by its stable domain identifier.

Source

fn count(&self) -> Result<usize, MemoryStoreError>

Count authoritative memory records.

Source

fn graph_upsert_node(&self, node: &GraphNode) -> Result<(), MemoryStoreError>

Upsert a domain graph node without treating it as a vector index.

Source

fn graph_upsert_edge(&self, edge: &GraphEdge) -> Result<(), MemoryStoreError>

Upsert a domain graph edge preserving its evidence semantics.

Source

fn graph_recall( &self, seed_ids: &[&str], max_hops: usize, min_edge_weight: f64, fanout: usize, ) -> Result<Vec<AssociationResult>, MemoryStoreError>

Recall associated records within existing graph traversal bounds.

Source

fn retention_candidates( &self, policy: &RetentionPolicy, ) -> Result<Vec<RetentionCandidate>, MemoryStoreError>

Select records eligible under the existing retention policy.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§