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
impl SemanticMemoryAdapter
Sourcepub fn new(store: MemoryStore) -> Self
pub fn new(store: MemoryStore) -> Self
Wrap an existing MemoryStore.
Sourcepub async fn search(
&self,
query: &str,
scope: &Scope,
limit: Option<usize>,
source_types: Option<&[SearchSourceType]>,
) -> Result<Vec<SearchResult>, RuntimeError>
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.
Sourcepub async fn search_with_receipt(
&self,
query: &str,
scope: &Scope,
limit: Option<usize>,
source_types: Option<&[SearchSourceType]>,
) -> Result<(Vec<SearchResult>, Option<RuntimeDerivedCandidateTraceV1>), RuntimeError>
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.
Sourcepub async fn search_explained(
&self,
query: &str,
scope: &Scope,
limit: usize,
relevance_threshold: f64,
) -> Result<ExplainedSearchArtifacts, RuntimeError>
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.
Sourcepub async fn search_projection_text(
&self,
query: &str,
scope: &Scope,
limit: usize,
) -> Result<Vec<SearchResult>, RuntimeError>
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.
Sourcepub 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>
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.
Sourcepub async fn search_projection_temporal(
&self,
query: &str,
scope: &Scope,
valid_at: &str,
limit: usize,
) -> Result<Vec<SearchResult>, RuntimeError>
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.
Sourcepub async fn search_projection_by_entity_ids(
&self,
scope: &Scope,
entity_ids: &[EntityId],
limit: usize,
) -> Result<Vec<SearchResult>, RuntimeError>
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.
Sourcepub 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>
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.
Sourcepub async fn query_alias_candidates(
&self,
mention: &str,
scope: &Scope,
limit: usize,
) -> Result<Vec<ProjectionEntityAlias>, RuntimeError>
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.
Sourcepub 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>
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.
Sourcepub 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>
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.
Sourcepub 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>
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.
Sourcepub fn store(&self) -> &MemoryStore
pub fn store(&self) -> &MemoryStore
Get the underlying store reference for advanced read operations (graph traversal, explained search, etc.).
Sourcepub async fn last_import_at(
&self,
namespace: &str,
) -> Result<Option<String>, RuntimeError>
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.
Sourcepub async fn latest_kernel_projection_import(
&self,
scope_key: &ScopeKey,
) -> Result<Option<ProjectionImportLogEntry>, RuntimeError>
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
impl Clone for SemanticMemoryAdapter
Source§fn clone(&self) -> SemanticMemoryAdapter
fn clone(&self) -> SemanticMemoryAdapter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more