Skip to main content

SemanticMemoryAdapter

Struct SemanticMemoryAdapter 

Source
pub struct SemanticMemoryAdapter { /* private fields */ }
Expand description

Read-only adapter over a semantic_memory::MemoryStore.

This adapter exposes only the query surface of MemoryStore. It intentionally does NOT expose mutation methods — the runtime owns derived projections, never source truth.

Implementations§

Source§

impl SemanticMemoryAdapter

Source

pub fn new(store: MemoryStore) -> Self

Wrap an existing MemoryStore.

Source

pub async fn search( &self, query: &str, scope: &Scope, limit: Option<usize>, source_types: Option<&[SearchSourceType]>, ) -> Result<Vec<SearchResult>, RuntimeError>

Hybrid search with scope applied as namespace filter.

Source

pub async fn search_with_receipt( &self, query: &str, scope: &Scope, limit: Option<usize>, source_types: Option<&[SearchSourceType]>, ) -> Result<(Vec<SearchResult>, Option<RuntimeDerivedCandidateTraceV1>), RuntimeError>

Hybrid search that requests semantic-memory receipt metadata and returns a runtime-safe derived candidate summary when available.

Source

pub async fn search_explained( &self, query: &str, scope: &Scope, limit: usize, relevance_threshold: f64, ) -> Result<ExplainedSearchArtifacts, RuntimeError>

Hybrid search with explicit explained-score payloads and runtime-owned provenance.

Source

pub async fn search_projection_text( &self, query: &str, scope: &Scope, limit: usize, ) -> Result<Vec<SearchResult>, RuntimeError>

Query imported projection rows by free-text content.

Source

pub async fn search_projection_temporal_with_recorded_at( &self, query: &str, scope: &Scope, valid_at: &str, recorded_at_or_before: &str, limit: usize, ) -> Result<Vec<SearchResult>, RuntimeError>

Query imported projection rows with explicit bitemporal filters.

This is the explicit form used by callers that need independent valid_at and recorded_at_or_before semantics.

Source

pub async fn search_projection_temporal( &self, query: &str, scope: &Scope, valid_at: &str, limit: usize, ) -> Result<Vec<SearchResult>, RuntimeError>

Query imported projection rows with temporal filters.

This convenience form keeps the existing route behavior by using the same valid_at value for both valid-time and transaction-time cutoffs.

Source

pub async fn search_projection_by_entity_ids( &self, scope: &Scope, entity_ids: &[EntityId], limit: usize, ) -> Result<Vec<SearchResult>, RuntimeError>

Query imported claim/relation rows for a bounded set of entity candidates.

Source

pub async fn search_projection_by_entity_ids_with_recorded_at( &self, scope: &Scope, entity_ids: &[EntityId], valid_at: &str, recorded_at_or_before: &str, limit: usize, ) -> Result<Vec<SearchResult>, RuntimeError>

Query imported claim/relation rows for a bounded set of entity candidates with explicit bitemporal filters.

Source

pub async fn query_alias_candidates( &self, mention: &str, scope: &Scope, limit: usize, ) -> Result<Vec<ProjectionEntityAlias>, RuntimeError>

Query bounded alias candidates from imported projection rows.

Source

pub async fn query_alias_candidates_with_recorded_at( &self, mention: &str, scope: &Scope, valid_at: &str, recorded_at_or_before: &str, limit: usize, ) -> Result<Vec<ProjectionEntityAlias>, RuntimeError>

Query bounded alias candidates from imported projection rows with explicit temporal filters.

Source

pub async fn query_evidence_refs_for_claim( &self, claim_id: &str, claim_version_id: Option<&str>, scope: &Scope, recorded_at_or_before: Option<&str>, limit: usize, ) -> Result<Vec<ProjectionEvidenceRef>, RuntimeError>

Query imported evidence-reference rows for a specific claim.

This is an explicit explain/audit entrypoint: raw evidence handles are returned as opaque ProjectionEvidenceRef rows and are not merged into normal search payloads.

Source

pub async fn query_claim_versions_for_claim( &self, claim_id: &str, claim_version_id: Option<&str>, scope: &Scope, recorded_at_or_before: Option<&str>, limit: usize, ) -> Result<Vec<ProjectionClaimVersion>, RuntimeError>

Query imported claim rows for a specific claim or claim version.

Source

pub fn store(&self) -> &MemoryStore

Get the underlying store reference for advanced read operations (graph traversal, explained search, etc.).

Source

pub async fn last_import_at( &self, namespace: &str, ) -> Result<Option<String>, RuntimeError>

Query the last successful import timestamp for a namespace.

Returns None if no imports have ever been recorded for this namespace. Used by the runtime to detect import staleness and emit warnings.

Source

pub async fn latest_kernel_projection_import( &self, scope_key: &ScopeKey, ) -> Result<Option<ProjectionImportLogEntry>, RuntimeError>

Return the most recent import receipt carrying a rebuildable kernel payload.

Trait Implementations§

Source§

impl Clone for SemanticMemoryAdapter

Source§

fn clone(&self) -> SemanticMemoryAdapter

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 SemanticMemoryAdapter

Source§

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

Formats the value using the given formatter. 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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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