Skip to main content

SemanticMemoryBackend

Struct SemanticMemoryBackend 

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

Adapter that implements ContextMemoryBackend by delegating to SemanticMemory.

Implementations§

Source§

impl SemanticMemoryBackend

Source

pub fn new(inner: Arc<SemanticMemory>) -> Self

Wrap an Arc<SemanticMemory> in the backend adapter.

Trait Implementations§

Source§

impl ContextMemoryBackend for SemanticMemoryBackend

Source§

fn load_persona_facts( &self, min_confidence: f64, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemPersonaFact>, Box<dyn Error + Send + Sync>>> + Send + '_>>

Load persona facts with at least min_confidence.
Source§

fn load_trajectory_entries<'a>( &'a self, tier: Option<&'a str>, top_k: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemTrajectoryEntry>, Box<dyn Error + Send + Sync>>> + Send + 'a>>

Load top_k trajectory entries for the given tier filter (e.g. "procedural").
Source§

fn load_tree_nodes( &self, level: u32, top_k: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemTreeNode>, Box<dyn Error + Send + Sync>>> + Send + '_>>

Load top_k memory tree nodes at the given level.
Source§

fn load_summaries( &self, conversation_id: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemSummary>, Box<dyn Error + Send + Sync>>> + Send + '_>>

Load all summaries for the given conversation (raw row ID).
Source§

fn retrieve_reasoning_strategies<'a>( &'a self, query: &'a str, top_k: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemReasoningStrategy>, Box<dyn Error + Send + Sync>>> + Send + 'a>>

Retrieve the top-top_k reasoning strategies for query.
Source§

fn mark_reasoning_used<'a>( &'a self, ids: &'a [String], ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'a>>

Mark reasoning strategies as used (fire-and-forget; best-effort).
Source§

fn retrieve_corrections<'a>( &'a self, query: &'a str, limit: usize, min_score: f32, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemCorrection>, Box<dyn Error + Send + Sync>>> + Send + 'a>>

Retrieve corrections similar to query, up to limit with min_score.
Source§

fn recall<'a>( &'a self, query: &'a str, limit: usize, router: Option<&'a dyn AsyncMemoryRouter>, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemRecalledMessage>, Box<dyn Error + Send + Sync>>> + Send + 'a>>

Recall semantically similar messages for query, up to limit.
Source§

fn recall_graph_facts<'a>( &'a self, query: &'a str, params: GraphRecallParams<'a>, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemGraphFact>, Box<dyn Error + Send + Sync>>> + Send + 'a>>

Recall graph facts for query with view-aware enrichment.
Source§

fn search_session_summaries<'a>( &'a self, query: &'a str, limit: usize, current_conversation_id: Option<i64>, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemSessionSummary>, Box<dyn Error + Send + Sync>>> + Send + 'a>>

Search cross-session summaries for query, excluding current_conversation_id.
Source§

fn search_document_collection<'a>( &'a self, collection: &'a str, query: &'a str, top_k: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemDocumentChunk>, Box<dyn Error + Send + Sync>>> + Send + 'a>>

Search a named document collection for query, returning top_k chunks.

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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: 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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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