pub struct InMemoryFacade { /* private fields */ }Expand description
In-process test double for MemoryFacade.
Stores entries in a Vec and uses substring matching for recall.
No SQLite or Qdrant required — suitable for unit tests that exercise
memory-dependent agent logic without external infrastructure.
§Examples
let facade = InMemoryFacade::new();
let entry = MemoryEntry {
conversation_id: ConversationId(1),
role: "user".into(),
content: "Rust borrow checker".into(),
parts: vec![],
metadata: None,
};
let id = facade.remember(entry).await.unwrap();
let matches = facade.recall("borrow", 10).await.unwrap();
assert!(!matches.is_empty());Implementations§
Trait Implementations§
Source§impl Debug for InMemoryFacade
impl Debug for InMemoryFacade
Source§impl Default for InMemoryFacade
impl Default for InMemoryFacade
Source§fn default() -> InMemoryFacade
fn default() -> InMemoryFacade
Returns the “default value” for a type. Read more
Source§impl MemoryFacade for InMemoryFacade
impl MemoryFacade for InMemoryFacade
Source§async fn remember(&self, entry: MemoryEntry) -> Result<MessageId, MemoryError>
async fn remember(&self, entry: MemoryEntry) -> Result<MessageId, MemoryError>
Store a memory entry and return its ID. Read more
Source§async fn recall(
&self,
query: &str,
limit: usize,
) -> Result<Vec<MemoryMatch>, MemoryError>
async fn recall( &self, query: &str, limit: usize, ) -> Result<Vec<MemoryMatch>, MemoryError>
Source§async fn summarize(
&self,
conv_id: ConversationId,
) -> Result<String, MemoryError>
async fn summarize( &self, conv_id: ConversationId, ) -> Result<String, MemoryError>
Produce a textual summary of
conv_id. Read moreSource§async fn compact(
&self,
ctx: &CompactionContext,
) -> Result<CompactionResult, MemoryError>
async fn compact( &self, ctx: &CompactionContext, ) -> Result<CompactionResult, MemoryError>
Compact a conversation to fit within the token budget. Read more
Auto Trait Implementations§
impl !Freeze for InMemoryFacade
impl RefUnwindSafe for InMemoryFacade
impl Send for InMemoryFacade
impl Sync for InMemoryFacade
impl Unpin for InMemoryFacade
impl UnsafeUnpin for InMemoryFacade
impl UnwindSafe for InMemoryFacade
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request