pub struct MemoryStore { /* private fields */ }Expand description
Agent memory store: write-time lexical recall + async enrichment queue.
Implementations§
Source§impl MemoryStore
impl MemoryStore
pub fn embedder(&self) -> &Arc<dyn EmbeddingProvider>
Sourcepub fn enrich_episode(&self, job: &EnrichmentJob) -> Result<(), String>
pub fn enrich_episode(&self, job: &EnrichmentJob) -> Result<(), String>
Embed an episode and store its vector for semantic retrieval.
Sourcepub fn drain_enrichment_queue(&self) -> usize
pub fn drain_enrichment_queue(&self) -> usize
Drain all pending enrichment jobs synchronously (tests / bench warmup).
Sourcepub fn search_vector(
&self,
namespace: &str,
query: &str,
k: usize,
) -> Vec<(u64, f32)>
pub fn search_vector( &self, namespace: &str, query: &str, k: usize, ) -> Vec<(u64, f32)>
Vector lane search over enriched episodes (brute-force; tuned for agent-memory scale).
pub fn enriched_episode_count(&self, namespace: &str) -> usize
Source§impl MemoryStore
impl MemoryStore
Sourcepub fn query(&self, q: &MemoryQuery) -> MemoryQueryResult
pub fn query(&self, q: &MemoryQuery) -> MemoryQueryResult
Three-lane fusion: BM25 + trigram (+ vector when enriched).
Source§impl MemoryStore
impl MemoryStore
pub fn new(_data_dir: Option<&Path>, config: MemoryStoreConfig) -> Self
pub fn with_embedder( _data_dir: Option<&Path>, config: MemoryStoreConfig, embedder: Arc<dyn EmbeddingProvider>, ) -> Self
pub fn with_defaults() -> Self
pub fn enrichment_queue(&self) -> &EnrichmentQueue
Sourcepub fn write_episode(&self, write: EpisodeWrite) -> MemoryResult<WriteResult>
pub fn write_episode(&self, write: EpisodeWrite) -> MemoryResult<WriteResult>
Write episode: lexical lanes indexed synchronously; enrichment queued async.
pub fn get_episode( &self, namespace: &str, id: EpisodeId, ) -> MemoryResult<Episode>
pub fn namespace_bm25(&self, namespace: &str) -> Option<Arc<InvertedIndex>>
pub fn search_bm25( &self, namespace: &str, query: &str, k: usize, ) -> Vec<(u64, f32)>
pub fn search_trigram_literal( &self, namespace: &str, literal: &str, k: usize, ) -> Vec<(u64, f32)>
pub fn episode_text(&self, namespace: &str, doc_id: u64) -> Option<String>
pub fn add_fact(&self, namespace: &str, fact: FactEdge) -> MemoryResult<FactId>
pub fn facts_valid_at(&self, namespace: &str, tau: u64) -> Vec<FactEdge>
pub fn invalidate_fact( &self, namespace: &str, fact_id: FactId, t_invalid: u64, ) -> bool
pub fn episode_count(&self, namespace: &str) -> usize
Auto Trait Implementations§
impl !Freeze for MemoryStore
impl !RefUnwindSafe for MemoryStore
impl !UnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more