pub struct MemoryContextStore { /* private fields */ }Expand description
In-process ContextStore used by tests and by the SDK default.
Kept in agent-core so core’s tests need no on-device database (and no
dependency on the embedded store crate).
Implementations§
Trait Implementations§
Source§impl ContextStore for MemoryContextStore
impl ContextStore for MemoryContextStore
Source§fn memorize<'life0, 'async_trait>(
&'life0 self,
frag: ContextFragment,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn memorize<'life0, 'async_trait>(
&'life0 self,
frag: ContextFragment,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist a fragment.
Source§fn recall<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 RecallQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<ContextFragment>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn recall<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 RecallQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<ContextFragment>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve the most relevant fragments for a query.
Source§fn compact<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ContextFragment, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn compact<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ContextFragment, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Merge a session’s fragments into a single compact fragment.
Source§fn get_by_key<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ContextFragment>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_by_key<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ContextFragment>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Lookup an explicit long-term memory by key (used by SDK
recall).Source§fn list_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 str,
top_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<ContextFragment>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 str,
top_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<ContextFragment>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Every fragment of a session, oldest first (used by
compact and by the
session memory listing).Auto Trait Implementations§
impl !Freeze for MemoryContextStore
impl RefUnwindSafe for MemoryContextStore
impl Send for MemoryContextStore
impl Sync for MemoryContextStore
impl Unpin for MemoryContextStore
impl UnsafeUnpin for MemoryContextStore
impl UnwindSafe for MemoryContextStore
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